import
git-svn-id: file:///var/svn/milsko-quake/trunk@1 78c9b134-79e4-4a3a-b968-f1130b8f396c
This commit is contained in:
commit
eb68e99544
192 changed files with 151514 additions and 0 deletions
21
Makefile
Normal file
21
Makefile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# $Id$
|
||||
.PHONY: all clean
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
CC = cc
|
||||
CFLAGS = -Iinclude -DGLQUAKE -I/usr/X11R7/include
|
||||
LDFLAGS = -L/usr/X11R7/lib
|
||||
LIBS = -lGL -lm -lXrandr
|
||||
|
||||
OBJS = src/cl_demo.o src/cl_input.o src/cl_main.o src/cl_parse.o src/cl_tent.o src/chase.o src/cmd.o src/common.o src/console.o src/crc.o src/cvar.o src/gl_draw.o src/gl_mesh.o src/gl_model.o src/gl_refrag.o src/gl_rlight.o src/gl_rmain.o src/gl_rmisc.o src/gl_rsurf.o src/gl_screen.o src/gl_test.o src/gl_warp.o src/host.o src/host_cmd.o src/keys.o src/menu.o src/mathlib.o src/net_dgrm.o src/net_loop.o src/net_main.o src/net_vcr.o src/pr_cmds.o src/pr_edict.o src/pr_exec.o src/r_part.o src/sbar.o src/sv_main.o src/sv_phys.o src/sv_move.o src/sv_user.o src/zone.o src/view.o src/wad.o src/world.o src/cd.o src/sound.o src/gl.o src/stb_ds.o src/snd_mem.o src/mix.o src/miniaudio.o src/snd_ma.o src/net_udp.o src/net_bsd.o src/sys.o
|
||||
|
||||
all: quake
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) quake
|
||||
|
||||
quake: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
87
gnu.txt
Normal file
87
gnu.txt
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 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.
|
||||
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.
|
||||
|
||||
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
|
||||
2
id1/autoexec.cfg
Normal file
2
id1/autoexec.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
+mlook
|
||||
joystick 0
|
||||
86
id1/config.cfg
Normal file
86
id1/config.cfg
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
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 1"
|
||||
bind "2" "impulse 2"
|
||||
bind "3" "impulse 3"
|
||||
bind "4" "impulse 4"
|
||||
bind "5" "impulse 5"
|
||||
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 "s" "+back"
|
||||
bind "t" "messagemode"
|
||||
bind "w" "+forward"
|
||||
bind "z" "+lookdown"
|
||||
bind "~" "toggleconsole"
|
||||
bind "UPARROW" "+forward"
|
||||
bind "DOWNARROW" "+back"
|
||||
bind "LEFTARROW" "+left"
|
||||
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" "+forward"
|
||||
bind "MOUSE3" "+mlook"
|
||||
bind "PAUSE" "pause"
|
||||
m_side "0.8"
|
||||
m_forward "1"
|
||||
m_yaw "0.022"
|
||||
m_pitch "0.022"
|
||||
sensitivity "1.500000"
|
||||
lookstrafe "0"
|
||||
lookspring "0.000000"
|
||||
cl_backspeed "200"
|
||||
cl_forwardspeed "200"
|
||||
_cl_color "0"
|
||||
_cl_name "player"
|
||||
_snd_mixahead "0.1"
|
||||
bgmvolume "1"
|
||||
volume "0.7"
|
||||
gl_triplebuffer "1"
|
||||
viewsize "100.000000"
|
||||
_config_modem_hangup "AT H"
|
||||
_config_modem_init ""
|
||||
_config_modem_clear "ATZ"
|
||||
_config_modem_dialtype "T"
|
||||
_config_com_modem "1.000000"
|
||||
_config_com_baud "57600.000000"
|
||||
_config_com_irq "4.000000"
|
||||
_config_com_port "1016.000000"
|
||||
gl_subdivide_size "128"
|
||||
saved4 "0"
|
||||
saved3 "0"
|
||||
saved2 "0"
|
||||
saved1 "0"
|
||||
savedgamecfg "0"
|
||||
gamma "1.000000"
|
||||
crosshair "0"
|
||||
BIN
id1/glquake/armor.ms2
Normal file
BIN
id1/glquake/armor.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/backpack.ms2
Normal file
BIN
id1/glquake/backpack.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/bolt.ms2
Normal file
BIN
id1/glquake/bolt.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/bolt2.ms2
Normal file
BIN
id1/glquake/bolt2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/bolt3.ms2
Normal file
BIN
id1/glquake/bolt3.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/demon.ms2
Normal file
BIN
id1/glquake/demon.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/dog.ms2
Normal file
BIN
id1/glquake/dog.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/eyes.ms2
Normal file
BIN
id1/glquake/eyes.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/flame.ms2
Normal file
BIN
id1/glquake/flame.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/flame2.ms2
Normal file
BIN
id1/glquake/flame2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_light.ms2
Normal file
BIN
id1/glquake/g_light.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_nail.ms2
Normal file
BIN
id1/glquake/g_nail.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_nail2.ms2
Normal file
BIN
id1/glquake/g_nail2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_rock.ms2
Normal file
BIN
id1/glquake/g_rock.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_rock2.ms2
Normal file
BIN
id1/glquake/g_rock2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/g_shot.ms2
Normal file
BIN
id1/glquake/g_shot.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/gib1.ms2
Normal file
BIN
id1/glquake/gib1.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/gib2.ms2
Normal file
BIN
id1/glquake/gib2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/gib3.ms2
Normal file
BIN
id1/glquake/gib3.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/grenade.ms2
Normal file
BIN
id1/glquake/grenade.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_demon.ms2
Normal file
BIN
id1/glquake/h_demon.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_dog.ms2
Normal file
BIN
id1/glquake/h_dog.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_guard.ms2
Normal file
BIN
id1/glquake/h_guard.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_knight.ms2
Normal file
BIN
id1/glquake/h_knight.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_ogre.ms2
Normal file
BIN
id1/glquake/h_ogre.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_player.ms2
Normal file
BIN
id1/glquake/h_player.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_wizard.ms2
Normal file
BIN
id1/glquake/h_wizard.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/h_zombie.ms2
Normal file
BIN
id1/glquake/h_zombie.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/invisibl.ms2
Normal file
BIN
id1/glquake/invisibl.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/knight.ms2
Normal file
BIN
id1/glquake/knight.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/lavaball.ms2
Normal file
BIN
id1/glquake/lavaball.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/missile.ms2
Normal file
BIN
id1/glquake/missile.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/ogre.ms2
Normal file
BIN
id1/glquake/ogre.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/player.ms2
Normal file
BIN
id1/glquake/player.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/quaddama.ms2
Normal file
BIN
id1/glquake/quaddama.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/s_spike.ms2
Normal file
BIN
id1/glquake/s_spike.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/soldier.ms2
Normal file
BIN
id1/glquake/soldier.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/spike.ms2
Normal file
BIN
id1/glquake/spike.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/suit.ms2
Normal file
BIN
id1/glquake/suit.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_axe.ms2
Normal file
BIN
id1/glquake/v_axe.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_light.ms2
Normal file
BIN
id1/glquake/v_light.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_nail.ms2
Normal file
BIN
id1/glquake/v_nail.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_nail2.ms2
Normal file
BIN
id1/glquake/v_nail2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_rock.ms2
Normal file
BIN
id1/glquake/v_rock.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_rock2.ms2
Normal file
BIN
id1/glquake/v_rock2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_shot.ms2
Normal file
BIN
id1/glquake/v_shot.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/v_shot2.ms2
Normal file
BIN
id1/glquake/v_shot2.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/w_g_key.ms2
Normal file
BIN
id1/glquake/w_g_key.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/w_s_key.ms2
Normal file
BIN
id1/glquake/w_s_key.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/w_spike.ms2
Normal file
BIN
id1/glquake/w_spike.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/wizard.ms2
Normal file
BIN
id1/glquake/wizard.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/zom_gib.ms2
Normal file
BIN
id1/glquake/zom_gib.ms2
Normal file
Binary file not shown.
BIN
id1/glquake/zombie.ms2
Normal file
BIN
id1/glquake/zombie.ms2
Normal file
Binary file not shown.
BIN
id1/pak0.pak
Normal file
BIN
id1/pak0.pak
Normal file
Binary file not shown.
716
include/XDL.h
Normal file
716
include/XDL.h
Normal file
|
|
@ -0,0 +1,716 @@
|
|||
/*
|
||||
<Colleague Riley>
|
||||
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
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 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.
|
||||
|
||||
Credit is not required but would be greatly appreciated. :)
|
||||
*/
|
||||
|
||||
/*
|
||||
#define XDL_IMPLEMENTATION - (semi-option) makes it so function definitions are included
|
||||
#define XDL_NO_GLX - (optional) Makes it so the GLX module is not included
|
||||
#define XDL_NO_DEALLOCATE - (optional) Disables automatic deallocation for c++, returns back to C's void** system
|
||||
*/
|
||||
|
||||
/*
|
||||
Credits :
|
||||
GLFW - Much of this implementation is based on GLFW's internal x11 dynamic loader
|
||||
A great portion of the declarations for the X11 module are sourced from GLFW
|
||||
|
||||
stb - This project is heavily inspired by the stb single header files
|
||||
*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <X11/Xresource.h>
|
||||
|
||||
|
||||
#if defined(XDL_EXPORT) || defined(XDL_IMPORT)
|
||||
#if defined(_WIN32)
|
||||
#if defined(__TINYC__) && (defined(XDL_EXPORT) || defined(XDL_IMPORT))
|
||||
#define __declspec(x) __attribute__((x))
|
||||
#endif
|
||||
|
||||
#if defined(XDL_EXPORT)
|
||||
#define XDLDEF __declspec(dllexport)
|
||||
#else
|
||||
#define XDLDEF __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if defined(XDL_EXPORT)
|
||||
#define XDLDEF __attribute__((visibility("default")))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef XDLDEF
|
||||
#define XDLDEF inline
|
||||
#endif
|
||||
|
||||
XDLDEF void XDL_init(void); /* inits the X11 (and GLX) modules */
|
||||
XDLDEF void XDL_close(void); /* closes and frees the X11 (and GLX modules) */
|
||||
|
||||
/* function types */
|
||||
typedef XClassHint* (* PFN_XAllocClassHint)(void);
|
||||
typedef XSizeHints* (* PFN_XAllocSizeHints)(void);
|
||||
typedef XWMHints* (* PFN_XAllocWMHints)(void);
|
||||
typedef int (* PFN_XChangeProperty)(Display*,Window,Atom,Atom,int,int,const unsigned char*,int);
|
||||
typedef int (* PFN_XChangeWindowAttributes)(Display*,Window,unsigned long,XSetWindowAttributes*);
|
||||
typedef Bool (* PFN_XCheckIfEvent)(Display*,XEvent*,Bool(*)(Display*,XEvent*,XPointer),XPointer);
|
||||
typedef Bool (* PFN_XCheckTypedWindowEvent)(Display*,Window,int,XEvent*);
|
||||
typedef int (* PFN_XCloseDisplay)(Display*);
|
||||
typedef Status (* PFN_XCloseIM)(XIM);
|
||||
typedef int (* PFN_XConvertSelection)(Display*,Atom,Atom,Atom,Window,Time);
|
||||
typedef Colormap (* PFN_XCreateColormap)(Display*,Window,Visual*,int);
|
||||
typedef Cursor (* PFN_XCreateFontCursor)(Display*,unsigned int);
|
||||
typedef XIC (* PFN_XCreateIC)(XIM,...);
|
||||
typedef Region (* PFN_XCreateRegion)(void);
|
||||
typedef Window (* PFN_XCreateWindow)(Display*,Window,int,int,unsigned int,unsigned int,unsigned int,int,unsigned int,Visual*,unsigned long,XSetWindowAttributes*);
|
||||
typedef int (* PFN_XDefineCursor)(Display*,Window,Cursor);
|
||||
typedef int (* PFN_XDeleteContext)(Display*,XID,XContext);
|
||||
typedef int (* PFN_XDeleteProperty)(Display*,Window,Atom);
|
||||
typedef void (* PFN_XDestroyIC)(XIC);
|
||||
typedef int (* PFN_XDestroyRegion)(Region);
|
||||
typedef int (* PFN_XDestroyWindow)(Display*,Window);
|
||||
typedef int (* PFN_XDisplayKeycodes)(Display*,int*,int*);
|
||||
typedef int (* PFN_XEventsQueued)(Display*,int);
|
||||
typedef Bool (* PFN_XFilterEvent)(XEvent*,Window);
|
||||
typedef int (* PFN_XFindContext)(Display*,XID,XContext,XPointer*);
|
||||
typedef int (* PFN_XFlush)(Display*);
|
||||
typedef int (* PFN_XFree)(void*);
|
||||
typedef int (* PFN_XFreeColormap)(Display*,Colormap);
|
||||
typedef int (* PFN_XFreeCursor)(Display*,Cursor);
|
||||
typedef void (* PFN_XFreeEventData)(Display*,XGenericEventCookie*);
|
||||
typedef int (* PFN_XGetErrorText)(Display*,int,char*,int);
|
||||
typedef Bool (* PFN_XGetEventData)(Display*,XGenericEventCookie*);
|
||||
typedef char* (* PFN_XGetICValues)(XIC,...);
|
||||
typedef char* (* PFN_XGetIMValues)(XIM,...);
|
||||
typedef int (* PFN_XGetInputFocus)(Display*,Window*,int*);
|
||||
typedef KeySym* (* PFN_XGetKeyboardMapping)(Display*,KeyCode,int,int*);
|
||||
typedef int (* PFN_XGetScreenSaver)(Display*,int*,int*,int*,int*);
|
||||
typedef Window (* PFN_XGetSelectionOwner)(Display*,Atom);
|
||||
typedef XVisualInfo* (* PFN_XGetVisualInfo)(Display*,long,XVisualInfo*,int*);
|
||||
typedef Status (* PFN_XGetWMNormalHints)(Display*,Window,XSizeHints*,long*);
|
||||
typedef Status (* PFN_XGetWindowAttributes)(Display*,Window,XWindowAttributes*);
|
||||
typedef int (* PFN_XGetWindowProperty)(Display*,Window,Atom,long,long,Bool,Atom,Atom*,int*,unsigned long*,unsigned long*,unsigned char**);
|
||||
typedef int (* PFN_XGrabPointer)(Display*,Window,Bool,unsigned int,int,int,Window,Cursor,Time);
|
||||
typedef Status (* PFN_XIconifyWindow)(Display*,Window,int);
|
||||
typedef Status (* PFN_XInitThreads)(void);
|
||||
typedef Atom (* PFN_XInternAtom)(Display*,const char*,Bool);
|
||||
typedef int (* PFN_XLookupString)(XKeyEvent*,char*,int,KeySym*,XComposeStatus*);
|
||||
typedef int (* PFN_XMapRaised)(Display*,Window);
|
||||
typedef int (* PFN_XMapWindow)(Display*,Window);
|
||||
typedef int (* PFN_XMoveResizeWindow)(Display*,Window,int,int,unsigned int,unsigned int);
|
||||
typedef int (* PFN_XMoveWindow)(Display*,Window,int,int);
|
||||
typedef int (* PFN_XNextEvent)(Display*,XEvent*);
|
||||
typedef Display* (* PFN_XOpenDisplay)(const char*);
|
||||
typedef int (* PFN_XPeekEvent)(Display*,XEvent*);
|
||||
typedef int (* PFN_XPending)(Display*);
|
||||
typedef Bool (* PFN_XQueryExtension)(Display*,const char*,int*,int*,int*);
|
||||
typedef Bool (* PFN_XQueryPointer)(Display*,Window,Window*,Window*,int*,int*,int*,int*,unsigned int*);
|
||||
typedef int (* PFN_XRaiseWindow)(Display*,Window);
|
||||
typedef Bool (* PFN_XRegisterIMInstantiateCallback)(Display*,void*,char*,char*,XIDProc,XPointer);
|
||||
typedef int (* PFN_XResizeWindow)(Display*,Window,unsigned int,unsigned int);
|
||||
typedef char* (* PFN_XResourceManagerString)(Display*);
|
||||
typedef int (* PFN_XSaveContext)(Display*,XID,XContext,const char*);
|
||||
typedef int (* PFN_XSelectInput)(Display*,Window,long);
|
||||
typedef Status (* PFN_XSendEvent)(Display*,Window,Bool,long,XEvent*);
|
||||
typedef int (* PFN_XSetClassHint)(Display*,Window,XClassHint*);
|
||||
typedef XErrorHandler (* PFN_XSetErrorHandler)(XErrorHandler);
|
||||
typedef void (* PFN_XSetICFocus)(XIC);
|
||||
typedef char* (* PFN_XSetIMValues)(XIM,...);
|
||||
typedef int (* PFN_XSetInputFocus)(Display*,Window,int,Time);
|
||||
typedef char* (* PFN_XSetLocaleModifiers)(const char*);
|
||||
typedef int (* PFN_XSetScreenSaver)(Display*,int,int,int,int);
|
||||
typedef int (* PFN_XSetSelectionOwner)(Display*,Atom,Window,Time);
|
||||
typedef int (* PFN_XSetWMHints)(Display*,Window,XWMHints*);
|
||||
typedef void (* PFN_XSetWMNormalHints)(Display*,Window,XSizeHints*);
|
||||
typedef Status (* PFN_XSetWMProtocols)(Display*,Window,Atom*,int);
|
||||
typedef Bool (* PFN_XSupportsLocale)(void);
|
||||
typedef int (* PFN_XSync)(Display*,Bool);
|
||||
typedef Bool (* PFN_XTranslateCoordinates)(Display*,Window,Window,int,int,int*,int*,Window*);
|
||||
typedef int (* PFN_XUndefineCursor)(Display*,Window);
|
||||
typedef int (* PFN_XUngrabPointer)(Display*,Time);
|
||||
typedef int (* PFN_XUnmapWindow)(Display*,Window);
|
||||
typedef void (* PFN_XUnsetICFocus)(XIC);
|
||||
typedef VisualID (* PFN_XVisualIDFromVisual)(Visual*);
|
||||
typedef int (* PFN_XWarpPointer)(Display*,Window,Window,int,int,unsigned int,unsigned int,int,int);
|
||||
typedef void (* PFN_XkbFreeKeyboard)(XkbDescPtr,unsigned int,Bool);
|
||||
typedef void (* PFN_XkbFreeNames)(XkbDescPtr,unsigned int,Bool);
|
||||
typedef XkbDescPtr (* PFN_XkbGetMap)(Display*,unsigned int,unsigned int);
|
||||
typedef XkbDescPtr (* PFN_XkbGetKeyboardByName)(Display*,unsigned int,XkbComponentNamesPtr,unsigned int,unsigned int,Bool);
|
||||
typedef Status (* PFN_XkbGetNames)(Display*,unsigned int,XkbDescPtr);
|
||||
typedef Status (* PFN_XkbGetState)(Display*,unsigned int,XkbStatePtr);
|
||||
typedef KeySym (* PFN_XkbKeycodeToKeysym)(Display*,KeyCode,int,int);
|
||||
typedef Bool (* PFN_XkbQueryExtension)(Display*,int*,int*,int*,int*,int*);
|
||||
typedef Bool (* PFN_XkbSelectEventDetails)(Display*,unsigned int,unsigned int,unsigned long,unsigned long);
|
||||
typedef Bool (* PFN_XkbSetDetectableAutoRepeat)(Display*,Bool,Bool*);
|
||||
typedef KeySym (*PFN_XStringToKeysym)(char*);
|
||||
typedef int (*PFN_XConnectionNumber)(Display*);
|
||||
typedef int (*PFN_XStoreName)(Display*, Window, const char*);
|
||||
typedef Status (*PFN_XMatchVisualInfo)(Display*, int, int, int, XVisualInfo*);
|
||||
typedef void (*PFN_XSetWMSizeHints)(Display*, Window, XSizeHints*, Atom);
|
||||
typedef char* (*PFN_XKeysymToString)(KeySym);
|
||||
typedef int (*PFN_XGetKeyboardControl)(Display*, XKeyboardState*);
|
||||
typedef char* (*PFN_XGetAtomName)(Display*, Atom);
|
||||
typedef Window (*PFN_XDefaultRootWindow)(Display*);
|
||||
typedef int (*PFN_XQueryKeymap)(Display*, char[32]);
|
||||
typedef KeyCode (*PFN_XKeysymToKeycode)(Display*, KeySym);
|
||||
typedef void (*PFN_XFreeColors)(Display *display, Colormap colormap, unsigned long *pixels, int npixels, unsigned long planes);
|
||||
typedef int (*PFN_XDisplayWidth)(Display *display, int screen_number);
|
||||
typedef int (*PFN_XDisplayHeight)(Display *display, int screen_number);
|
||||
typedef int (*PFN_XGetSystemContentDPI)(Display* display);
|
||||
typedef XrmDatabase (*PFN_XrmGetStringDatabase)(const char *data);
|
||||
typedef Bool (*PFN_XrmGetResource)(XrmDatabase database, const char *resource_name, const char *resource_class, char **type, XrmValue *value);
|
||||
typedef void (*PFN_XrmDestroyDatabase)(XrmDatabase database);
|
||||
typedef char *(*PFN_XDisplayName)(const char *string);
|
||||
typedef int (*PFN_XWidthOfScreen)(Screen* screen);
|
||||
typedef int (*PFN_XHeightOfScreen)(Screen* screen);
|
||||
typedef GC (*PFN_XCreateGC)(Display* display, Drawable d, unsigned long valuemask, XGCValues* values);
|
||||
typedef int (*PFN_XFreeGC)(Display *display, GC gc);
|
||||
typedef XImage* (*PFN_XCreateImage)(Display*, Visual*, unsigned int, int, int, char*, unsigned int, unsigned int, int, int);
|
||||
typedef Pixmap (*PFN_XCreatePixmap)(Display* display, Drawable d, unsigned int width, unsigned int height, unsigned int depth);
|
||||
typedef int (*PFN_XPutImage)(Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height);
|
||||
|
||||
#ifndef XDL_NO_XRANDR
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
typedef XRRScreenResources *(*PFN_XRRGetScreenResourcesCurrent)(Display *display, Window window);
|
||||
typedef XRRCrtcInfo *(*PFN_XRRGetCrtcInfo)(Display *display, XRRScreenResources *resources, RRCrtc crtc);
|
||||
typedef XRROutputInfo *(*PFN_XRRGetOutputInfo)(Display *display, XRRScreenResources *resources, RROutput output);
|
||||
typedef void (*PFN_XRRFreeCrtcInfo)(XRRCrtcInfo *crtc_info);
|
||||
typedef XRRScreenResources *(*PFN_XRRGetScreenResources)(Display *display, Window window);
|
||||
typedef void (*PFN_XRRFreeScreenResources)(XRRScreenResources *resources);
|
||||
typedef void (*PFN_XRRFreeOutputInfo)(XRROutputInfo*);
|
||||
typedef Status (*PFN_XRRSetScreenConfig) (Display *dpy, XRRScreenConfiguration *config, Drawable draw, int size_index, Rotation rotation, Time timestamp);
|
||||
typedef Status (*PFN_XRRSetCrtcConfig)(Display*, XRRScreenResources*, RRCrtc, Time, int, int, RRMode, Rotation, RROutput*, int);
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
|
||||
#include <GL/glx.h>
|
||||
typedef XVisualInfo* (*PFN_glXChooseVisual)(Display*, int, int*);
|
||||
typedef GLXContext (*PFN_glXCreateContext)(Display*, XVisualInfo*, GLXContext, Bool);
|
||||
typedef Bool (*PFN_glXMakeCurrent)(Display*, GLXDrawable, GLXContext);
|
||||
typedef GLXContext (*PFN_glXGetCurrentContext)(void);
|
||||
typedef void (*PFN_glXSwapBuffers)(Display*, GLXDrawable);
|
||||
typedef PFNGLXSWAPINTERVALEXTPROC PFN_glXSwapIntervalEXT;
|
||||
typedef void* (*PFN_glXGetProcAddress)(const GLubyte *procname);
|
||||
typedef PFNGLXGETVISUALFROMFBCONFIGPROC PFN_glXGetVisualFromFBConfig;
|
||||
typedef PFNGLXGETFBCONFIGATTRIBPROC PFN_glXGetFBConfigAttrib;
|
||||
typedef __GLXextFuncPtr (*PFN_glXGetProcAddressARB)(const GLubyte *);
|
||||
typedef PFNGLXCHOOSEFBCONFIGPROC PFN_glXChooseFBConfig;
|
||||
typedef void (*PFN_glXDestroyContext)(Display *dpy, GLXContext ctx);
|
||||
#endif
|
||||
|
||||
/* Src vars for reciving the functions */
|
||||
PFN_XAllocClassHint XAllocClassHintSrc;
|
||||
PFN_XAllocSizeHints XAllocSizeHintsSrc;
|
||||
PFN_XAllocWMHints XAllocWMHintsSrc;
|
||||
PFN_XChangeProperty XChangePropertySrc;
|
||||
PFN_XChangeWindowAttributes XChangeWindowAttributesSrc;
|
||||
PFN_XCheckIfEvent XCheckIfEventSrc;
|
||||
PFN_XCheckTypedWindowEvent XCheckTypedWindowEventSrc;
|
||||
PFN_XCloseDisplay XCloseDisplaySrc;
|
||||
PFN_XCloseIM XCloseIMSrc;
|
||||
PFN_XConvertSelection XConvertSelectionSrc;
|
||||
PFN_XCreateColormap XCreateColormapSrc;
|
||||
PFN_XCreateFontCursor XCreateFontCursorSrc;
|
||||
PFN_XCreateIC XCreateICSrc;
|
||||
PFN_XCreateRegion XCreateRegionSrc;
|
||||
PFN_XCreateWindow XCreateWindowSrc;
|
||||
PFN_XDefineCursor XDefineCursorSrc;
|
||||
PFN_XDeleteContext XDeleteContextSrc;
|
||||
PFN_XDeleteProperty XDeletePropertySrc;
|
||||
PFN_XDestroyIC XDestroyICSrc;
|
||||
PFN_XDestroyRegion XDestroyRegionSrc;
|
||||
PFN_XDestroyWindow XDestroyWindowSrc;
|
||||
PFN_XDisplayKeycodes XDisplayKeycodesSrc;
|
||||
PFN_XEventsQueued XEventsQueuedSrc;
|
||||
PFN_XFilterEvent XFilterEventSrc;
|
||||
PFN_XFindContext XFindContextSrc;
|
||||
PFN_XFlush XFlushSrc;
|
||||
PFN_XFree XFreeSrc;
|
||||
PFN_XFreeColormap XFreeColormapSrc;
|
||||
PFN_XFreeCursor XFreeCursorSrc;
|
||||
PFN_XFreeEventData XFreeEventDataSrc;
|
||||
PFN_XGetErrorText XGetErrorTextSrc;
|
||||
PFN_XGetEventData XGetEventDataSrc;
|
||||
PFN_XGetICValues XGetICValuesSrc;
|
||||
PFN_XGetIMValues XGetIMValuesSrc;
|
||||
PFN_XGetInputFocus XGetInputFocusSrc;
|
||||
PFN_XGetKeyboardMapping XGetKeyboardMappingSrc;
|
||||
PFN_XGetScreenSaver XGetScreenSaverSrc;
|
||||
PFN_XGetSelectionOwner XGetSelectionOwnerSrc;
|
||||
PFN_XGetVisualInfo XGetVisualInfoSrc;
|
||||
PFN_XGetWMNormalHints XGetWMNormalHintsSrc;
|
||||
PFN_XGetWindowAttributes XGetWindowAttributesSrc;
|
||||
PFN_XGetWindowProperty XGetWindowPropertySrc;
|
||||
PFN_XGrabPointer XGrabPointerSrc;
|
||||
PFN_XIconifyWindow XIconifyWindowSrc;
|
||||
PFN_XInternAtom XInternAtomSrc;
|
||||
PFN_XLookupString XLookupStringSrc;
|
||||
PFN_XMapRaised XMapRaisedSrc;
|
||||
PFN_XMapWindow XMapWindowSrc;
|
||||
PFN_XMoveResizeWindow XMoveResizeWindowSrc;
|
||||
PFN_XMoveWindow XMoveWindowSrc;
|
||||
PFN_XNextEvent XNextEventSrc;
|
||||
PFN_XPeekEvent XPeekEventSrc;
|
||||
PFN_XPending XPendingSrc;
|
||||
PFN_XQueryExtension XQueryExtensionSrc;
|
||||
PFN_XQueryPointer XQueryPointerSrc;
|
||||
PFN_XRaiseWindow XRaiseWindowSrc;
|
||||
PFN_XRegisterIMInstantiateCallback XRegisterIMInstantiateCallbackSrc;
|
||||
PFN_XResizeWindow XResizeWindowSrc;
|
||||
PFN_XResourceManagerString XResourceManagerStringSrc;
|
||||
PFN_XSaveContext XSaveContextSrc;
|
||||
PFN_XSelectInput XSelectInputSrc;
|
||||
PFN_XSendEvent XSendEventSrc;
|
||||
PFN_XSetClassHint XSetClassHintSrc;
|
||||
PFN_XSetErrorHandler XSetErrorHandlerSrc;
|
||||
PFN_XSetICFocus XSetICFocusSrc;
|
||||
PFN_XSetIMValues XSetIMValuesSrc;
|
||||
PFN_XSetInputFocus XSetInputFocusSrc;
|
||||
PFN_XSetLocaleModifiers XSetLocaleModifiersSrc;
|
||||
PFN_XSetScreenSaver XSetScreenSaverSrc;
|
||||
PFN_XSetSelectionOwner XSetSelectionOwnerSrc;
|
||||
PFN_XSetWMHints XSetWMHintsSrc;
|
||||
PFN_XSetWMNormalHints XSetWMNormalHintsSrc;
|
||||
PFN_XSetWMProtocols XSetWMProtocolsSrc;
|
||||
PFN_XSupportsLocale XSupportsLocaleSrc;
|
||||
PFN_XSync XSyncSrc;
|
||||
PFN_XTranslateCoordinates XTranslateCoordinatesSrc;
|
||||
PFN_XUndefineCursor XUndefineCursorSrc;
|
||||
PFN_XUngrabPointer XUngrabPointerSrc;
|
||||
PFN_XUnmapWindow XUnmapWindowSrc;
|
||||
PFN_XUnsetICFocus XUnsetICFocusSrc;
|
||||
PFN_XVisualIDFromVisual XVisualIDFromVisualSrc;
|
||||
PFN_XWarpPointer XWarpPointerSrc;
|
||||
PFN_XOpenDisplay XOpenDisplaySrc;
|
||||
PFN_XInitThreads XInitThreadsSrc;
|
||||
PFN_XkbKeycodeToKeysym XkbKeycodeToKeysymSrc;
|
||||
PFN_XkbGetMap XkbGetMapSrc;
|
||||
PFN_XkbGetNames XkbGetNamesSrc;
|
||||
PFN_XkbGetKeyboardByName XkbGetKeyboardByNameSrc;
|
||||
PFN_XkbFreeKeyboard XkbFreeKeyboardSrc;
|
||||
PFN_XStringToKeysym XStringToKeysymSrc;
|
||||
PFN_XConnectionNumber XConnectionNumberSrc;
|
||||
PFN_XMatchVisualInfo XMatchVisualInfoSrc;
|
||||
PFN_XSetWMSizeHints XSetWMSizeHintsSrc;
|
||||
PFN_XStoreName XStoreNameSrc;
|
||||
PFN_XKeysymToString XKeysymToStringSrc;
|
||||
PFN_XGetKeyboardControl XGetKeyboardControlSrc;
|
||||
PFN_XGetAtomName XGetAtomNameSrc;
|
||||
PFN_XDefaultRootWindow XDefaultRootWindowSrc;
|
||||
PFN_XQueryKeymap XQueryKeymapSrc;
|
||||
PFN_XKeysymToKeycode XKeysymToKeycodeSrc;
|
||||
PFN_XFreeColors XFreeColorsSrc;
|
||||
PFN_XDisplayWidth XDisplayWidthSrc;
|
||||
PFN_XDisplayHeight XDisplayHeightSrc;
|
||||
PFN_XrmGetStringDatabase XrmGetStringDatabaseSrc;
|
||||
PFN_XrmGetResource XrmGetResourceSrc;
|
||||
PFN_XrmDestroyDatabase XrmDestroyDatabaseSrc;
|
||||
PFN_XDisplayName XDisplayNameSrc;
|
||||
PFN_XkbGetState XkbGetStateSrc;
|
||||
PFN_XWidthOfScreen XWidthOfScreenSrc;
|
||||
PFN_XWidthOfScreen XHeightOfScreenSrc;
|
||||
PFN_XCreateGC XCreateGCSrc;
|
||||
PFN_XFreeGC XFreeGCSrc;
|
||||
PFN_XCreateImage XCreateImageSrc;
|
||||
PFN_XCreatePixmap XCreatePixmapSrc;
|
||||
PFN_XPutImage XPutImageSrc;
|
||||
#ifndef XDL_NO_XRANDR
|
||||
PFN_XRRGetScreenResourcesCurrent XRRGetScreenResourcesCurrentSrc;
|
||||
PFN_XRRGetCrtcInfo XRRGetCrtcInfoSrc;
|
||||
PFN_XRRGetOutputInfo XRRGetOutputInfoSrc;
|
||||
PFN_XRRFreeCrtcInfo XRRFreeCrtcInfoSrc;
|
||||
PFN_XRRGetScreenResources XRRGetScreenResourcesSrc;
|
||||
PFN_XRRFreeScreenResources XRRFreeScreenResourcesSrc;
|
||||
PFN_XRRFreeOutputInfo XRRFreeOutputInfoSrc;
|
||||
PFN_XRRSetScreenConfig XRRSetScreenConfigSrc;
|
||||
PFN_XRRSetCrtcConfig XRRSetCrtcConfigSrc;
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
PFN_glXChooseVisual glXChooseVisualSrc;
|
||||
PFN_glXCreateContext glXCreateContextSrc;
|
||||
PFN_glXMakeCurrent glXMakeCurrentSrc;
|
||||
PFN_glXGetCurrentContext glXGetCurrentContextSrc;
|
||||
PFN_glXSwapBuffers glXSwapBuffersSrc;
|
||||
PFN_glXSwapIntervalEXT glXSwapIntervalEXTSrc;
|
||||
PFN_glXGetProcAddress glXGetProcAddressSrc;
|
||||
PFN_glXGetVisualFromFBConfig glXGetVisualFromFBConfigSrc;
|
||||
PFN_glXGetFBConfigAttrib glXGetFBConfigAttribSrc;
|
||||
PFN_glXGetProcAddressARB glXGetProcAddressARBSrc;
|
||||
PFN_glXChooseFBConfig glXChooseFBConfigSrc;
|
||||
PFN_glXDestroyContext glXDestroyContextSrc;
|
||||
#endif
|
||||
|
||||
/* Function to source defines */
|
||||
#define XAllocClassHint XAllocClassHintSrc
|
||||
#define XAllocSizeHints XAllocSizeHintsSrc
|
||||
#define XAllocWMHints XAllocWMHintsSrc
|
||||
#define XChangeProperty XChangePropertySrc
|
||||
#define XChangeWindowAttributes XChangeWindowAttributesSrc
|
||||
#define XCheckIfEvent XCheckIfEventSrc
|
||||
#define XCheckTypedWindowEvent XCheckTypedWindowEventSrc
|
||||
#define XCloseDisplay XCloseDisplaySrc
|
||||
#define XCloseIM XCloseIMSrc
|
||||
#define XConvertSelection XConvertSelectionSrc
|
||||
#define XCreateColormap XCreateColormapSrc
|
||||
#define XCreateFontCursor XCreateFontCursorSrc
|
||||
#define XCreateIC XCreateICSrc
|
||||
#define XCreateRegion XCreateRegionSrc
|
||||
#define XCreateWindow XCreateWindowSrc
|
||||
#define XDefineCursor XDefineCursorSrc
|
||||
#define XDeleteContext XDeleteContextSrc
|
||||
#define XDeleteProperty XDeletePropertySrc
|
||||
#define XDestroyIC XDestroyICSrc
|
||||
#define XDestroyRegion XDestroyRegionSrc
|
||||
#define XDestroyWindow XDestroyWindowSrc
|
||||
#define XDisplayKeycodes XDisplayKeycodesSrc
|
||||
#define XkbGetState XkbGetStateSrc
|
||||
#define XWidthOfScreen XWidthOfScreenSrc
|
||||
#define XHeightOfScreen XHeightOfScreenSrc
|
||||
#define XCreateGC XCreateGCSrc
|
||||
#define XFreeGC XFreeGCSrc
|
||||
#define XCreateImage XCreateImageSrc
|
||||
#define XEventsQueued XEventsQueuedSrc
|
||||
#define XFilterEvent XFilterEventSrc
|
||||
#define XFindContext XFindContextSrc
|
||||
#define XFlush XFlushSrc
|
||||
#define XFree XFreeSrc
|
||||
#define XFreeColormap XFreeColormapSrc
|
||||
#define XFreeCursor XFreeCursorSrc
|
||||
#define XFreeEventData XFreeEventDataSrc
|
||||
#define XGetErrorText XGetErrorTextSrc
|
||||
#define XGetEventData XGetEventDataSrc
|
||||
#define XGetICValues XGetICValuesSrc
|
||||
#define XGetIMValues XGetIMValuesSrc
|
||||
#define XGetInputFocus XGetInputFocusSrc
|
||||
#define XGetKeyboardMapping XGetKeyboardMappingSrc
|
||||
#define XGetScreenSaver XGetScreenSaverSrc
|
||||
#define XGetSelectionOwner XGetSelectionOwnerSrc
|
||||
#define XGetVisualInfo XGetVisualInfoSrc
|
||||
#define XGetWMNormalHints XGetWMNormalHintsSrc
|
||||
#define XGetWindowAttributes XGetWindowAttributesSrc
|
||||
#define XGetWindowProperty XGetWindowPropertySrc
|
||||
#define XGrabPointer XGrabPointerSrc
|
||||
#define XIconifyWindow XIconifyWindowSrc
|
||||
#define XInternAtom XInternAtomSrc
|
||||
#define XLookupString XLookupStringSrc
|
||||
#define XMapRaised XMapRaisedSrc
|
||||
#define XMapWindow XMapWindowSrc
|
||||
#define XMoveResizeWindow XMoveResizeWindowSrc
|
||||
#define XMoveWindow XMoveWindowSrc
|
||||
#define XNextEvent XNextEventSrc
|
||||
#define XPeekEvent XPeekEventSrc
|
||||
#define XPending XPendingSrc
|
||||
#define XQueryExtension XQueryExtensionSrc
|
||||
#define XQueryPointer XQueryPointerSrc
|
||||
#define XRaiseWindow XRaiseWindowSrc
|
||||
#define XRegisterIMInstantiateCallback XRegisterIMInstantiateCallbackSrc
|
||||
#define XResizeWindow XResizeWindowSrc
|
||||
#define XResourceManagerString XResourceManagerStringSrc
|
||||
#define XSaveContext XSaveContextSrc
|
||||
#define XSelectInput XSelectInputSrc
|
||||
#define XSendEvent XSendEventSrc
|
||||
#define XSetClassHint XSetClassHintSrc
|
||||
#define XSetErrorHandler XSetErrorHandlerSrc
|
||||
#define XSetICFocus XSetICFocusSrc
|
||||
#define XSetIMValues XSetIMValuesSrc
|
||||
#define XSetInputFocus XSetInputFocusSrc
|
||||
#define XSetLocaleModifiers XSetLocaleModifiersSrc
|
||||
#define XSetScreenSaver XSetScreenSaverSrc
|
||||
#define XSetSelectionOwner XSetSelectionOwnerSrc
|
||||
#define XSetWMHints XSetWMHintsSrc
|
||||
#define XSetWMNormalHints XSetWMNormalHintsSrc
|
||||
#define XSetWMProtocols XSetWMProtocolsSrc
|
||||
#define XSupportsLocale XSupportsLocaleSrc
|
||||
#define XSync XSyncSrc
|
||||
#define XTranslateCoordinates XTranslateCoordinatesSrc
|
||||
#define XUndefineCursor XUndefineCursorSrc
|
||||
#define XUngrabPointer XUngrabPointerSrc
|
||||
#define XUnmapWindow XUnmapWindowSrc
|
||||
#define XUnsetICFocus XUnsetICFocusSrc
|
||||
#define XVisualIDFromVisual XVisualIDFromVisualSrc
|
||||
#define XWarpPointer XWarpPointerSrc
|
||||
#define XStoreName XStoreNameSrc
|
||||
#define XSetWMSizeHints XSetWMSizeHintsSrc
|
||||
#define XOpenDisplay XOpenDisplaySrc
|
||||
#define XStringToKeysym XStringToKeysymSrc
|
||||
#define XQueryKeymap XQueryKeymapSrc
|
||||
#define XKeysymToString XKeysymToStringSrc
|
||||
#define XInitThreads XInitThreadsSrc
|
||||
#define XkbKeycodeToKeysym XkbKeycodeToKeysymSrc
|
||||
#define XkbGetMap XkbGetMapSrc
|
||||
#define XkbGetNames XkbGetNamesSrc
|
||||
#define XkbGetKeyboardByName XkbGetKeyboardByNameSrc
|
||||
#define XkbFreeKeyboard XkbFreeKeyboardSrc
|
||||
#define XGetAtomName XGetAtomNameSrc
|
||||
#define XDefaultRootWindow XDefaultRootWindowSrc
|
||||
#define XMatchVisualInfo XMatchVisualInfoSrc
|
||||
#define XGetKeyboardControl XGetKeyboardControlSrc
|
||||
#define XKeysymToKeycode XKeysymToKeycodeSrc
|
||||
#define XConnectionNumber XConnectionNumberSrc
|
||||
#define XFreeColors XFreeColorsSrc
|
||||
#define XDisplayWidth XDisplayWidthSrc
|
||||
#define XDisplayHeight XDisplayHeightSrc
|
||||
#define XrmGetStringDatabase XrmGetStringDatabaseSrc
|
||||
#define XrmGetResource XrmGetResourceSrc
|
||||
#define XrmDestroyDatabase XrmDestroyDatabaseSrc
|
||||
#define XDisplayName XDisplayNameSrc
|
||||
#define XCreateImage XCreateImageSrc
|
||||
#define XCreatePixmap XCreatePixmapSrc
|
||||
#define XPutImage XPutImageSrc
|
||||
|
||||
#ifndef XDL_NO_XRANDR
|
||||
#define XRRGetScreenResourcesCurrent XRRGetScreenResourcesCurrentSrc
|
||||
#define XRRGetCrtcInfo XRRGetCrtcInfoSrc
|
||||
#define XRRGetOutputInfo XRRGetOutputInfoSrc
|
||||
#define XRRFreeCrtcInfo XRRFreeCrtcInfoSrc
|
||||
#define XRRGetScreenResources XRRGetScreenResourcesSrc
|
||||
#define XRRFreeScreenResources XRRFreeScreenResourcesSrc
|
||||
#define XRRFreeOutputInfo XRRFreeOutputInfoSrc
|
||||
#define XRRSetScreenConfig XRRSetScreenConfigSrc
|
||||
#define XRRSetCrtcConfig XRRSetCrtcConfigSrc
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
#define glXChooseVisual glXChooseVisualSrc
|
||||
#define glXCreateContext glXCreateContextSrc
|
||||
#define glXMakeCurrent glXMakeCurrentSrc
|
||||
#define glXGetCurrentContext glXGetCurrentContextSrc
|
||||
#define glXSwapBuffers glXSwapBuffersSrc
|
||||
#define glXGetProcAddress glXGetProcAddressSrc
|
||||
#define glXGetVisualFromFBConfig glXGetVisualFromFBConfigSrc
|
||||
#define glXGetFBConfigAttrib glXGetFBConfigAttribSrc
|
||||
#define glXGetProcAddressARB glXGetProcAddressARBSrc
|
||||
#define glXChooseFBConfig glXChooseFBConfigSrc
|
||||
#define glXDestroyContext glXDestroyContextSrc
|
||||
#define glXSwapIntervalEXT glXSwapIntervalEXTSrc
|
||||
#endif
|
||||
|
||||
#ifdef XDL_IMPLEMENTATION
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define XDL_PROC_DEF(proc, name) name = (PFN_##name)dlsym(XDL_module[proc], #name)
|
||||
|
||||
|
||||
void* XDL_module[3] = {NULL, NULL, NULL};
|
||||
|
||||
void XDL_init(void) {
|
||||
/* allocating memory for module data */
|
||||
/* loading the modules */
|
||||
#if defined(__CYGWIN__)
|
||||
XDL_module[0] = dlopen("libX11-6.so", RTLD_LAZY | RTLD_LOCAL);
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
XDL_module[0] = dlopen("libX11.so", RTLD_LAZY | RTLD_LOCAL);
|
||||
#else
|
||||
XDL_module[0] = dlopen("libX11.so.6", RTLD_LAZY | RTLD_LOCAL);
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
const char* glxSonames[] = {
|
||||
#if defined(__CYGWIN__)
|
||||
"libGL-1.so",
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
"libGL.so",
|
||||
#else
|
||||
"libGLX.so.0",
|
||||
"libGL.so.1",
|
||||
"libGL.so",
|
||||
#endif
|
||||
};
|
||||
|
||||
for (int i = 0; sizeof(glxSonames) / sizeof(char*); i++) {
|
||||
XDL_module[1] = dlopen(glxSonames[i], RTLD_LAZY | RTLD_LOCAL);
|
||||
if (XDL_module[1])
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
XDL_module[2] = dlopen("libXrandr-2.so", RTLD_LAZY | RTLD_LOCAL);
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
XDL_module[2] = dlopen("libXrandr.so", RTLD_LAZY | RTLD_LOCAL);
|
||||
#else
|
||||
XDL_module[2] = dlopen("libXrandr.so.2", RTLD_LAZY | RTLD_LOCAL);
|
||||
#endif
|
||||
|
||||
/* loading the functions into the source vars */
|
||||
XAllocClassHintSrc = (PFN_XAllocClassHint)dlsym(XDL_module[0], "XAllocClassHint");
|
||||
XAllocSizeHintsSrc = (PFN_XAllocSizeHints)dlsym(XDL_module[0], "XAllocSizeHints");
|
||||
XAllocWMHintsSrc = (PFN_XAllocWMHints)dlsym(XDL_module[0], "XAllocWMHints");
|
||||
XChangePropertySrc = (PFN_XChangeProperty)dlsym(XDL_module[0], "XChangeProperty");
|
||||
XChangeWindowAttributesSrc = (PFN_XChangeWindowAttributes)dlsym(XDL_module[0], "XChangeWindowAttributes");
|
||||
XCheckIfEventSrc = (PFN_XCheckIfEvent)dlsym(XDL_module[0], "XCheckIfEvent");
|
||||
XCheckTypedWindowEventSrc = (PFN_XCheckTypedWindowEvent)dlsym(XDL_module[0], "XCheckTypedWindowEvent");
|
||||
XCloseDisplaySrc = (PFN_XCloseDisplay)dlsym(XDL_module[0], "XCloseDisplay");
|
||||
XCloseIMSrc = (PFN_XCloseIM)dlsym(XDL_module[0], "XCloseIM");
|
||||
XConvertSelectionSrc = (PFN_XConvertSelection)dlsym(XDL_module[0], "XConvertSelection");
|
||||
XCreateColormapSrc = (PFN_XCreateColormap)dlsym(XDL_module[0], "XCreateColormap");
|
||||
XCreateFontCursorSrc = (PFN_XCreateFontCursor)dlsym(XDL_module[0], "XCreateFontCursor");
|
||||
XCreateICSrc = (PFN_XCreateIC)dlsym(XDL_module[0], "XCreateIC");
|
||||
XCreateRegionSrc = (PFN_XCreateRegion)dlsym(XDL_module[0], "XCreateRegion");
|
||||
XCreateWindowSrc = (PFN_XCreateWindow)dlsym(XDL_module[0], "XCreateWindow");
|
||||
XDefineCursorSrc = (PFN_XDefineCursor)dlsym(XDL_module[0], "XDefineCursor");
|
||||
XDeleteContextSrc = (PFN_XDeleteContext)dlsym(XDL_module[0], "XDeleteContext");
|
||||
XDeletePropertySrc = (PFN_XDeleteProperty)dlsym(XDL_module[0], "XDeleteProperty");
|
||||
XDestroyICSrc = (PFN_XDestroyIC)dlsym(XDL_module[0], "XDestroyIC");
|
||||
XDestroyRegionSrc = (PFN_XDestroyRegion)dlsym(XDL_module[0], "XDestroyRegion");
|
||||
XDestroyWindowSrc = (PFN_XDestroyWindow)dlsym(XDL_module[0], "XDestroyWindow");
|
||||
XDisplayKeycodesSrc = (PFN_XDisplayKeycodes)dlsym(XDL_module[0], "XDisplayKeycodes");
|
||||
XEventsQueuedSrc = (PFN_XEventsQueued)dlsym(XDL_module[0], "XEventsQueued");
|
||||
XFilterEventSrc = (PFN_XFilterEvent)dlsym(XDL_module[0], "XFilterEvent");
|
||||
XFindContextSrc = (PFN_XFindContext)dlsym(XDL_module[0], "XFindContext");
|
||||
XFlushSrc = (PFN_XFlush)dlsym(XDL_module[0], "XFlush");
|
||||
XFreeSrc = (PFN_XFree)dlsym(XDL_module[0], "XFree");
|
||||
XFreeColormapSrc = (PFN_XFreeColormap)dlsym(XDL_module[0], "XFreeColormap");
|
||||
XFreeCursorSrc = (PFN_XFreeCursor)dlsym(XDL_module[0], "XFreeCursor");
|
||||
XFreeEventDataSrc = (PFN_XFreeEventData)dlsym(XDL_module[0], "XFreeEventData");
|
||||
XGetErrorTextSrc = (PFN_XGetErrorText)dlsym(XDL_module[0], "XGetErrorText");
|
||||
XGetEventDataSrc = (PFN_XGetEventData)dlsym(XDL_module[0], "XGetEventData");
|
||||
XGetICValuesSrc = (PFN_XGetICValues)dlsym(XDL_module[0], "XGetICValues");
|
||||
XGetIMValuesSrc = (PFN_XGetIMValues)dlsym(XDL_module[0], "XGetIMValues");
|
||||
XGetInputFocusSrc = (PFN_XGetInputFocus)dlsym(XDL_module[0], "XGetInputFocus");
|
||||
XGetKeyboardMappingSrc = (PFN_XGetKeyboardMapping)dlsym(XDL_module[0], "XGetKeyboardMapping");
|
||||
XGetScreenSaverSrc = (PFN_XGetScreenSaver)dlsym(XDL_module[0], "XGetScreenSaver");
|
||||
XGetSelectionOwnerSrc = (PFN_XGetSelectionOwner)dlsym(XDL_module[0], "XGetSelectionOwner");
|
||||
XGetVisualInfoSrc = (PFN_XGetVisualInfo)dlsym(XDL_module[0], "XGetVisualInfo");
|
||||
XGetWMNormalHintsSrc = (PFN_XGetWMNormalHints)dlsym(XDL_module[0], "XGetWMNormalHints");
|
||||
XGetWindowAttributesSrc = (PFN_XGetWindowAttributes)dlsym(XDL_module[0], "XGetWindowAttributes");
|
||||
XGetWindowPropertySrc = (PFN_XGetWindowProperty)dlsym(XDL_module[0], "XGetWindowProperty");
|
||||
XGrabPointerSrc = (PFN_XGrabPointer)dlsym(XDL_module[0], "XGrabPointer");
|
||||
XIconifyWindowSrc = (PFN_XIconifyWindow)dlsym(XDL_module[0], "XIconifyWindow");
|
||||
XInternAtomSrc = (PFN_XInternAtom)dlsym(XDL_module[0], "XInternAtom");
|
||||
XLookupStringSrc = (PFN_XLookupString)dlsym(XDL_module[0], "XLookupString");
|
||||
XMapRaisedSrc = (PFN_XMapRaised)dlsym(XDL_module[0], "XMapRaised");
|
||||
XMapWindowSrc = (PFN_XMapWindow)dlsym(XDL_module[0], "XMapWindow");
|
||||
XMoveResizeWindowSrc = (PFN_XMoveResizeWindow)dlsym(XDL_module[0], "XMoveResizeWindow");
|
||||
XMoveWindowSrc = (PFN_XMoveWindow)dlsym(XDL_module[0], "XMoveWindow");
|
||||
XNextEventSrc = (PFN_XNextEvent)dlsym(XDL_module[0], "XNextEvent");
|
||||
XPeekEventSrc = (PFN_XPeekEvent)dlsym(XDL_module[0], "XPeekEvent");
|
||||
XPendingSrc = (PFN_XPending)dlsym(XDL_module[0], "XPending");
|
||||
XQueryExtensionSrc = (PFN_XQueryExtension)dlsym(XDL_module[0], "XQueryExtension");
|
||||
XQueryPointerSrc = (PFN_XQueryPointer)dlsym(XDL_module[0], "XQueryPointer");
|
||||
XRaiseWindowSrc = (PFN_XRaiseWindow)dlsym(XDL_module[0], "XRaiseWindow");
|
||||
XRegisterIMInstantiateCallbackSrc = (PFN_XRegisterIMInstantiateCallback)dlsym(XDL_module[0], "XRegisterIMInstantiateCallback");
|
||||
XResizeWindowSrc = (PFN_XResizeWindow)dlsym(XDL_module[0], "XResizeWindow");
|
||||
XResourceManagerStringSrc = (PFN_XResourceManagerString)dlsym(XDL_module[0], "XResourceManagerString");
|
||||
XSaveContextSrc = (PFN_XSaveContext)dlsym(XDL_module[0], "XSaveContext");
|
||||
XSelectInputSrc = (PFN_XSelectInput)dlsym(XDL_module[0], "XSelectInput");
|
||||
XSendEventSrc = (PFN_XSendEvent)dlsym(XDL_module[0], "XSendEvent");
|
||||
XSetClassHintSrc = (PFN_XSetClassHint)dlsym(XDL_module[0], "XSetClassHint");
|
||||
XSetErrorHandlerSrc = (PFN_XSetErrorHandler)dlsym(XDL_module[0], "XSetErrorHandler");
|
||||
XSetICFocusSrc = (PFN_XSetICFocus)dlsym(XDL_module[0], "XSetICFocus");
|
||||
XSetIMValuesSrc = (PFN_XSetIMValues)dlsym(XDL_module[0], "XSetIMValues");
|
||||
XSetInputFocusSrc = (PFN_XSetInputFocus)dlsym(XDL_module[0], "XSetInputFocus");
|
||||
XSetLocaleModifiersSrc = (PFN_XSetLocaleModifiers)dlsym(XDL_module[0], "XSetLocaleModifiers");
|
||||
XSetScreenSaverSrc = (PFN_XSetScreenSaver)dlsym(XDL_module[0], "XSetScreenSaver");
|
||||
XSetSelectionOwnerSrc = (PFN_XSetSelectionOwner)dlsym(XDL_module[0], "XSetSelectionOwner");
|
||||
XSetWMHintsSrc = (PFN_XSetWMHints)dlsym(XDL_module[0], "XSetWMHints");
|
||||
XSetWMNormalHintsSrc = (PFN_XSetWMNormalHints)dlsym(XDL_module[0], "XSetWMNormalHints");
|
||||
XSetWMProtocolsSrc = (PFN_XSetWMProtocols)dlsym(XDL_module[0], "XSetWMProtocols");
|
||||
XSupportsLocaleSrc = (PFN_XSupportsLocale)dlsym(XDL_module[0], "XSupportsLocale");
|
||||
XSyncSrc = (PFN_XSync)dlsym(XDL_module[0], "XSync");
|
||||
XTranslateCoordinatesSrc = (PFN_XTranslateCoordinates)dlsym(XDL_module[0], "XTranslateCoordinates");
|
||||
XUndefineCursorSrc = (PFN_XUndefineCursor)dlsym(XDL_module[0], "XUndefineCursor");
|
||||
XUngrabPointerSrc = (PFN_XUngrabPointer)dlsym(XDL_module[0], "XUngrabPointer");
|
||||
XUnmapWindowSrc = (PFN_XUnmapWindow)dlsym(XDL_module[0], "XUnmapWindow");
|
||||
XUnsetICFocusSrc = (PFN_XUnsetICFocus)dlsym(XDL_module[0], "XUnsetICFocus");
|
||||
XVisualIDFromVisualSrc = (PFN_XVisualIDFromVisual)dlsym(XDL_module[0], "XVisualIDFromVisual");
|
||||
XWarpPointerSrc = (PFN_XWarpPointer)dlsym(XDL_module[0], "XWarpPointer");
|
||||
XStoreNameSrc = (PFN_XStoreName)dlsym(XDL_module[0], "XStoreName");
|
||||
XSetWMSizeHintsSrc = (PFN_XSetWMSizeHints)dlsym(XDL_module[0], "XSetWMSizeHints");
|
||||
XOpenDisplaySrc = (PFN_XOpenDisplay)dlsym(XDL_module[0], "XOpenDisplay");
|
||||
XStringToKeysymSrc = (PFN_XStringToKeysym)dlsym(XDL_module[0], "XStringToKeysym");
|
||||
XQueryKeymapSrc = (PFN_XQueryKeymap)dlsym(XDL_module[0], "XQueryKeymap");
|
||||
XDL_PROC_DEF(0, XKeysymToString);
|
||||
XDL_PROC_DEF(0, XInitThreads);
|
||||
XDL_PROC_DEF(0, XkbKeycodeToKeysym);
|
||||
XDL_PROC_DEF(0, XkbGetMap);
|
||||
XDL_PROC_DEF(0, XkbGetNames);
|
||||
XDL_PROC_DEF(0, XkbGetKeyboardByName);
|
||||
XDL_PROC_DEF(0, XkbFreeKeyboard);
|
||||
XDL_PROC_DEF(0, XGetAtomName);
|
||||
XDL_PROC_DEF(0, XDefaultRootWindow);
|
||||
XDL_PROC_DEF(0, XMatchVisualInfo);
|
||||
XDL_PROC_DEF(0, XGetKeyboardControl);
|
||||
XDL_PROC_DEF(0, XKeysymToKeycode);
|
||||
XDL_PROC_DEF(0, XConnectionNumber);
|
||||
XDL_PROC_DEF(0, XFreeColors);
|
||||
XDL_PROC_DEF(0, XDisplayWidth);
|
||||
XDL_PROC_DEF(0, XDisplayHeight);
|
||||
XDL_PROC_DEF(0, XrmGetStringDatabase);
|
||||
XDL_PROC_DEF(0, XrmGetResource);
|
||||
XDL_PROC_DEF(0, XrmDestroyDatabase);
|
||||
XDL_PROC_DEF(0, XDisplayName);
|
||||
XDL_PROC_DEF(0, XkbGetState);
|
||||
XDL_PROC_DEF(0, XWidthOfScreen);
|
||||
XDL_PROC_DEF(0, XHeightOfScreen);
|
||||
XDL_PROC_DEF(0, XCreateGC);
|
||||
XDL_PROC_DEF(0, XFreeGC);
|
||||
XDL_PROC_DEF(0, XCreateImage);
|
||||
XDL_PROC_DEF(0, XCreatePixmap);
|
||||
XDL_PROC_DEF(0, XPutImage);
|
||||
|
||||
#ifndef XDL_NO_XRANDR
|
||||
XDL_PROC_DEF(2, XRRGetScreenResourcesCurrent);
|
||||
XDL_PROC_DEF(2, XRRGetCrtcInfo);
|
||||
XDL_PROC_DEF(2, XRRGetOutputInfo);
|
||||
XDL_PROC_DEF(2, XRRFreeCrtcInfo);
|
||||
XDL_PROC_DEF(2, XRRGetScreenResources);
|
||||
XDL_PROC_DEF(2, XRRFreeScreenResources);
|
||||
XDL_PROC_DEF(2, XRRFreeOutputInfo);
|
||||
XDL_PROC_DEF(2, XRRSetScreenConfig);
|
||||
XDL_PROC_DEF(2, XRRSetCrtcConfig);
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
XDL_PROC_DEF(1, glXChooseVisual);
|
||||
XDL_PROC_DEF(1, glXCreateContext);
|
||||
XDL_PROC_DEF(1, glXMakeCurrent);
|
||||
XDL_PROC_DEF(1, glXGetCurrentContext);
|
||||
XDL_PROC_DEF(1, glXSwapBuffers);
|
||||
XDL_PROC_DEF(1, glXSwapIntervalEXT);
|
||||
XDL_PROC_DEF(1, glXGetProcAddress);
|
||||
XDL_PROC_DEF(1, glXGetVisualFromFBConfig);
|
||||
XDL_PROC_DEF(1, glXGetFBConfigAttrib);
|
||||
XDL_PROC_DEF(1, glXGetProcAddressARB);
|
||||
XDL_PROC_DEF(1, glXChooseFBConfig);
|
||||
XDL_PROC_DEF(1, glXDestroyContext);
|
||||
#endif
|
||||
}
|
||||
|
||||
void XDL_close(void) {
|
||||
if (XDL_module[0] != NULL) {
|
||||
/* close the modules and free their data */
|
||||
dlclose(XDL_module[0]);
|
||||
XDL_module[0] = NULL;
|
||||
|
||||
#ifndef XDL_NO_GLX
|
||||
dlclose(XDL_module[1]);
|
||||
#endif
|
||||
|
||||
#ifndef XDL_NO_XRANDR
|
||||
dlclose(XDL_module[2]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
1077
include/adivtab.h
Normal file
1077
include/adivtab.h
Normal file
File diff suppressed because it is too large
Load diff
37
include/anorm_dots.h
Normal file
37
include/anorm_dots.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
{
|
||||
{1.23,1.30,1.47,1.35,1.56,1.71,1.37,1.38,1.59,1.60,1.79,1.97,1.88,1.92,1.79,1.02,0.93,1.07,0.82,0.87,0.88,0.94,0.96,1.14,1.11,0.82,0.83,0.89,0.89,0.86,0.94,0.91,1.00,1.21,0.98,1.48,1.30,1.57,0.96,1.07,1.14,1.60,1.61,1.40,1.37,1.72,1.78,1.79,1.93,1.99,1.90,1.68,1.71,1.86,1.60,1.68,1.78,1.86,1.93,1.99,1.97,1.44,1.22,1.49,0.93,0.99,0.99,1.23,1.22,1.44,1.49,0.89,0.89,0.97,0.91,0.98,1.19,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.19,0.98,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.87,0.93,0.94,1.02,1.30,1.07,1.35,1.38,1.11,1.56,1.92,1.79,1.79,1.59,1.60,1.72,1.90,1.79,0.80,0.85,0.79,0.93,0.80,0.85,0.77,0.74,0.72,0.77,0.74,0.72,0.70,0.70,0.71,0.76,0.73,0.79,0.79,0.73,0.76,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.26,1.48,1.23,1.50,1.71,1.14,1.19,1.38,1.46,1.64,1.94,1.87,1.84,1.71,1.02,0.92,1.00,0.79,0.85,0.84,0.91,0.90,0.98,0.99,0.77,0.77,0.83,0.82,0.79,0.86,0.84,0.92,0.99,0.91,1.24,1.03,1.33,0.88,0.94,0.97,1.41,1.39,1.18,1.11,1.51,1.61,1.59,1.80,1.91,1.76,1.54,1.65,1.76,1.70,1.70,1.85,1.85,1.97,1.99,1.93,1.28,1.09,1.39,0.92,0.97,0.99,1.18,1.26,1.52,1.48,0.83,0.85,0.90,0.88,0.93,1.00,0.77,0.73,0.78,0.72,0.71,0.74,0.75,0.79,0.86,0.81,0.75,0.81,0.79,0.96,0.88,0.94,0.86,0.93,0.92,0.85,1.08,1.33,1.05,1.55,1.31,1.01,1.05,1.27,1.31,1.60,1.47,1.70,1.54,1.76,1.76,1.57,0.93,0.90,0.99,0.88,0.88,0.95,0.97,1.11,1.39,1.20,0.92,0.97,1.01,1.10,1.39,1.22,1.51,1.58,1.32,1.64,1.97,1.85,1.91,1.77,1.74,1.88,1.99,1.91,0.79,0.86,0.80,0.94,0.84,0.88,0.74,0.74,0.71,0.82,0.77,0.76,0.70,0.73,0.72,0.73,0.70,0.74,0.85,0.77,0.82,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.27,1.53,1.17,1.46,1.71,0.98,1.05,1.20,1.34,1.48,1.86,1.82,1.71,1.62,1.09,0.94,0.99,0.79,0.85,0.82,0.90,0.87,0.93,0.96,0.76,0.74,0.79,0.76,0.74,0.79,0.78,0.85,0.92,0.85,1.00,0.93,1.06,0.81,0.86,0.89,1.16,1.12,0.97,0.95,1.28,1.38,1.35,1.60,1.77,1.57,1.33,1.50,1.58,1.69,1.63,1.82,1.74,1.91,1.92,1.80,1.04,0.97,1.21,0.90,0.93,0.97,1.05,1.21,1.48,1.37,0.77,0.80,0.84,0.85,0.88,0.92,0.73,0.71,0.74,0.74,0.71,0.75,0.73,0.79,0.84,0.78,0.79,0.86,0.81,1.05,0.94,0.99,0.90,0.95,0.92,0.86,1.24,1.44,1.14,1.59,1.34,1.02,1.27,1.50,1.49,1.80,1.69,1.86,1.72,1.87,1.80,1.69,1.00,0.98,1.23,0.95,0.96,1.09,1.16,1.37,1.63,1.46,0.99,1.10,1.25,1.24,1.51,1.41,1.67,1.77,1.55,1.72,1.95,1.89,1.98,1.91,1.86,1.97,1.99,1.94,0.81,0.89,0.85,0.98,0.90,0.94,0.75,0.78,0.73,0.89,0.83,0.82,0.72,0.77,0.76,0.72,0.70,0.71,0.91,0.83,0.89,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.34,1.60,1.16,1.46,1.71,0.94,0.99,1.05,1.26,1.33,1.74,1.76,1.57,1.54,1.23,0.98,1.05,0.83,0.89,0.84,0.92,0.87,0.91,0.96,0.78,0.74,0.79,0.72,0.72,0.75,0.76,0.80,0.88,0.83,0.94,0.87,0.95,0.76,0.80,0.82,0.97,0.96,0.89,0.88,1.08,1.11,1.10,1.37,1.59,1.37,1.07,1.27,1.34,1.57,1.45,1.69,1.55,1.77,1.79,1.60,0.93,0.90,0.99,0.86,0.87,0.93,0.96,1.07,1.35,1.18,0.73,0.76,0.77,0.81,0.82,0.85,0.70,0.71,0.72,0.78,0.73,0.77,0.73,0.79,0.82,0.76,0.83,0.90,0.84,1.18,0.98,1.03,0.92,0.95,0.90,0.86,1.32,1.45,1.15,1.53,1.27,0.99,1.42,1.65,1.58,1.93,1.83,1.94,1.81,1.88,1.74,1.70,1.19,1.17,1.44,1.11,1.15,1.36,1.41,1.61,1.81,1.67,1.22,1.34,1.50,1.42,1.65,1.61,1.82,1.91,1.75,1.80,1.89,1.89,1.98,1.99,1.94,1.98,1.92,1.87,0.86,0.95,0.92,1.14,0.98,1.03,0.79,0.84,0.77,0.97,0.90,0.89,0.76,0.82,0.82,0.74,0.72,0.71,0.98,0.89,0.97,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.44,1.68,1.22,1.49,1.71,0.93,0.99,0.99,1.23,1.22,1.60,1.68,1.44,1.49,1.40,1.14,1.19,0.89,0.96,0.89,0.97,0.89,0.91,0.98,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.91,0.83,0.89,0.72,0.76,0.76,0.89,0.89,0.82,0.82,0.98,0.96,0.97,1.14,1.40,1.19,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.70,0.72,0.73,0.77,0.76,0.79,0.70,0.72,0.71,0.82,0.77,0.80,0.74,0.79,0.80,0.74,0.87,0.93,0.85,1.23,1.02,1.02,0.93,0.93,0.87,0.85,1.30,1.35,1.07,1.38,1.11,0.94,1.47,1.71,1.56,1.97,1.88,1.92,1.79,1.79,1.59,1.60,1.30,1.35,1.56,1.37,1.38,1.59,1.60,1.79,1.92,1.79,1.48,1.57,1.72,1.61,1.78,1.79,1.93,1.99,1.90,1.86,1.78,1.86,1.93,1.99,1.97,1.90,1.79,1.72,0.94,1.07,1.00,1.37,1.21,1.30,0.86,0.91,0.83,1.14,0.98,0.96,0.82,0.88,0.89,0.79,0.76,0.73,1.07,0.94,1.11,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.57,1.76,1.33,1.54,1.71,0.94,1.05,0.99,1.26,1.16,1.46,1.60,1.34,1.46,1.59,1.37,1.37,0.97,1.11,0.96,1.10,0.95,0.94,1.08,0.89,0.82,0.88,0.72,0.76,0.75,0.80,0.80,0.88,0.87,0.91,0.83,0.87,0.72,0.76,0.74,0.83,0.84,0.78,0.79,0.96,0.89,0.92,0.98,1.23,1.05,0.86,0.92,0.95,1.11,0.98,1.22,1.03,1.34,1.42,1.14,0.79,0.77,0.84,0.78,0.76,0.82,0.82,0.89,0.97,0.90,0.70,0.71,0.71,0.73,0.72,0.74,0.73,0.76,0.72,0.86,0.81,0.82,0.76,0.79,0.77,0.73,0.90,0.95,0.86,1.18,1.03,0.98,0.92,0.90,0.83,0.84,1.19,1.17,0.98,1.15,0.97,0.89,1.42,1.65,1.44,1.93,1.83,1.81,1.67,1.61,1.36,1.41,1.32,1.45,1.58,1.57,1.53,1.74,1.70,1.88,1.94,1.81,1.69,1.77,1.87,1.79,1.89,1.92,1.98,1.99,1.98,1.89,1.65,1.80,1.82,1.91,1.94,1.75,1.61,1.50,1.07,1.34,1.27,1.60,1.45,1.55,0.93,0.99,0.90,1.35,1.18,1.07,0.87,0.93,0.96,0.85,0.82,0.77,1.15,0.99,1.27,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.71,1.82,1.48,1.62,1.71,0.98,1.20,1.05,1.34,1.17,1.34,1.53,1.27,1.46,1.77,1.60,1.57,1.16,1.38,1.12,1.35,1.06,1.00,1.28,0.97,0.89,0.95,0.76,0.81,0.79,0.86,0.85,0.92,0.93,0.93,0.85,0.87,0.74,0.78,0.74,0.79,0.82,0.76,0.79,0.96,0.85,0.90,0.94,1.09,0.99,0.81,0.85,0.89,0.95,0.90,0.99,0.94,1.10,1.24,0.98,0.75,0.73,0.78,0.74,0.72,0.77,0.76,0.82,0.89,0.83,0.73,0.71,0.71,0.71,0.70,0.72,0.77,0.80,0.74,0.90,0.85,0.84,0.78,0.79,0.75,0.73,0.92,0.95,0.86,1.05,0.99,0.94,0.90,0.86,0.79,0.81,1.00,0.98,0.91,0.96,0.89,0.83,1.27,1.50,1.23,1.80,1.69,1.63,1.46,1.37,1.09,1.16,1.24,1.44,1.49,1.69,1.59,1.80,1.69,1.87,1.86,1.72,1.82,1.91,1.94,1.92,1.95,1.99,1.98,1.91,1.97,1.89,1.51,1.72,1.67,1.77,1.86,1.55,1.41,1.25,1.33,1.58,1.50,1.80,1.63,1.74,1.04,1.21,0.97,1.48,1.37,1.21,0.93,0.97,1.05,0.92,0.88,0.84,1.14,1.02,1.34,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.84,1.87,1.64,1.71,1.71,1.14,1.38,1.19,1.46,1.23,1.26,1.48,1.26,1.50,1.91,1.80,1.76,1.41,1.61,1.39,1.59,1.33,1.24,1.51,1.18,0.97,1.11,0.82,0.88,0.86,0.94,0.92,0.99,1.03,0.98,0.91,0.90,0.79,0.84,0.77,0.79,0.84,0.77,0.83,0.99,0.85,0.91,0.92,1.02,1.00,0.79,0.80,0.86,0.88,0.84,0.92,0.88,0.97,1.10,0.94,0.74,0.71,0.74,0.72,0.70,0.73,0.72,0.76,0.82,0.77,0.77,0.73,0.74,0.71,0.70,0.73,0.83,0.85,0.78,0.92,0.88,0.86,0.81,0.79,0.74,0.75,0.92,0.93,0.85,0.96,0.94,0.88,0.86,0.81,0.75,0.79,0.93,0.90,0.85,0.88,0.82,0.77,1.05,1.27,0.99,1.60,1.47,1.39,1.20,1.11,0.95,0.97,1.08,1.33,1.31,1.70,1.55,1.76,1.57,1.76,1.70,1.54,1.85,1.97,1.91,1.99,1.97,1.99,1.91,1.77,1.88,1.85,1.39,1.64,1.51,1.58,1.74,1.32,1.22,1.01,1.54,1.76,1.65,1.93,1.70,1.85,1.28,1.39,1.09,1.52,1.48,1.26,0.97,0.99,1.18,1.00,0.93,0.90,1.05,1.01,1.31,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.97,1.92,1.88,1.79,1.79,1.71,1.37,1.59,1.38,1.60,1.35,1.23,1.47,1.30,1.56,1.99,1.93,1.90,1.60,1.78,1.61,1.79,1.57,1.48,1.72,1.40,1.14,1.37,0.89,0.96,0.94,1.07,1.00,1.21,1.30,1.14,0.98,0.96,0.86,0.91,0.83,0.82,0.88,0.82,0.89,1.11,0.87,0.94,0.93,1.02,1.07,0.80,0.79,0.85,0.82,0.80,0.87,0.85,0.93,1.02,0.93,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.82,0.76,0.79,0.72,0.73,0.76,0.89,0.89,0.82,0.93,0.91,0.86,0.83,0.79,0.73,0.76,0.91,0.89,0.83,0.89,0.89,0.82,0.82,0.76,0.72,0.76,0.86,0.83,0.79,0.82,0.76,0.73,0.94,1.00,0.91,1.37,1.21,1.14,0.98,0.96,0.88,0.89,0.96,1.14,1.07,1.60,1.40,1.61,1.37,1.57,1.48,1.30,1.78,1.93,1.79,1.99,1.92,1.90,1.79,1.59,1.72,1.79,1.30,1.56,1.35,1.38,1.60,1.11,1.07,0.94,1.68,1.86,1.71,1.97,1.68,1.86,1.44,1.49,1.22,1.44,1.49,1.22,0.99,0.99,1.23,1.19,0.98,0.97,0.97,0.98,1.19,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.97,1.87,1.91,1.85,1.71,1.60,1.77,1.58,1.74,1.51,1.26,1.48,1.39,1.64,1.99,1.97,1.99,1.70,1.85,1.76,1.91,1.76,1.70,1.88,1.55,1.33,1.57,0.96,1.08,1.05,1.31,1.27,1.47,1.54,1.39,1.20,1.11,0.93,0.99,0.90,0.88,0.95,0.88,0.97,1.32,0.92,1.01,0.97,1.10,1.22,0.84,0.80,0.88,0.79,0.79,0.85,0.86,0.92,1.02,0.94,0.82,0.76,0.77,0.72,0.73,0.70,0.72,0.71,0.74,0.74,0.88,0.81,0.85,0.75,0.77,0.82,0.94,0.93,0.86,0.92,0.92,0.86,0.85,0.79,0.74,0.79,0.88,0.85,0.81,0.82,0.83,0.77,0.78,0.73,0.71,0.75,0.79,0.77,0.74,0.77,0.73,0.70,0.86,0.92,0.84,1.14,0.99,0.98,0.91,0.90,0.84,0.83,0.88,0.97,0.94,1.41,1.18,1.39,1.11,1.33,1.24,1.03,1.61,1.80,1.59,1.91,1.84,1.76,1.64,1.38,1.51,1.71,1.26,1.50,1.23,1.19,1.46,0.99,1.00,0.91,1.70,1.85,1.65,1.93,1.54,1.76,1.52,1.48,1.26,1.28,1.39,1.09,0.99,0.97,1.18,1.31,1.01,1.05,0.90,0.93,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.95,1.82,1.98,1.89,1.71,1.80,1.91,1.77,1.86,1.67,1.34,1.53,1.51,1.72,1.92,1.91,1.99,1.69,1.82,1.80,1.94,1.87,1.86,1.97,1.59,1.44,1.69,1.05,1.24,1.27,1.49,1.50,1.69,1.72,1.63,1.46,1.37,1.00,1.23,0.98,0.95,1.09,0.96,1.16,1.55,0.99,1.25,1.10,1.24,1.41,0.90,0.85,0.94,0.79,0.81,0.85,0.89,0.94,1.09,0.98,0.89,0.82,0.83,0.74,0.77,0.72,0.76,0.73,0.75,0.78,0.94,0.86,0.91,0.79,0.83,0.89,0.99,0.95,0.90,0.90,0.92,0.84,0.86,0.79,0.75,0.81,0.85,0.80,0.78,0.76,0.77,0.73,0.74,0.71,0.71,0.73,0.74,0.74,0.71,0.76,0.72,0.70,0.79,0.85,0.78,0.98,0.92,0.93,0.85,0.87,0.82,0.79,0.81,0.89,0.86,1.16,0.97,1.12,0.95,1.06,1.00,0.93,1.38,1.60,1.35,1.77,1.71,1.57,1.48,1.20,1.28,1.62,1.27,1.46,1.17,1.05,1.34,0.96,0.99,0.90,1.63,1.74,1.50,1.80,1.33,1.58,1.48,1.37,1.21,1.04,1.21,0.97,0.97,0.93,1.05,1.34,1.02,1.14,0.84,0.88,0.92,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.89,1.76,1.98,1.89,1.71,1.93,1.99,1.91,1.94,1.82,1.46,1.60,1.65,1.80,1.79,1.77,1.92,1.57,1.69,1.74,1.87,1.88,1.94,1.98,1.53,1.45,1.70,1.18,1.32,1.42,1.58,1.65,1.83,1.81,1.81,1.67,1.61,1.19,1.44,1.17,1.11,1.36,1.15,1.41,1.75,1.22,1.50,1.34,1.42,1.61,0.98,0.92,1.03,0.83,0.86,0.89,0.95,0.98,1.23,1.14,0.97,0.89,0.90,0.78,0.82,0.76,0.82,0.77,0.79,0.84,0.98,0.90,0.98,0.83,0.89,0.97,1.03,0.95,0.92,0.86,0.90,0.82,0.86,0.79,0.77,0.84,0.81,0.76,0.76,0.72,0.73,0.70,0.72,0.71,0.73,0.73,0.72,0.74,0.71,0.78,0.74,0.72,0.75,0.80,0.76,0.94,0.88,0.91,0.83,0.87,0.84,0.79,0.76,0.82,0.80,0.97,0.89,0.96,0.88,0.95,0.94,0.87,1.11,1.37,1.10,1.59,1.57,1.37,1.33,1.05,1.08,1.54,1.34,1.46,1.16,0.99,1.26,0.96,1.05,0.92,1.45,1.55,1.27,1.60,1.07,1.34,1.35,1.18,1.07,0.93,0.99,0.90,0.93,0.87,0.96,1.27,0.99,1.15,0.77,0.82,0.85,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.78,1.68,1.93,1.86,1.71,1.97,1.99,1.99,1.97,1.93,1.60,1.68,1.78,1.86,1.61,1.57,1.79,1.37,1.48,1.59,1.72,1.79,1.92,1.90,1.38,1.35,1.60,1.23,1.30,1.47,1.56,1.71,1.88,1.79,1.92,1.79,1.79,1.30,1.56,1.35,1.37,1.59,1.38,1.60,1.90,1.48,1.72,1.57,1.61,1.79,1.21,1.00,1.30,0.89,0.94,0.96,1.07,1.14,1.40,1.37,1.14,0.96,0.98,0.82,0.88,0.82,0.89,0.83,0.86,0.91,1.02,0.93,1.07,0.87,0.94,1.11,1.02,0.93,0.93,0.82,0.87,0.80,0.85,0.79,0.80,0.85,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.72,0.76,0.73,0.82,0.79,0.76,0.73,0.79,0.76,0.93,0.86,0.91,0.83,0.89,0.89,0.82,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.44,1.19,1.22,0.99,0.98,1.49,1.44,1.49,1.22,0.99,1.23,0.98,1.19,0.97,1.21,1.30,1.00,1.37,0.94,1.07,1.14,0.98,0.96,0.86,0.91,0.83,0.88,0.82,0.89,1.11,0.94,1.07,0.73,0.76,0.79,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.65,1.60,1.82,1.80,1.71,1.93,1.91,1.99,1.94,1.98,1.74,1.76,1.89,1.89,1.42,1.34,1.61,1.11,1.22,1.36,1.50,1.61,1.81,1.75,1.15,1.17,1.41,1.18,1.19,1.42,1.44,1.65,1.83,1.67,1.94,1.81,1.88,1.32,1.58,1.45,1.57,1.74,1.53,1.70,1.98,1.69,1.87,1.77,1.79,1.92,1.45,1.27,1.55,0.97,1.07,1.11,1.34,1.37,1.59,1.60,1.35,1.07,1.18,0.86,0.93,0.87,0.96,0.90,0.93,0.99,1.03,0.95,1.15,0.90,0.99,1.27,0.98,0.90,0.92,0.78,0.83,0.77,0.84,0.79,0.82,0.86,0.73,0.71,0.73,0.72,0.70,0.73,0.72,0.76,0.81,0.76,0.76,0.82,0.77,0.89,0.85,0.82,0.75,0.80,0.80,0.94,0.88,0.94,0.87,0.95,0.96,0.88,0.72,0.74,0.76,0.83,0.78,0.84,0.79,0.87,0.91,0.83,0.89,0.98,0.92,1.23,1.34,1.05,1.16,0.99,0.96,1.46,1.57,1.54,1.33,1.05,1.26,1.08,1.37,1.10,0.98,1.03,0.92,1.14,0.86,0.95,0.97,0.90,0.89,0.79,0.84,0.77,0.82,0.76,0.82,0.97,0.89,0.98,0.71,0.72,0.74,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.51,1.53,1.67,1.72,1.71,1.80,1.77,1.91,1.86,1.98,1.86,1.82,1.95,1.89,1.24,1.10,1.41,0.95,0.99,1.09,1.25,1.37,1.63,1.55,0.96,0.98,1.16,1.05,1.00,1.27,1.23,1.50,1.69,1.46,1.86,1.72,1.87,1.24,1.49,1.44,1.69,1.80,1.59,1.69,1.97,1.82,1.94,1.91,1.92,1.99,1.63,1.50,1.74,1.16,1.33,1.38,1.58,1.60,1.77,1.80,1.48,1.21,1.37,0.90,0.97,0.93,1.05,0.97,1.04,1.21,0.99,0.95,1.14,0.92,1.02,1.34,0.94,0.86,0.90,0.74,0.79,0.75,0.81,0.79,0.84,0.86,0.71,0.71,0.73,0.76,0.73,0.77,0.74,0.80,0.85,0.78,0.81,0.89,0.84,0.97,0.92,0.88,0.79,0.85,0.86,0.98,0.92,1.00,0.93,1.06,1.12,0.95,0.74,0.74,0.78,0.79,0.76,0.82,0.79,0.87,0.93,0.85,0.85,0.94,0.90,1.09,1.27,0.99,1.17,1.05,0.96,1.46,1.71,1.62,1.48,1.20,1.34,1.28,1.57,1.35,0.90,0.94,0.85,0.98,0.81,0.89,0.89,0.83,0.82,0.75,0.78,0.73,0.77,0.72,0.76,0.89,0.83,0.91,0.71,0.70,0.72,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.39,1.48,1.51,1.64,1.71,1.60,1.58,1.77,1.74,1.91,1.94,1.87,1.97,1.85,1.10,0.97,1.22,0.88,0.92,0.95,1.01,1.11,1.39,1.32,0.88,0.90,0.97,0.96,0.93,1.05,0.99,1.27,1.47,1.20,1.70,1.54,1.76,1.08,1.31,1.33,1.70,1.76,1.55,1.57,1.88,1.85,1.91,1.97,1.99,1.99,1.70,1.65,1.85,1.41,1.54,1.61,1.76,1.80,1.91,1.93,1.52,1.26,1.48,0.92,0.99,0.97,1.18,1.09,1.28,1.39,0.94,0.93,1.05,0.92,1.01,1.31,0.88,0.81,0.86,0.72,0.75,0.74,0.79,0.79,0.86,0.85,0.71,0.73,0.75,0.82,0.77,0.83,0.78,0.85,0.88,0.81,0.88,0.97,0.90,1.18,1.00,0.93,0.86,0.92,0.94,1.14,0.99,1.24,1.03,1.33,1.39,1.11,0.79,0.77,0.84,0.79,0.77,0.84,0.83,0.90,0.98,0.91,0.85,0.92,0.91,1.02,1.26,1.00,1.23,1.19,0.99,1.50,1.84,1.71,1.64,1.38,1.46,1.51,1.76,1.59,0.84,0.88,0.80,0.94,0.79,0.86,0.82,0.77,0.76,0.74,0.74,0.71,0.73,0.70,0.72,0.82,0.77,0.85,0.74,0.70,0.73,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00}
|
||||
}
|
||||
181
include/anorms.h
Normal file
181
include/anorms.h
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
{-0.525731, 0.000000, 0.850651},
|
||||
{-0.442863, 0.238856, 0.864188},
|
||||
{-0.295242, 0.000000, 0.955423},
|
||||
{-0.309017, 0.500000, 0.809017},
|
||||
{-0.162460, 0.262866, 0.951056},
|
||||
{0.000000, 0.000000, 1.000000},
|
||||
{0.000000, 0.850651, 0.525731},
|
||||
{-0.147621, 0.716567, 0.681718},
|
||||
{0.147621, 0.716567, 0.681718},
|
||||
{0.000000, 0.525731, 0.850651},
|
||||
{0.309017, 0.500000, 0.809017},
|
||||
{0.525731, 0.000000, 0.850651},
|
||||
{0.295242, 0.000000, 0.955423},
|
||||
{0.442863, 0.238856, 0.864188},
|
||||
{0.162460, 0.262866, 0.951056},
|
||||
{-0.681718, 0.147621, 0.716567},
|
||||
{-0.809017, 0.309017, 0.500000},
|
||||
{-0.587785, 0.425325, 0.688191},
|
||||
{-0.850651, 0.525731, 0.000000},
|
||||
{-0.864188, 0.442863, 0.238856},
|
||||
{-0.716567, 0.681718, 0.147621},
|
||||
{-0.688191, 0.587785, 0.425325},
|
||||
{-0.500000, 0.809017, 0.309017},
|
||||
{-0.238856, 0.864188, 0.442863},
|
||||
{-0.425325, 0.688191, 0.587785},
|
||||
{-0.716567, 0.681718, -0.147621},
|
||||
{-0.500000, 0.809017, -0.309017},
|
||||
{-0.525731, 0.850651, 0.000000},
|
||||
{0.000000, 0.850651, -0.525731},
|
||||
{-0.238856, 0.864188, -0.442863},
|
||||
{0.000000, 0.955423, -0.295242},
|
||||
{-0.262866, 0.951056, -0.162460},
|
||||
{0.000000, 1.000000, 0.000000},
|
||||
{0.000000, 0.955423, 0.295242},
|
||||
{-0.262866, 0.951056, 0.162460},
|
||||
{0.238856, 0.864188, 0.442863},
|
||||
{0.262866, 0.951056, 0.162460},
|
||||
{0.500000, 0.809017, 0.309017},
|
||||
{0.238856, 0.864188, -0.442863},
|
||||
{0.262866, 0.951056, -0.162460},
|
||||
{0.500000, 0.809017, -0.309017},
|
||||
{0.850651, 0.525731, 0.000000},
|
||||
{0.716567, 0.681718, 0.147621},
|
||||
{0.716567, 0.681718, -0.147621},
|
||||
{0.525731, 0.850651, 0.000000},
|
||||
{0.425325, 0.688191, 0.587785},
|
||||
{0.864188, 0.442863, 0.238856},
|
||||
{0.688191, 0.587785, 0.425325},
|
||||
{0.809017, 0.309017, 0.500000},
|
||||
{0.681718, 0.147621, 0.716567},
|
||||
{0.587785, 0.425325, 0.688191},
|
||||
{0.955423, 0.295242, 0.000000},
|
||||
{1.000000, 0.000000, 0.000000},
|
||||
{0.951056, 0.162460, 0.262866},
|
||||
{0.850651, -0.525731, 0.000000},
|
||||
{0.955423, -0.295242, 0.000000},
|
||||
{0.864188, -0.442863, 0.238856},
|
||||
{0.951056, -0.162460, 0.262866},
|
||||
{0.809017, -0.309017, 0.500000},
|
||||
{0.681718, -0.147621, 0.716567},
|
||||
{0.850651, 0.000000, 0.525731},
|
||||
{0.864188, 0.442863, -0.238856},
|
||||
{0.809017, 0.309017, -0.500000},
|
||||
{0.951056, 0.162460, -0.262866},
|
||||
{0.525731, 0.000000, -0.850651},
|
||||
{0.681718, 0.147621, -0.716567},
|
||||
{0.681718, -0.147621, -0.716567},
|
||||
{0.850651, 0.000000, -0.525731},
|
||||
{0.809017, -0.309017, -0.500000},
|
||||
{0.864188, -0.442863, -0.238856},
|
||||
{0.951056, -0.162460, -0.262866},
|
||||
{0.147621, 0.716567, -0.681718},
|
||||
{0.309017, 0.500000, -0.809017},
|
||||
{0.425325, 0.688191, -0.587785},
|
||||
{0.442863, 0.238856, -0.864188},
|
||||
{0.587785, 0.425325, -0.688191},
|
||||
{0.688191, 0.587785, -0.425325},
|
||||
{-0.147621, 0.716567, -0.681718},
|
||||
{-0.309017, 0.500000, -0.809017},
|
||||
{0.000000, 0.525731, -0.850651},
|
||||
{-0.525731, 0.000000, -0.850651},
|
||||
{-0.442863, 0.238856, -0.864188},
|
||||
{-0.295242, 0.000000, -0.955423},
|
||||
{-0.162460, 0.262866, -0.951056},
|
||||
{0.000000, 0.000000, -1.000000},
|
||||
{0.295242, 0.000000, -0.955423},
|
||||
{0.162460, 0.262866, -0.951056},
|
||||
{-0.442863, -0.238856, -0.864188},
|
||||
{-0.309017, -0.500000, -0.809017},
|
||||
{-0.162460, -0.262866, -0.951056},
|
||||
{0.000000, -0.850651, -0.525731},
|
||||
{-0.147621, -0.716567, -0.681718},
|
||||
{0.147621, -0.716567, -0.681718},
|
||||
{0.000000, -0.525731, -0.850651},
|
||||
{0.309017, -0.500000, -0.809017},
|
||||
{0.442863, -0.238856, -0.864188},
|
||||
{0.162460, -0.262866, -0.951056},
|
||||
{0.238856, -0.864188, -0.442863},
|
||||
{0.500000, -0.809017, -0.309017},
|
||||
{0.425325, -0.688191, -0.587785},
|
||||
{0.716567, -0.681718, -0.147621},
|
||||
{0.688191, -0.587785, -0.425325},
|
||||
{0.587785, -0.425325, -0.688191},
|
||||
{0.000000, -0.955423, -0.295242},
|
||||
{0.000000, -1.000000, 0.000000},
|
||||
{0.262866, -0.951056, -0.162460},
|
||||
{0.000000, -0.850651, 0.525731},
|
||||
{0.000000, -0.955423, 0.295242},
|
||||
{0.238856, -0.864188, 0.442863},
|
||||
{0.262866, -0.951056, 0.162460},
|
||||
{0.500000, -0.809017, 0.309017},
|
||||
{0.716567, -0.681718, 0.147621},
|
||||
{0.525731, -0.850651, 0.000000},
|
||||
{-0.238856, -0.864188, -0.442863},
|
||||
{-0.500000, -0.809017, -0.309017},
|
||||
{-0.262866, -0.951056, -0.162460},
|
||||
{-0.850651, -0.525731, 0.000000},
|
||||
{-0.716567, -0.681718, -0.147621},
|
||||
{-0.716567, -0.681718, 0.147621},
|
||||
{-0.525731, -0.850651, 0.000000},
|
||||
{-0.500000, -0.809017, 0.309017},
|
||||
{-0.238856, -0.864188, 0.442863},
|
||||
{-0.262866, -0.951056, 0.162460},
|
||||
{-0.864188, -0.442863, 0.238856},
|
||||
{-0.809017, -0.309017, 0.500000},
|
||||
{-0.688191, -0.587785, 0.425325},
|
||||
{-0.681718, -0.147621, 0.716567},
|
||||
{-0.442863, -0.238856, 0.864188},
|
||||
{-0.587785, -0.425325, 0.688191},
|
||||
{-0.309017, -0.500000, 0.809017},
|
||||
{-0.147621, -0.716567, 0.681718},
|
||||
{-0.425325, -0.688191, 0.587785},
|
||||
{-0.162460, -0.262866, 0.951056},
|
||||
{0.442863, -0.238856, 0.864188},
|
||||
{0.162460, -0.262866, 0.951056},
|
||||
{0.309017, -0.500000, 0.809017},
|
||||
{0.147621, -0.716567, 0.681718},
|
||||
{0.000000, -0.525731, 0.850651},
|
||||
{0.425325, -0.688191, 0.587785},
|
||||
{0.587785, -0.425325, 0.688191},
|
||||
{0.688191, -0.587785, 0.425325},
|
||||
{-0.955423, 0.295242, 0.000000},
|
||||
{-0.951056, 0.162460, 0.262866},
|
||||
{-1.000000, 0.000000, 0.000000},
|
||||
{-0.850651, 0.000000, 0.525731},
|
||||
{-0.955423, -0.295242, 0.000000},
|
||||
{-0.951056, -0.162460, 0.262866},
|
||||
{-0.864188, 0.442863, -0.238856},
|
||||
{-0.951056, 0.162460, -0.262866},
|
||||
{-0.809017, 0.309017, -0.500000},
|
||||
{-0.864188, -0.442863, -0.238856},
|
||||
{-0.951056, -0.162460, -0.262866},
|
||||
{-0.809017, -0.309017, -0.500000},
|
||||
{-0.681718, 0.147621, -0.716567},
|
||||
{-0.681718, -0.147621, -0.716567},
|
||||
{-0.850651, 0.000000, -0.525731},
|
||||
{-0.688191, 0.587785, -0.425325},
|
||||
{-0.587785, 0.425325, -0.688191},
|
||||
{-0.425325, 0.688191, -0.587785},
|
||||
{-0.425325, -0.688191, -0.587785},
|
||||
{-0.587785, -0.425325, -0.688191},
|
||||
{-0.688191, -0.587785, -0.425325},
|
||||
151
include/asm_draw.h
Normal file
151
include/asm_draw.h
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
//
|
||||
// asm_draw.h
|
||||
//
|
||||
// Include file for asm drawing routines.
|
||||
//
|
||||
|
||||
//
|
||||
// !!! note that this file must match the corresponding C structures at all
|
||||
// times !!!
|
||||
//
|
||||
|
||||
// !!! if this is changed, it must be changed in r_local.h too !!!
|
||||
#define NEAR_CLIP 0.01
|
||||
|
||||
// !!! if this is changed, it must be changed in r_local.h too !!!
|
||||
#define CYCLE 128
|
||||
|
||||
// espan_t structure
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
#define espan_t_u 0
|
||||
#define espan_t_v 4
|
||||
#define espan_t_count 8
|
||||
#define espan_t_pnext 12
|
||||
#define espan_t_size 16
|
||||
|
||||
// sspan_t structure
|
||||
// !!! if this is changed, it must be changed in d_local.h too !!!
|
||||
#define sspan_t_u 0
|
||||
#define sspan_t_v 4
|
||||
#define sspan_t_count 8
|
||||
#define sspan_t_size 12
|
||||
|
||||
// spanpackage_t structure
|
||||
// !!! if this is changed, it must be changed in d_polyset.c too !!!
|
||||
#define spanpackage_t_pdest 0
|
||||
#define spanpackage_t_pz 4
|
||||
#define spanpackage_t_count 8
|
||||
#define spanpackage_t_ptex 12
|
||||
#define spanpackage_t_sfrac 16
|
||||
#define spanpackage_t_tfrac 20
|
||||
#define spanpackage_t_light 24
|
||||
#define spanpackage_t_zi 28
|
||||
#define spanpackage_t_size 32
|
||||
|
||||
// edge_t structure
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
#define et_u 0
|
||||
#define et_u_step 4
|
||||
#define et_prev 8
|
||||
#define et_next 12
|
||||
#define et_surfs 16
|
||||
#define et_nextremove 20
|
||||
#define et_nearzi 24
|
||||
#define et_owner 28
|
||||
#define et_size 32
|
||||
|
||||
// surf_t structure
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
#define SURF_T_SHIFT 6
|
||||
#define st_next 0
|
||||
#define st_prev 4
|
||||
#define st_spans 8
|
||||
#define st_key 12
|
||||
#define st_last_u 16
|
||||
#define st_spanstate 20
|
||||
#define st_flags 24
|
||||
#define st_data 28
|
||||
#define st_entity 32
|
||||
#define st_nearzi 36
|
||||
#define st_insubmodel 40
|
||||
#define st_d_ziorigin 44
|
||||
#define st_d_zistepu 48
|
||||
#define st_d_zistepv 52
|
||||
#define st_pad 56
|
||||
#define st_size 64
|
||||
|
||||
// clipplane_t structure
|
||||
// !!! if this is changed, it must be changed in r_local.h too !!!
|
||||
#define cp_normal 0
|
||||
#define cp_dist 12
|
||||
#define cp_next 16
|
||||
#define cp_leftedge 20
|
||||
#define cp_rightedge 21
|
||||
#define cp_reserved 22
|
||||
#define cp_size 24
|
||||
|
||||
// medge_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define me_v 0
|
||||
#define me_cachededgeoffset 4
|
||||
#define me_size 8
|
||||
|
||||
// mvertex_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define mv_position 0
|
||||
#define mv_size 12
|
||||
|
||||
// refdef_t structure
|
||||
// !!! if this is changed, it must be changed in render.h too !!!
|
||||
#define rd_vrect 0
|
||||
#define rd_aliasvrect 20
|
||||
#define rd_vrectright 40
|
||||
#define rd_vrectbottom 44
|
||||
#define rd_aliasvrectright 48
|
||||
#define rd_aliasvrectbottom 52
|
||||
#define rd_vrectrightedge 56
|
||||
#define rd_fvrectx 60
|
||||
#define rd_fvrecty 64
|
||||
#define rd_fvrectx_adj 68
|
||||
#define rd_fvrecty_adj 72
|
||||
#define rd_vrect_x_adj_shift20 76
|
||||
#define rd_vrectright_adj_shift20 80
|
||||
#define rd_fvrectright_adj 84
|
||||
#define rd_fvrectbottom_adj 88
|
||||
#define rd_fvrectright 92
|
||||
#define rd_fvrectbottom 96
|
||||
#define rd_horizontalFieldOfView 100
|
||||
#define rd_xOrigin 104
|
||||
#define rd_yOrigin 108
|
||||
#define rd_vieworg 112
|
||||
#define rd_viewangles 124
|
||||
#define rd_ambientlight 136
|
||||
#define rd_size 140
|
||||
|
||||
// mtriangle_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define mtri_facesfront 0
|
||||
#define mtri_vertindex 4
|
||||
#define mtri_size 16 // !!! if this changes, array indexing in !!!
|
||||
// !!! d_polysa.s must be changed to match !!!
|
||||
#define mtri_shift 4
|
||||
|
||||
97
include/asm_i386.h
Normal file
97
include/asm_i386.h
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __ASM_I386__
|
||||
#define __ASM_I386__
|
||||
|
||||
#ifdef ELF
|
||||
#define C(label) label
|
||||
#else
|
||||
#define C(label) _##label
|
||||
#endif
|
||||
|
||||
//
|
||||
// !!! note that this file must match the corresponding C structures at all
|
||||
// times !!!
|
||||
//
|
||||
|
||||
// plane_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
// !!! if the size of this is changed, the array lookup in SV_HullPointContents
|
||||
// must be changed too !!!
|
||||
#define pl_normal 0
|
||||
#define pl_dist 12
|
||||
#define pl_type 16
|
||||
#define pl_signbits 17
|
||||
#define pl_pad 18
|
||||
#define pl_size 20
|
||||
|
||||
// hull_t structure
|
||||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define hu_clipnodes 0
|
||||
#define hu_planes 4
|
||||
#define hu_firstclipnode 8
|
||||
#define hu_lastclipnode 12
|
||||
#define hu_clip_mins 16
|
||||
#define hu_clip_maxs 28
|
||||
#define hu_size 40
|
||||
|
||||
// dnode_t structure
|
||||
// !!! if this is changed, it must be changed in bspfile.h too !!!
|
||||
#define nd_planenum 0
|
||||
#define nd_children 4
|
||||
#define nd_mins 8
|
||||
#define nd_maxs 20
|
||||
#define nd_firstface 32
|
||||
#define nd_numfaces 36
|
||||
#define nd_size 40
|
||||
|
||||
// sfxcache_t structure
|
||||
// !!! if this is changed, it much be changed in sound.h too !!!
|
||||
#define sfxc_length 0
|
||||
#define sfxc_loopstart 4
|
||||
#define sfxc_speed 8
|
||||
#define sfxc_width 12
|
||||
#define sfxc_stereo 16
|
||||
#define sfxc_data 20
|
||||
|
||||
// channel_t structure
|
||||
// !!! if this is changed, it much be changed in sound.h too !!!
|
||||
#define ch_sfx 0
|
||||
#define ch_leftvol 4
|
||||
#define ch_rightvol 8
|
||||
#define ch_end 12
|
||||
#define ch_pos 16
|
||||
#define ch_looping 20
|
||||
#define ch_entnum 24
|
||||
#define ch_entchannel 28
|
||||
#define ch_origin 32
|
||||
#define ch_dist_mult 44
|
||||
#define ch_master_vol 48
|
||||
#define ch_size 52
|
||||
|
||||
// portable_samplepair_t structure
|
||||
// !!! if this is changed, it much be changed in sound.h too !!!
|
||||
#define psp_left 0
|
||||
#define psp_right 4
|
||||
#define psp_size 8
|
||||
|
||||
#endif
|
||||
|
||||
142
include/block16.h
Normal file
142
include/block16.h
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
LEnter16_16:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch0:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch1:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch2:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch3:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch4:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch5:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch6:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch7:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
LEnter8_16:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch8:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch9:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch10:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch11:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
LEnter4_16:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch12:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch13:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
|
||||
LEnter2_16:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movw 0x12345678(,%eax,2),%ax
|
||||
LBPatch14:
|
||||
addl %ebp,%edx
|
||||
movw %ax,(%edi)
|
||||
movw 0x12345678(,%ecx,2),%cx
|
||||
LBPatch15:
|
||||
movw %cx,2(%edi)
|
||||
addl $0x4,%edi
|
||||
143
include/block8.h
Normal file
143
include/block8.h
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
LEnter16_8:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch0:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch1:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch2:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch3:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch4:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch5:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch6:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch7:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
LEnter8_8:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch8:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch9:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch10:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch11:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
LEnter4_8:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch12:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch13:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
LEnter2_8:
|
||||
movb (%esi),%al
|
||||
movb (%esi,%ebx,),%cl
|
||||
movb %dh,%ah
|
||||
addl %ebp,%edx
|
||||
movb %dh,%ch
|
||||
leal (%esi,%ebx,2),%esi
|
||||
movb 0x12345678(%eax),%al
|
||||
LBPatch14:
|
||||
addl %ebp,%edx
|
||||
movb %al,(%edi)
|
||||
movb 0x12345678(%ecx),%cl
|
||||
LBPatch15:
|
||||
movb %cl,1(%edi)
|
||||
addl $0x2,%edi
|
||||
|
||||
324
include/bspfile.h
Normal file
324
include/bspfile.h
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// upper design bounds
|
||||
|
||||
#define MAX_MAP_HULLS 4
|
||||
|
||||
#define MAX_MAP_MODELS 256
|
||||
#define MAX_MAP_BRUSHES 4096
|
||||
#define MAX_MAP_ENTITIES 1024
|
||||
#define MAX_MAP_ENTSTRING 65536
|
||||
|
||||
#define MAX_MAP_PLANES 32767
|
||||
#define MAX_MAP_NODES 32767 // because negative shorts are contents
|
||||
#define MAX_MAP_CLIPNODES 32767 //
|
||||
#define MAX_MAP_LEAFS 8192
|
||||
#define MAX_MAP_VERTS 65535
|
||||
#define MAX_MAP_FACES 65535
|
||||
#define MAX_MAP_MARKSURFACES 65535
|
||||
#define MAX_MAP_TEXINFO 4096
|
||||
#define MAX_MAP_EDGES 256000
|
||||
#define MAX_MAP_SURFEDGES 512000
|
||||
#define MAX_MAP_TEXTURES 512
|
||||
#define MAX_MAP_MIPTEX 0x200000
|
||||
#define MAX_MAP_LIGHTING 0x100000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
|
||||
// key / value pair sizes
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
#define BSPVERSION 29
|
||||
#define TOOLVERSION 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_TEXTURES 2
|
||||
#define LUMP_VERTEXES 3
|
||||
#define LUMP_VISIBILITY 4
|
||||
#define LUMP_NODES 5
|
||||
#define LUMP_TEXINFO 6
|
||||
#define LUMP_FACES 7
|
||||
#define LUMP_LIGHTING 8
|
||||
#define LUMP_CLIPNODES 9
|
||||
#define LUMP_LEAFS 10
|
||||
#define LUMP_MARKSURFACES 11
|
||||
#define LUMP_EDGES 12
|
||||
#define LUMP_SURFEDGES 13
|
||||
#define LUMP_MODELS 14
|
||||
|
||||
#define HEADER_LUMPS 15
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3];
|
||||
int headnode[MAX_MAP_HULLS];
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
} dmodel_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nummiptex;
|
||||
int dataofs[4]; // [nummiptex]
|
||||
} dmiptexlump_t;
|
||||
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
} miptex_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
// 0-2 are axial planes
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
// 3-5 are non-axial planes snapped to the nearest
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
|
||||
} dplane_t;
|
||||
|
||||
|
||||
|
||||
#define CONTENTS_EMPTY -1
|
||||
#define CONTENTS_SOLID -2
|
||||
#define CONTENTS_WATER -3
|
||||
#define CONTENTS_SLIME -4
|
||||
#define CONTENTS_LAVA -5
|
||||
#define CONTENTS_SKY -6
|
||||
#define CONTENTS_ORIGIN -7 // removed at csg time
|
||||
#define CONTENTS_CLIP -8 // changed to contents_solid
|
||||
|
||||
#define CONTENTS_CURRENT_0 -9
|
||||
#define CONTENTS_CURRENT_90 -10
|
||||
#define CONTENTS_CURRENT_180 -11
|
||||
#define CONTENTS_CURRENT_270 -12
|
||||
#define CONTENTS_CURRENT_UP -13
|
||||
#define CONTENTS_CURRENT_DOWN -14
|
||||
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
short children[2]; // negative numbers are -(leafs+1), not nodes
|
||||
short mins[3]; // for sphere culling
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; // counting both sides
|
||||
} dnode_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
short children[2]; // negative numbers are contents
|
||||
} dclipnode_t;
|
||||
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; // [s/t][xyz offset]
|
||||
int miptex;
|
||||
int flags;
|
||||
} texinfo_t;
|
||||
#define TEX_SPECIAL 1 // sky or slime, no lightmap or 256 subdivision
|
||||
|
||||
// note that edge 0 is never used, because negative edge nums are used for
|
||||
// counterclockwise use of the edge in a face
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; // vertex numbers
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; // start of [numstyles*surfsize] samples
|
||||
} dface_t;
|
||||
|
||||
|
||||
|
||||
#define AMBIENT_WATER 0
|
||||
#define AMBIENT_SKY 1
|
||||
#define AMBIENT_SLIME 2
|
||||
#define AMBIENT_LAVA 3
|
||||
|
||||
#define NUM_AMBIENTS 4 // automatic ambient sounds
|
||||
|
||||
// leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas
|
||||
// all other leafs need visibility info
|
||||
typedef struct
|
||||
{
|
||||
int contents;
|
||||
int visofs; // -1 = no visibility info
|
||||
|
||||
short mins[3]; // for frustum culling
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstmarksurface;
|
||||
unsigned short nummarksurfaces;
|
||||
|
||||
byte ambient_level[NUM_AMBIENTS];
|
||||
} dleaf_t;
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifndef QUAKE_GAME
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
|
||||
// the utilities get to be lazy and just use large static arrays
|
||||
|
||||
extern int nummodels;
|
||||
extern dmodel_t dmodels[MAX_MAP_MODELS];
|
||||
|
||||
extern int visdatasize;
|
||||
extern byte dvisdata[MAX_MAP_VISIBILITY];
|
||||
|
||||
extern int lightdatasize;
|
||||
extern byte dlightdata[MAX_MAP_LIGHTING];
|
||||
|
||||
extern int texdatasize;
|
||||
extern byte dtexdata[MAX_MAP_MIPTEX]; // (dmiptexlump_t)
|
||||
|
||||
extern int entdatasize;
|
||||
extern char dentdata[MAX_MAP_ENTSTRING];
|
||||
|
||||
extern int numleafs;
|
||||
extern dleaf_t dleafs[MAX_MAP_LEAFS];
|
||||
|
||||
extern int numplanes;
|
||||
extern dplane_t dplanes[MAX_MAP_PLANES];
|
||||
|
||||
extern int numvertexes;
|
||||
extern dvertex_t dvertexes[MAX_MAP_VERTS];
|
||||
|
||||
extern int numnodes;
|
||||
extern dnode_t dnodes[MAX_MAP_NODES];
|
||||
|
||||
extern int numtexinfo;
|
||||
extern texinfo_t texinfo[MAX_MAP_TEXINFO];
|
||||
|
||||
extern int numfaces;
|
||||
extern dface_t dfaces[MAX_MAP_FACES];
|
||||
|
||||
extern int numclipnodes;
|
||||
extern dclipnode_t dclipnodes[MAX_MAP_CLIPNODES];
|
||||
|
||||
extern int numedges;
|
||||
extern dedge_t dedges[MAX_MAP_EDGES];
|
||||
|
||||
extern int nummarksurfaces;
|
||||
extern unsigned short dmarksurfaces[MAX_MAP_MARKSURFACES];
|
||||
|
||||
extern int numsurfedges;
|
||||
extern int dsurfedges[MAX_MAP_SURFEDGES];
|
||||
|
||||
|
||||
void DecompressVis (byte *in, byte *decompressed);
|
||||
int CompressVis (byte *vis, byte *dest);
|
||||
|
||||
void LoadBSPFile (char *filename);
|
||||
void WriteBSPFile (char *filename);
|
||||
void PrintBSPFileSizes (void);
|
||||
|
||||
//===============
|
||||
|
||||
|
||||
typedef struct epair_s
|
||||
{
|
||||
struct epair_s *next;
|
||||
char *key;
|
||||
char *value;
|
||||
} epair_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t origin;
|
||||
int firstbrush;
|
||||
int numbrushes;
|
||||
epair_t *epairs;
|
||||
} entity_t;
|
||||
|
||||
extern int num_entities;
|
||||
extern entity_t entities[MAX_MAP_ENTITIES];
|
||||
|
||||
void ParseEntities (void);
|
||||
void UnparseEntities (void);
|
||||
|
||||
void SetKeyValue (entity_t *ent, char *key, char *value);
|
||||
char *ValueForKey (entity_t *ent, char *key);
|
||||
// will return "" if not present
|
||||
|
||||
vec_t FloatForKey (entity_t *ent, char *key);
|
||||
void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
|
||||
|
||||
epair_t *ParseEpair (void);
|
||||
|
||||
#endif
|
||||
27
include/cdaudio.h
Normal file
27
include/cdaudio.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
int CDAudio_Init(void);
|
||||
void CDAudio_Play(byte track, qboolean looping);
|
||||
void CDAudio_Stop(void);
|
||||
void CDAudio_Pause(void);
|
||||
void CDAudio_Resume(void);
|
||||
void CDAudio_Shutdown(void);
|
||||
void CDAudio_Update(void);
|
||||
375
include/client.h
Normal file
375
include/client.h
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// client.h
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t viewangles;
|
||||
|
||||
// intended velocities
|
||||
float forwardmove;
|
||||
float sidemove;
|
||||
float upmove;
|
||||
#ifdef QUAKE2
|
||||
byte lightlevel;
|
||||
#endif
|
||||
} usercmd_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int length;
|
||||
char map[MAX_STYLESTRING];
|
||||
} lightstyle_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[MAX_SCOREBOARDNAME];
|
||||
float entertime;
|
||||
int frags;
|
||||
int colors; // two 4 bit fields
|
||||
byte translations[VID_GRADES*256];
|
||||
} scoreboard_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int destcolor[3];
|
||||
int percent; // 0-256
|
||||
} cshift_t;
|
||||
|
||||
#define CSHIFT_CONTENTS 0
|
||||
#define CSHIFT_DAMAGE 1
|
||||
#define CSHIFT_BONUS 2
|
||||
#define CSHIFT_POWERUP 3
|
||||
#define NUM_CSHIFTS 4
|
||||
|
||||
#define NAME_LENGTH 64
|
||||
|
||||
|
||||
//
|
||||
// client_state_t should hold all pieces of the client state
|
||||
//
|
||||
|
||||
#define SIGNONS 4 // signon messages to receive before connected
|
||||
|
||||
#define MAX_DLIGHTS 32
|
||||
typedef struct
|
||||
{
|
||||
vec3_t 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;
|
||||
#ifdef QUAKE2
|
||||
qboolean dark; // subtracts light instead of adding
|
||||
#endif
|
||||
} dlight_t;
|
||||
|
||||
|
||||
#define MAX_BEAMS 24
|
||||
typedef struct
|
||||
{
|
||||
int entity;
|
||||
struct model_s *model;
|
||||
float endtime;
|
||||
vec3_t start, end;
|
||||
} beam_t;
|
||||
|
||||
#define MAX_EFRAGS 640
|
||||
|
||||
#define MAX_MAPSTRING 2048
|
||||
#define MAX_DEMOS 8
|
||||
#define MAX_DEMONAME 16
|
||||
|
||||
typedef enum {
|
||||
ca_dedicated, // a dedicated server with no ability to start a client
|
||||
ca_disconnected, // full screen console with no connection
|
||||
ca_connected // valid netcon, talking to a server
|
||||
} cactive_t;
|
||||
|
||||
//
|
||||
// the client_static_t structure is persistant through an arbitrary number
|
||||
// of server connections
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
cactive_t state;
|
||||
|
||||
// personalization data sent to server
|
||||
char mapstring[MAX_QPATH];
|
||||
char spawnparms[MAX_MAPSTRING]; // to restart a level
|
||||
|
||||
// demo loop control
|
||||
int demonum; // -1 = don't play demos
|
||||
char demos[MAX_DEMOS][MAX_DEMONAME]; // when not playing
|
||||
|
||||
// demo recording info must be here, because record is started before
|
||||
// entering a map (and clearing client_state_t)
|
||||
qboolean demorecording;
|
||||
qboolean demoplayback;
|
||||
qboolean timedemo;
|
||||
int forcetrack; // -1 = use normal cd track
|
||||
FILE *demofile;
|
||||
int td_lastframe; // to meter out one message a frame
|
||||
int td_startframe; // host_framecount at start
|
||||
float td_starttime; // realtime at second frame of timedemo
|
||||
|
||||
|
||||
// connection information
|
||||
int signon; // 0 to SIGNONS
|
||||
struct qsocket_s *netcon;
|
||||
sizebuf_t message; // writing buffer to send to server
|
||||
|
||||
} client_static_t;
|
||||
|
||||
extern client_static_t cls;
|
||||
|
||||
//
|
||||
// the client_state_t structure is wiped completely at every
|
||||
// server signon
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
int movemessages; // since connecting to this server
|
||||
// throw out the first couple, so the player
|
||||
// doesn't accidentally do something the
|
||||
// first frame
|
||||
usercmd_t cmd; // last command sent to the server
|
||||
|
||||
// information for local display
|
||||
int stats[MAX_CL_STATS]; // health, etc
|
||||
int items; // inventory bit flags
|
||||
float item_gettime[32]; // cl.time of aquiring item, for blinking
|
||||
float faceanimtime; // use anim frame if cl.time < this
|
||||
|
||||
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
|
||||
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
|
||||
|
||||
// the client maintains its own idea of view angles, which are
|
||||
// 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.
|
||||
vec3_t mviewangles[2]; // during demo playback viewangles is lerped
|
||||
// between these
|
||||
vec3_t viewangles;
|
||||
|
||||
vec3_t mvelocity[2]; // update by server, used for lean+bob
|
||||
// (0 is newest)
|
||||
vec3_t velocity; // lerped between mvelocity[0] and [1]
|
||||
|
||||
vec3_t punchangle; // temporary offset
|
||||
|
||||
// pitch drifting vars
|
||||
float idealpitch;
|
||||
float pitchvel;
|
||||
qboolean nodrift;
|
||||
float driftmove;
|
||||
double laststop;
|
||||
|
||||
float viewheight;
|
||||
float crouch; // local amount for smoothing stepups
|
||||
|
||||
qboolean paused; // send over by server
|
||||
qboolean onground;
|
||||
qboolean inwater;
|
||||
|
||||
int intermission; // don't change view angle, full screen, etc
|
||||
int completed_time; // latched at intermission start
|
||||
|
||||
double mtime[2]; // the timestamp of last two messages
|
||||
double time; // clients view of time, should be between
|
||||
// servertime and oldservertime to generate
|
||||
// a lerp point for other data
|
||||
double oldtime; // previous cl.time, time-oldtime is used
|
||||
// to decay light values and smooth step ups
|
||||
|
||||
|
||||
float last_received_message; // (realtime) for net trouble icon
|
||||
|
||||
//
|
||||
// information that is static for the entire time connected to a server
|
||||
//
|
||||
struct model_s *model_precache[MAX_MODELS];
|
||||
struct sfx_s *sound_precache[MAX_SOUNDS];
|
||||
|
||||
char levelname[40]; // for display on solo scoreboard
|
||||
int viewentity; // cl_entitites[cl.viewentity] = player
|
||||
int maxclients;
|
||||
int gametype;
|
||||
|
||||
// refresh related state
|
||||
struct model_s *worldmodel; // cl_entitites[0].model
|
||||
struct efrag_s *free_efrags;
|
||||
int num_entities; // held in cl_entities array
|
||||
int num_statics; // held in cl_staticentities array
|
||||
entity_t viewent; // the gun model
|
||||
|
||||
int cdtrack, looptrack; // cd audio
|
||||
|
||||
// frag scoreboard
|
||||
scoreboard_t *scores; // [cl.maxclients]
|
||||
|
||||
#ifdef QUAKE2
|
||||
// light level at player's position including dlights
|
||||
// this is sent back to the server each frame
|
||||
// architectually ugly but it works
|
||||
int light_level;
|
||||
#endif
|
||||
} client_state_t;
|
||||
|
||||
|
||||
//
|
||||
// cvars
|
||||
//
|
||||
extern cvar_t cl_name;
|
||||
extern cvar_t cl_color;
|
||||
|
||||
extern cvar_t cl_upspeed;
|
||||
extern cvar_t cl_forwardspeed;
|
||||
extern cvar_t cl_backspeed;
|
||||
extern cvar_t cl_sidespeed;
|
||||
|
||||
extern cvar_t cl_movespeedkey;
|
||||
|
||||
extern cvar_t cl_yawspeed;
|
||||
extern cvar_t cl_pitchspeed;
|
||||
|
||||
extern cvar_t cl_anglespeedkey;
|
||||
|
||||
extern cvar_t cl_autofire;
|
||||
|
||||
extern cvar_t cl_shownet;
|
||||
extern cvar_t cl_nolerp;
|
||||
|
||||
extern cvar_t cl_pitchdriftspeed;
|
||||
extern cvar_t lookspring;
|
||||
extern cvar_t lookstrafe;
|
||||
extern cvar_t sensitivity;
|
||||
|
||||
extern cvar_t m_pitch;
|
||||
extern cvar_t m_yaw;
|
||||
extern cvar_t m_forward;
|
||||
extern cvar_t m_side;
|
||||
|
||||
|
||||
#define MAX_TEMP_ENTITIES 64 // lightning bolts, etc
|
||||
#define MAX_STATIC_ENTITIES 128 // torches, etc
|
||||
|
||||
extern client_state_t cl;
|
||||
|
||||
// FIXME, allocate dynamically
|
||||
extern efrag_t cl_efrags[MAX_EFRAGS];
|
||||
extern entity_t cl_entities[MAX_EDICTS];
|
||||
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
||||
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
|
||||
extern dlight_t cl_dlights[MAX_DLIGHTS];
|
||||
extern entity_t cl_temp_entities[MAX_TEMP_ENTITIES];
|
||||
extern beam_t cl_beams[MAX_BEAMS];
|
||||
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// cl_main
|
||||
//
|
||||
dlight_t *CL_AllocDlight (int key);
|
||||
void CL_DecayLights (void);
|
||||
|
||||
void CL_Init (void);
|
||||
|
||||
void CL_EstablishConnection (char *host);
|
||||
void CL_Signon1 (void);
|
||||
void CL_Signon2 (void);
|
||||
void CL_Signon3 (void);
|
||||
void CL_Signon4 (void);
|
||||
|
||||
void CL_Disconnect (void);
|
||||
void CL_Disconnect_f (void);
|
||||
void CL_NextDemo (void);
|
||||
|
||||
#define MAX_VISEDICTS 256
|
||||
extern int cl_numvisedicts;
|
||||
extern entity_t *cl_visedicts[MAX_VISEDICTS];
|
||||
|
||||
//
|
||||
// cl_input
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
int down[2]; // key nums holding it down
|
||||
int state; // low bit is down state
|
||||
} kbutton_t;
|
||||
|
||||
extern kbutton_t in_mlook, in_klook;
|
||||
extern kbutton_t in_strafe;
|
||||
extern kbutton_t in_speed;
|
||||
|
||||
void CL_InitInput (void);
|
||||
void CL_SendCmd (void);
|
||||
void CL_SendMove (usercmd_t *cmd);
|
||||
|
||||
void CL_ParseTEnt (void);
|
||||
void CL_UpdateTEnts (void);
|
||||
|
||||
void CL_ClearState (void);
|
||||
|
||||
|
||||
int CL_ReadFromServer (void);
|
||||
void CL_WriteToServer (usercmd_t *cmd);
|
||||
void CL_BaseMove (usercmd_t *cmd);
|
||||
|
||||
|
||||
float CL_KeyState (kbutton_t *key);
|
||||
char *Key_KeynumToString (int keynum);
|
||||
|
||||
//
|
||||
// cl_demo.c
|
||||
//
|
||||
void CL_StopPlayback (void);
|
||||
int CL_GetMessage (void);
|
||||
|
||||
void CL_Stop_f (void);
|
||||
void CL_Record_f (void);
|
||||
void CL_PlayDemo_f (void);
|
||||
void CL_TimeDemo_f (void);
|
||||
|
||||
//
|
||||
// cl_parse.c
|
||||
//
|
||||
void CL_ParseServerMessage (void);
|
||||
void CL_NewTranslation (int slot);
|
||||
|
||||
//
|
||||
// view
|
||||
//
|
||||
void V_StartPitchDrift (void);
|
||||
void V_StopPitchDrift (void);
|
||||
|
||||
void V_RenderView (void);
|
||||
void V_UpdatePalette (void);
|
||||
void V_Register (void);
|
||||
void V_ParseDamage (void);
|
||||
void V_SetContentsColor (int contents);
|
||||
|
||||
|
||||
//
|
||||
// cl_tent
|
||||
//
|
||||
void CL_InitTEnts (void);
|
||||
void CL_SignonReply (void);
|
||||
121
include/cmd.h
Normal file
121
include/cmd.h
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
// cmd.h -- Command buffer and command execution
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
|
||||
Any number of commands can be added in a frame, from several different sources.
|
||||
Most commands come from either keybindings or console line input, but remote
|
||||
servers can also send across commands and entire text files can be execed.
|
||||
|
||||
The + command line options are also added to the command buffer.
|
||||
|
||||
The game starts with a Cbuf_AddText ("exec quake.rc\n"); Cbuf_Execute ();
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void Cbuf_Init (void);
|
||||
// allocates an initial text buffer that will grow as needed
|
||||
|
||||
void Cbuf_AddText (char *text);
|
||||
// as new commands are generated from the console or keybindings,
|
||||
// the text is added to the end of the command buffer.
|
||||
|
||||
void Cbuf_InsertText (char *text);
|
||||
// when a command wants to issue other commands immediately, the text is
|
||||
// inserted at the beginning of the buffer, before any remaining unexecuted
|
||||
// commands.
|
||||
|
||||
void Cbuf_Execute (void);
|
||||
// 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.
|
||||
// Do not call inside a command function!
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
|
||||
Command execution takes a null terminated string, breaks it into tokens,
|
||||
then searches for a command or variable that matches the first token.
|
||||
|
||||
Commands can come from three sources, but the handler functions may choose
|
||||
to dissallow the action or forward it to a remote server if the source is
|
||||
not apropriate.
|
||||
|
||||
*/
|
||||
|
||||
typedef void (*xcommand_t) (void);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
src_client, // came in over a net connection as a clc_stringcmd
|
||||
// host_client will be valid during this state.
|
||||
src_command // from the command buffer
|
||||
} cmd_source_t;
|
||||
|
||||
extern cmd_source_t cmd_source;
|
||||
|
||||
void Cmd_Init (void);
|
||||
|
||||
void Cmd_AddCommand (char *cmd_name, xcommand_t function);
|
||||
// called by the init functions of other parts of the program to
|
||||
// register commands and functions to call for them.
|
||||
// The cmd_name is referenced later, so it should not be in temp memory
|
||||
|
||||
qboolean Cmd_Exists (char *cmd_name);
|
||||
// used by the cvar code to check for cvar / command name overlap
|
||||
|
||||
char *Cmd_CompleteCommand (char *partial);
|
||||
// attempts to match a partial command for automatic command line completion
|
||||
// returns NULL if nothing fits
|
||||
|
||||
int Cmd_Argc (void);
|
||||
char *Cmd_Argv (int arg);
|
||||
char *Cmd_Args (void);
|
||||
// The functions that execute commands get their parameters with these
|
||||
// functions. Cmd_Argv () will return an empty string, not a NULL
|
||||
// if arg > argc, so string operations are allways safe.
|
||||
|
||||
int Cmd_CheckParm (char *parm);
|
||||
// Returns the position (1 to argc-1) in the command's argument list
|
||||
// where the given parameter apears, or 0 if not present
|
||||
|
||||
void Cmd_TokenizeString (char *text);
|
||||
// Takes a null terminated string. Does not need to be /n terminated.
|
||||
// breaks the string up into arg tokens.
|
||||
|
||||
void Cmd_ExecuteString (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);
|
||||
// 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.
|
||||
|
||||
void Cmd_Print (char *text);
|
||||
// used by command functions to send output to either the graphics console or
|
||||
// passed as a print message to the client
|
||||
|
||||
183
include/common.h
Normal file
183
include/common.h
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// comndef.h -- general definitions
|
||||
|
||||
#if !defined BYTE_DEFINED
|
||||
typedef unsigned char byte;
|
||||
#define BYTE_DEFINED 1
|
||||
#endif
|
||||
|
||||
#undef true
|
||||
#undef false
|
||||
|
||||
typedef enum {false, true} qboolean;
|
||||
|
||||
//============================================================================
|
||||
|
||||
typedef struct sizebuf_s
|
||||
{
|
||||
qboolean allowoverflow; // if false, do a Sys_Error
|
||||
qboolean 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, void *data, int length);
|
||||
void SZ_Print (sizebuf_t *buf, char *data); // strcats onto the sizebuf
|
||||
|
||||
//============================================================================
|
||||
|
||||
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);
|
||||
void InsertLinkAfter (link_t *l, link_t *after);
|
||||
|
||||
// (type *)STRUCT_FROM_LINK(link_t *link, type, member)
|
||||
// ent = STRUCT_FROM_LINK(link,entity_t,order)
|
||||
// FIXME: remove this mess!
|
||||
#define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (long)&(((t *)0)->m)))
|
||||
|
||||
//============================================================================
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
#define Q_MAXCHAR ((char)0x7f)
|
||||
#define Q_MAXSHORT ((short)0x7fff)
|
||||
#define Q_MAXINT ((int)0x7fffffff)
|
||||
#define Q_MAXLONG ((int)0x7fffffff)
|
||||
#define Q_MAXFLOAT ((int)0x7fffffff)
|
||||
|
||||
#define Q_MINCHAR ((char)0x80)
|
||||
#define Q_MINSHORT ((short)0x8000)
|
||||
#define Q_MININT ((int)0x80000000)
|
||||
#define Q_MINLONG ((int)0x80000000)
|
||||
#define Q_MINFLOAT ((int)0x7fffffff)
|
||||
|
||||
//============================================================================
|
||||
|
||||
extern qboolean bigendien;
|
||||
|
||||
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, char *s);
|
||||
void MSG_WriteCoord (sizebuf_t *sb, float f);
|
||||
void MSG_WriteAngle (sizebuf_t *sb, float f);
|
||||
|
||||
extern int msg_readcount;
|
||||
extern qboolean 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);
|
||||
char *MSG_ReadString (void);
|
||||
|
||||
float MSG_ReadCoord (void);
|
||||
float MSG_ReadAngle (void);
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Q_memset (void *dest, int fill, int count);
|
||||
void Q_memcpy (void *dest, void *src, int count);
|
||||
int Q_memcmp (void *m1, void *m2, int count);
|
||||
void Q_strcpy (char *dest, char *src);
|
||||
void Q_strncpy (char *dest, char *src, int count);
|
||||
int Q_strlen (char *str);
|
||||
char *Q_strrchr (char *s, char c);
|
||||
void Q_strcat (char *dest, char *src);
|
||||
int Q_strcmp (char *s1, char *s2);
|
||||
int Q_strncmp (char *s1, char *s2, int count);
|
||||
int Q_strcasecmp (char *s1, char *s2);
|
||||
int Q_strncasecmp (char *s1, char *s2, int n);
|
||||
int Q_atoi (char *str);
|
||||
float Q_atof (char *str);
|
||||
|
||||
//============================================================================
|
||||
|
||||
extern char com_token[1024];
|
||||
extern qboolean com_eof;
|
||||
|
||||
char *COM_Parse (char *data);
|
||||
|
||||
|
||||
extern int com_argc;
|
||||
extern char **com_argv;
|
||||
|
||||
int COM_CheckParm (char *parm);
|
||||
void COM_Init (char *path);
|
||||
void COM_InitArgv (int argc, char **argv);
|
||||
|
||||
char *COM_SkipPath (char *pathname);
|
||||
void COM_StripExtension (char *in, char *out);
|
||||
void COM_FileBase (char *in, char *out);
|
||||
void COM_DefaultExtension (char *path, char *extension);
|
||||
|
||||
char *va(char *format, ...);
|
||||
// does a varargs printf into a temp buffer
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
extern int com_filesize;
|
||||
struct cache_user_s;
|
||||
|
||||
extern char com_gamedir[MAX_OSPATH];
|
||||
|
||||
void COM_WriteFile (char *filename, void *data, int len);
|
||||
int COM_OpenFile (char *filename, int *hndl);
|
||||
int COM_FOpenFile (char *filename, FILE **file);
|
||||
void COM_CloseFile (int h);
|
||||
|
||||
byte *COM_LoadStackFile (char *path, void *buffer, int bufsize);
|
||||
byte *COM_LoadTempFile (char *path);
|
||||
byte *COM_LoadHunkFile (char *path);
|
||||
void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
|
||||
|
||||
|
||||
extern struct cvar_s registered;
|
||||
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
37
include/conproc.h
Normal file
37
include/conproc.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// conproc.h
|
||||
|
||||
#define CCOM_WRITE_TEXT 0x2
|
||||
// Param1 : Text
|
||||
|
||||
#define CCOM_GET_TEXT 0x3
|
||||
// Param1 : Begin line
|
||||
// Param2 : End line
|
||||
|
||||
#define CCOM_GET_SCR_LINES 0x4
|
||||
// No params
|
||||
|
||||
#define CCOM_SET_SCR_LINES 0x5
|
||||
// Param1 : Number of lines
|
||||
|
||||
void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild);
|
||||
void DeinitConProc (void);
|
||||
|
||||
46
include/console.h
Normal file
46
include/console.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// console
|
||||
//
|
||||
extern int con_totallines;
|
||||
extern int con_backscroll;
|
||||
extern qboolean con_forcedup; // because no entities to refresh
|
||||
extern qboolean con_initialized;
|
||||
extern byte *con_chars;
|
||||
extern int con_notifylines; // scan lines to clear for notify lines
|
||||
|
||||
void Con_DrawCharacter (int cx, int line, int num);
|
||||
|
||||
void Con_CheckResize (void);
|
||||
void Con_Init (void);
|
||||
void Con_DrawConsole (int lines, qboolean drawinput);
|
||||
void Con_Print (char *txt);
|
||||
void Con_Printf (char *fmt, ...);
|
||||
void Con_DPrintf (char *fmt, ...);
|
||||
void Con_SafePrintf (char *fmt, ...);
|
||||
void Con_Clear_f (void);
|
||||
void Con_DrawNotify (void);
|
||||
void Con_ClearNotify (void);
|
||||
void Con_ToggleConsole_f (void);
|
||||
|
||||
void Con_NotifyBox (char *text); // during startup for sound / cd warnings
|
||||
|
||||
24
include/crc.h
Normal file
24
include/crc.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/* crc.h */
|
||||
|
||||
void CRC_Init(unsigned short *crcvalue);
|
||||
void CRC_ProcessByte(unsigned short *crcvalue, byte data);
|
||||
unsigned short CRC_Value(unsigned short crcvalue);
|
||||
97
include/cvar.h
Normal file
97
include/cvar.h
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// cvar.h
|
||||
|
||||
/*
|
||||
|
||||
cvar_t variables are used to hold scalar or string variables that can be changed or displayed at the console or prog code as well as accessed directly
|
||||
in C code.
|
||||
|
||||
it is sufficient to initialize a cvar_t with just the first two fields, or
|
||||
you can add a ,true flag for variables that you want saved to the configuration
|
||||
file when the game is quit:
|
||||
|
||||
cvar_t r_draworder = {"r_draworder","1"};
|
||||
cvar_t scr_screensize = {"screensize","1",true};
|
||||
|
||||
Cvars must be registered before use, or they will have a 0 value instead of the float interpretation of the string. Generally, all cvar_t declarations should be registered in the apropriate init function before any console commands are executed:
|
||||
Cvar_RegisterVariable (&host_framerate);
|
||||
|
||||
|
||||
C code usually just references a cvar in place:
|
||||
if ( r_draworder.value )
|
||||
|
||||
It could optionally ask for the value to be looked up for a string name:
|
||||
if (Cvar_VariableValue ("r_draworder"))
|
||||
|
||||
Interpreted prog code can access cvars with the cvar(name) or
|
||||
cvar_set (name, value) internal functions:
|
||||
teamplay = cvar("teamplay");
|
||||
cvar_set ("registered", "1");
|
||||
|
||||
The user can access cvars from the console in two ways:
|
||||
r_draworder prints the current value
|
||||
r_draworder 0 sets the current value to 0
|
||||
Cvars are restricted from having the same names as commands to keep this
|
||||
interface from being ambiguous.
|
||||
*/
|
||||
|
||||
typedef struct cvar_s
|
||||
{
|
||||
char *name;
|
||||
char *string;
|
||||
qboolean archive; // set to true to cause it to be saved to vars.rc
|
||||
qboolean server; // notifies players when changed
|
||||
float value;
|
||||
struct cvar_s *next;
|
||||
} cvar_t;
|
||||
|
||||
void Cvar_RegisterVariable (cvar_t *variable);
|
||||
// registers a cvar that allready has the name, string, and optionally the
|
||||
// archive elements set.
|
||||
|
||||
void Cvar_Set (char *var_name, char *value);
|
||||
// equivelant to "<name> <variable>" typed at the console
|
||||
|
||||
void Cvar_SetValue (char *var_name, float value);
|
||||
// expands value to a string and calls Cvar_Set
|
||||
|
||||
float Cvar_VariableValue (char *var_name);
|
||||
// returns 0 if not defined or non numeric
|
||||
|
||||
char *Cvar_VariableString (char *var_name);
|
||||
// returns an empty string if not defined
|
||||
|
||||
char *Cvar_CompleteVariable (char *partial);
|
||||
// attempts to match a partial variable name for command line completion
|
||||
// returns NULL if nothing fits
|
||||
|
||||
qboolean Cvar_Command (void);
|
||||
// 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)
|
||||
|
||||
void Cvar_WriteVariables (FILE *f);
|
||||
// Writes lines containing "set variable value" for all variables
|
||||
// with the archive flag set to true.
|
||||
|
||||
cvar_t *Cvar_FindVar (char *var_name);
|
||||
|
||||
extern cvar_t *cvar_vars;
|
||||
229
include/d_iface.h
Normal file
229
include/d_iface.h
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// d_iface.h: interface header file for rasterization driver modules
|
||||
|
||||
#define WARP_WIDTH 320
|
||||
#define WARP_HEIGHT 200
|
||||
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float u, v;
|
||||
float s, t;
|
||||
float zi;
|
||||
} emitpoint_t;
|
||||
|
||||
typedef enum {
|
||||
pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2
|
||||
} ptype_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct particle_s
|
||||
{
|
||||
// driver-usable fields
|
||||
vec3_t org;
|
||||
float color;
|
||||
// drivers never touch the following fields
|
||||
struct particle_s *next;
|
||||
vec3_t vel;
|
||||
float ramp;
|
||||
float die;
|
||||
ptype_t type;
|
||||
} particle_t;
|
||||
|
||||
#define PARTICLE_Z_CLIP 8.0
|
||||
|
||||
typedef struct polyvert_s {
|
||||
float u, v, zi, s, t;
|
||||
} polyvert_t;
|
||||
|
||||
typedef struct polydesc_s {
|
||||
int numverts;
|
||||
float nearzi;
|
||||
msurface_t *pcurrentface;
|
||||
polyvert_t *pverts;
|
||||
} polydesc_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct finalvert_s {
|
||||
int v[6]; // u, v, s, t, l, 1/z
|
||||
int flags;
|
||||
float reserved;
|
||||
} finalvert_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
void *pskin;
|
||||
maliasskindesc_t *pskindesc;
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
mtriangle_t *ptriangles;
|
||||
finalvert_t *pfinalverts;
|
||||
int numtriangles;
|
||||
int drawtype;
|
||||
int seamfixupX16;
|
||||
} affinetridesc_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct {
|
||||
float u, v, zi, color;
|
||||
} screenpart_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nump;
|
||||
emitpoint_t *pverts; // there's room for an extra element at [nump],
|
||||
// if the driver wants to duplicate element [0] at
|
||||
// element [nump] to avoid dealing with wrapping
|
||||
mspriteframe_t *pspriteframe;
|
||||
vec3_t vup, vright, vpn; // in worldspace
|
||||
float nearzi;
|
||||
} spritedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int u, v;
|
||||
float zi;
|
||||
int color;
|
||||
} zpointdesc_t;
|
||||
|
||||
extern cvar_t r_drawflat;
|
||||
extern int d_spanpixcount;
|
||||
extern int r_framecount; // sequence # of current frame since Quake
|
||||
// started
|
||||
extern qboolean r_drawpolys; // 1 if driver wants clipped polygons
|
||||
// rather than a span list
|
||||
extern qboolean r_drawculledpolys; // 1 if driver wants clipped polygons that
|
||||
// have been culled by the edge list
|
||||
extern qboolean r_worldpolysbacktofront; // 1 if driver wants polygons
|
||||
// delivered back to front rather
|
||||
// than front to back
|
||||
extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use
|
||||
// recursive triangular subdivison
|
||||
// and vertex drawing via
|
||||
// D_PolysetDrawFinalVerts() past
|
||||
// a certain distance (normally
|
||||
// only used by the software
|
||||
// driver)
|
||||
extern float r_aliasuvscale; // scale-up factor for screen u and v
|
||||
// on Alias vertices passed to driver
|
||||
extern int r_pixbytes;
|
||||
extern qboolean r_dowarp;
|
||||
|
||||
extern affinetridesc_t r_affinetridesc;
|
||||
extern spritedesc_t r_spritedesc;
|
||||
extern zpointdesc_t r_zpointdesc;
|
||||
extern polydesc_t r_polydesc;
|
||||
|
||||
extern int d_con_indirect; // if 0, Quake will draw console directly
|
||||
// to vid.buffer; if 1, Quake will
|
||||
// draw console via D_DrawRect. Must be
|
||||
// defined by driver
|
||||
|
||||
extern vec3_t r_pright, r_pup, r_ppn;
|
||||
|
||||
|
||||
void D_Aff8Patch (void *pcolormap);
|
||||
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height);
|
||||
void D_DisableBackBufferAccess (void);
|
||||
void D_EndDirectRect (int x, int y, int width, int height);
|
||||
void D_PolysetDraw (void);
|
||||
void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts);
|
||||
void D_DrawParticle (particle_t *pparticle);
|
||||
void D_DrawPoly (void);
|
||||
void D_DrawSprite (void);
|
||||
void D_DrawSurfaces (void);
|
||||
void D_DrawZPoint (void);
|
||||
void D_EnableBackBufferAccess (void);
|
||||
void D_EndParticles (void);
|
||||
void D_Init (void);
|
||||
void D_ViewChanged (void);
|
||||
void D_SetupFrame (void);
|
||||
void D_StartParticles (void);
|
||||
void D_TurnZOn (void);
|
||||
void D_WarpScreen (void);
|
||||
|
||||
void D_FillRect (vrect_t *vrect, int color);
|
||||
void D_DrawRect (void);
|
||||
void D_UpdateRects (vrect_t *prect);
|
||||
|
||||
// currently for internal use only, and should be a do-nothing function in
|
||||
// hardware drivers
|
||||
// FIXME: this should go away
|
||||
void D_PolysetUpdateTables (void);
|
||||
|
||||
// these are currently for internal use only, and should not be used by drivers
|
||||
extern int r_skydirect;
|
||||
extern byte *r_skysource;
|
||||
|
||||
// transparency types for D_DrawRect ()
|
||||
#define DR_SOLID 0
|
||||
#define DR_TRANSPARENT 1
|
||||
|
||||
// !!! must be kept the same as in quakeasm.h !!!
|
||||
#define TRANSPARENT_COLOR 0xFF
|
||||
|
||||
extern void *acolormap; // FIXME: should go away
|
||||
|
||||
//=======================================================================//
|
||||
|
||||
// callbacks to Quake
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixel_t *surfdat; // destination for generated surface
|
||||
int rowbytes; // destination logical width in bytes
|
||||
msurface_t *surf; // description for surface to generate
|
||||
fixed8_t lightadj[MAXLIGHTMAPS];
|
||||
// adjust for lightmap levels for dynamic lighting
|
||||
texture_t *texture; // corrected for animating textures
|
||||
int surfmip; // mipmapped ratio of surface texels / world pixels
|
||||
int surfwidth; // in mipmapped texels
|
||||
int surfheight; // in mipmapped texels
|
||||
} drawsurf_t;
|
||||
|
||||
extern drawsurf_t r_drawsurf;
|
||||
|
||||
void R_DrawSurface (void);
|
||||
void R_GenTile (msurface_t *psurf, void *pdest);
|
||||
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
#define TURB_TEX_SIZE 64 // base turbulent texture size
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
#define CYCLE 128 // turbulent cycle size
|
||||
|
||||
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
|
||||
|
||||
#define SKYSHIFT 7
|
||||
#define SKYSIZE (1 << SKYSHIFT)
|
||||
#define SKYMASK (SKYSIZE - 1)
|
||||
|
||||
extern float skyspeed, skyspeed2;
|
||||
extern float skytime;
|
||||
|
||||
extern int c_surf;
|
||||
extern vrect_t scr_vrect;
|
||||
|
||||
extern byte *r_warpbuffer;
|
||||
|
||||
98
include/d_ifacea.h
Normal file
98
include/d_ifacea.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
//
|
||||
// d_ifacea.h
|
||||
//
|
||||
// Include file for asm driver interface.
|
||||
//
|
||||
|
||||
//
|
||||
// !!! note that this file must match the corresponding C structures in
|
||||
// d_iface.h at all times !!!
|
||||
//
|
||||
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
#define ALIAS_ONSEAM 0x0020
|
||||
|
||||
// !!! if this is changed, it must be changed in d_iface.h too !!!
|
||||
#define TURB_TEX_SIZE 64 // base turbulent texture size
|
||||
|
||||
// !!! if this is changed, it must be changed in d_iface.h too !!!
|
||||
#define CYCLE 128
|
||||
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
#define MAXHEIGHT 1024
|
||||
|
||||
// !!! if this is changed, it must be changed in quakedef.h too !!!
|
||||
#define CACHE_SIZE 32 // used to align key data structures
|
||||
|
||||
// particle_t structure
|
||||
// !!! if this is changed, it must be changed in d_iface.h too !!!
|
||||
// driver-usable fields
|
||||
#define pt_org 0
|
||||
#define pt_color 12
|
||||
// drivers never touch the following fields
|
||||
#define pt_next 16
|
||||
#define pt_vel 20
|
||||
#define pt_ramp 32
|
||||
#define pt_die 36
|
||||
#define pt_type 40
|
||||
#define pt_size 44
|
||||
|
||||
#define PARTICLE_Z_CLIP 8.0
|
||||
|
||||
// finalvert_t structure
|
||||
// !!! if this is changed, it must be changed in d_iface.h too !!!
|
||||
#define fv_v 0 // !!! if this is moved, cases where the !!!
|
||||
// !!! address of this field is pushed in !!!
|
||||
// !!! d_polysa.s must be changed !!!
|
||||
#define fv_flags 24
|
||||
#define fv_reserved 28
|
||||
#define fv_size 32
|
||||
#define fv_shift 5
|
||||
|
||||
|
||||
// stvert_t structure
|
||||
// !!! if this is changed, it must be changed in modelgen.h too !!!
|
||||
#define stv_onseam 0
|
||||
#define stv_s 4
|
||||
#define stv_t 8
|
||||
#define stv_size 12
|
||||
|
||||
|
||||
// trivertx_t structure
|
||||
// !!! if this is changed, it must be changed in modelgen.h too !!!
|
||||
#define tv_v 0
|
||||
#define tv_lightnormalindex 3
|
||||
#define tv_size 4
|
||||
|
||||
// affinetridesc_t structure
|
||||
// !!! if this is changed, it must be changed in d_iface.h too !!!
|
||||
#define atd_pskin 0
|
||||
#define atd_pskindesc 4
|
||||
#define atd_skinwidth 8
|
||||
#define atd_skinheight 12
|
||||
#define atd_ptriangles 16
|
||||
#define atd_pfinalverts 20
|
||||
#define atd_numtriangles 24
|
||||
#define atd_drawtype 28
|
||||
#define atd_seamfixupX16 32
|
||||
#define atd_size 36
|
||||
|
||||
111
include/d_local.h
Normal file
111
include/d_local.h
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// d_local.h: private rasterization driver defs
|
||||
|
||||
#include "r_shared.h"
|
||||
|
||||
//
|
||||
// TODO: fine-tune this; it's based on providing some overage even if there
|
||||
// is a 2k-wide scan, with subdivision every 8, for 256 spans of 12 bytes each
|
||||
//
|
||||
#define SCANBUFFERPAD 0x1000
|
||||
|
||||
#define R_SKY_SMASK 0x007F0000
|
||||
#define R_SKY_TMASK 0x007F0000
|
||||
|
||||
#define DS_SPAN_LIST_END -128
|
||||
|
||||
#define SURFCACHE_SIZE_AT_320X200 600*1024
|
||||
|
||||
typedef struct surfcache_s
|
||||
{
|
||||
struct surfcache_s *next;
|
||||
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
||||
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
||||
int dlight;
|
||||
int size; // including header
|
||||
unsigned width;
|
||||
unsigned height; // DEBUG only needed for debug
|
||||
float mipscale;
|
||||
struct texture_s *texture; // checked for animating textures
|
||||
byte data[4]; // width*height elements
|
||||
} surfcache_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct sspan_s
|
||||
{
|
||||
int u, v, count;
|
||||
} sspan_t;
|
||||
|
||||
extern cvar_t d_subdiv16;
|
||||
|
||||
extern float scale_for_mip;
|
||||
|
||||
extern qboolean d_roverwrapped;
|
||||
extern surfcache_t *sc_rover;
|
||||
extern surfcache_t *d_initial_rover;
|
||||
|
||||
extern float d_sdivzstepu, d_tdivzstepu, d_zistepu;
|
||||
extern float d_sdivzstepv, d_tdivzstepv, d_zistepv;
|
||||
extern float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
|
||||
|
||||
fixed16_t sadjust, tadjust;
|
||||
fixed16_t bbextents, bbextentt;
|
||||
|
||||
|
||||
void D_DrawSpans8 (espan_t *pspans);
|
||||
void D_DrawSpans16 (espan_t *pspans);
|
||||
void D_DrawZSpans (espan_t *pspans);
|
||||
void Turbulent8 (espan_t *pspan);
|
||||
void D_SpriteDrawSpans (sspan_t *pspan);
|
||||
|
||||
void D_DrawSkyScans8 (espan_t *pspan);
|
||||
void D_DrawSkyScans16 (espan_t *pspan);
|
||||
|
||||
void R_ShowSubDiv (void);
|
||||
void (*prealspandrawer)(void);
|
||||
surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel);
|
||||
|
||||
extern int D_MipLevelForScale (float scale);
|
||||
|
||||
#if id386
|
||||
extern void D_PolysetAff8Start (void);
|
||||
extern void D_PolysetAff8End (void);
|
||||
#endif
|
||||
|
||||
extern short *d_pzbuffer;
|
||||
extern unsigned int d_zrowbytes, d_zwidth;
|
||||
|
||||
extern int *d_pscantable;
|
||||
extern int d_scantable[MAXHEIGHT];
|
||||
|
||||
extern int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
||||
|
||||
extern int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift;
|
||||
|
||||
extern pixel_t *d_viewbuffer;
|
||||
|
||||
extern short *zspantable[MAXHEIGHT];
|
||||
|
||||
extern int d_minmip;
|
||||
extern float d_scalemip[3];
|
||||
|
||||
extern void (*d_drawspans) (espan_t *pspan);
|
||||
|
||||
100
include/dosisms.h
Normal file
100
include/dosisms.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// dosisms.h: I'd call it dos.h, but the name's taken
|
||||
//
|
||||
|
||||
#ifndef _DOSISMS_H_
|
||||
#define _DOSISMS_H_
|
||||
|
||||
int dos_lockmem(void *addr, int size);
|
||||
int dos_unlockmem(void *addr, int size);
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
unsigned long edi;
|
||||
unsigned long esi;
|
||||
unsigned long ebp;
|
||||
unsigned long res;
|
||||
unsigned long ebx;
|
||||
unsigned long edx;
|
||||
unsigned long ecx;
|
||||
unsigned long eax;
|
||||
} d;
|
||||
struct {
|
||||
unsigned short di, di_hi;
|
||||
unsigned short si, si_hi;
|
||||
unsigned short bp, bp_hi;
|
||||
unsigned short res, res_hi;
|
||||
unsigned short bx, bx_hi;
|
||||
unsigned short dx, dx_hi;
|
||||
unsigned short cx, cx_hi;
|
||||
unsigned short ax, ax_hi;
|
||||
unsigned short flags;
|
||||
unsigned short es;
|
||||
unsigned short ds;
|
||||
unsigned short fs;
|
||||
unsigned short gs;
|
||||
unsigned short ip;
|
||||
unsigned short cs;
|
||||
unsigned short sp;
|
||||
unsigned short ss;
|
||||
} x;
|
||||
struct {
|
||||
unsigned char edi[4];
|
||||
unsigned char esi[4];
|
||||
unsigned char ebp[4];
|
||||
unsigned char res[4];
|
||||
unsigned char bl, bh, ebx_b2, ebx_b3;
|
||||
unsigned char dl, dh, edx_b2, edx_b3;
|
||||
unsigned char cl, ch, ecx_b2, ecx_b3;
|
||||
unsigned char al, ah, eax_b2, eax_b3;
|
||||
} h;
|
||||
} regs_t;
|
||||
|
||||
unsigned int ptr2real(void *ptr);
|
||||
void *real2ptr(unsigned int real);
|
||||
void *far2ptr(unsigned int farptr);
|
||||
unsigned int ptr2far(void *ptr);
|
||||
|
||||
int dos_inportb(int port);
|
||||
int dos_inportw(int port);
|
||||
void dos_outportb(int port, int val);
|
||||
void dos_outportw(int port, int val);
|
||||
|
||||
void dos_irqenable(void);
|
||||
void dos_irqdisable(void);
|
||||
void dos_registerintr(int intr, void (*handler)(void));
|
||||
void dos_restoreintr(int intr);
|
||||
|
||||
int dos_int86(int vec);
|
||||
|
||||
void *dos_getmemory(int size);
|
||||
void dos_freememory(void *ptr);
|
||||
|
||||
void dos_usleep(int usecs);
|
||||
|
||||
int dos_getheapsize(void);
|
||||
|
||||
extern regs_t regs;
|
||||
|
||||
#endif // _DOSISMS_H_
|
||||
|
||||
40
include/draw.h
Normal file
40
include/draw.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
// 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_Character (int x, int y, int num);
|
||||
void Draw_DebugChar (char num);
|
||||
void Draw_Pic (int x, int y, qpic_t *pic);
|
||||
void Draw_TransPic (int x, int y, qpic_t *pic);
|
||||
void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation);
|
||||
void Draw_ConsoleBackground (int lines);
|
||||
void Draw_BeginDisc (void);
|
||||
void Draw_EndDisc (void);
|
||||
void Draw_TileClear (int x, int y, int w, int h);
|
||||
void Draw_Fill (int x, int y, int w, int h, int c);
|
||||
void Draw_FadeScreen (void);
|
||||
void Draw_String (int x, int y, char *str);
|
||||
qpic_t *Draw_PicFromWad (char *name);
|
||||
qpic_t *Draw_CachePic (char *path);
|
||||
430
include/gl_model.h
Normal file
430
include/gl_model.h
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MODEL__
|
||||
#define __MODEL__
|
||||
|
||||
#include "modelgen.h"
|
||||
#include "spritegn.h"
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
// entity effects
|
||||
|
||||
#define EF_BRIGHTFIELD 1
|
||||
#define EF_MUZZLEFLASH 2
|
||||
#define EF_BRIGHTLIGHT 4
|
||||
#define EF_DIMLIGHT 8
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_ON 2
|
||||
|
||||
|
||||
// plane_t structure
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct mplane_s
|
||||
{
|
||||
vec3_t normal;
|
||||
float dist;
|
||||
byte type; // for texture axis selection and fast side tests
|
||||
byte signbits; // signx + signy<<1 + signz<<1
|
||||
byte pad[2];
|
||||
} mplane_t;
|
||||
|
||||
typedef struct texture_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
int gl_texturenum;
|
||||
struct msurface_s *texturechain; // for gl_texsort drawing
|
||||
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
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
} texture_t;
|
||||
|
||||
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWSPRITE 8
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWTILED 0x20
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
#define SURF_UNDERWATER 0x80
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float vecs[2][4];
|
||||
float mipadjust;
|
||||
texture_t *texture;
|
||||
int flags;
|
||||
} mtexinfo_t;
|
||||
|
||||
#define VERTEXSIZE 7
|
||||
|
||||
typedef struct glpoly_s
|
||||
{
|
||||
struct glpoly_s *next;
|
||||
struct glpoly_s *chain;
|
||||
int numverts;
|
||||
int flags; // for SURF_UNDERWATER
|
||||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
||||
} glpoly_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
mplane_t *plane;
|
||||
int flags;
|
||||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
short texturemins[2];
|
||||
short extents[2];
|
||||
|
||||
int light_s, light_t; // gl lightmap coordinates
|
||||
|
||||
glpoly_t *polys; // multiple if warped
|
||||
struct msurface_s *texturechain;
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
// lighting info
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
||||
int lightmaptexturenum;
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
||||
qboolean cached_dlight; // true if dynamic light in cache
|
||||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
// common with leaf
|
||||
int contents; // 0, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
mplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// leaf specific
|
||||
byte *compressed_vis;
|
||||
efrag_t *efrags;
|
||||
|
||||
msurface_t **firstmarksurface;
|
||||
int nummarksurfaces;
|
||||
int key; // BSP sequence number for leaf's contents
|
||||
byte ambient_sound_level[NUM_AMBIENTS];
|
||||
} mleaf_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
dclipnode_t *clipnodes;
|
||||
mplane_t *planes;
|
||||
int firstclipnode;
|
||||
int lastclipnode;
|
||||
vec3_t clip_mins;
|
||||
vec3_t clip_maxs;
|
||||
} hull_t;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SPRITE MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
// FIXME: shorten these?
|
||||
typedef struct mspriteframe_s
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
float up, down, left, right;
|
||||
int gl_texturenum;
|
||||
} mspriteframe_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
float *intervals;
|
||||
mspriteframe_t *frames[1];
|
||||
} mspritegroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
spriteframetype_t type;
|
||||
mspriteframe_t *frameptr;
|
||||
} mspriteframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
int maxwidth;
|
||||
int maxheight;
|
||||
int numframes;
|
||||
float beamlength; // remove?
|
||||
void *cachespot; // remove?
|
||||
mspriteframedesc_t frames[1];
|
||||
} msprite_t;
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
Alias models are position independent, so the cache manager can move them.
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstpose;
|
||||
int numposes;
|
||||
float interval;
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
char name[16];
|
||||
} maliasframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
} maliasgroupframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
int intervals;
|
||||
maliasgroupframedesc_t frames[1];
|
||||
} maliasgroup_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct mtriangle_s {
|
||||
int facesfront;
|
||||
int vertindex[3];
|
||||
} mtriangle_t;
|
||||
|
||||
|
||||
#define MAX_SKINS 32
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
vec3_t scale;
|
||||
vec3_t scale_origin;
|
||||
float boundingradius;
|
||||
vec3_t eyeposition;
|
||||
int numskins;
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int numverts;
|
||||
int numtris;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
int flags;
|
||||
float size;
|
||||
|
||||
int numposes;
|
||||
int poseverts;
|
||||
int posedata; // numposes*poseverts trivert_t
|
||||
int commands; // gl command list with embedded s/t
|
||||
int gl_texturenum[MAX_SKINS][4];
|
||||
int texels[MAX_SKINS]; // only for player skins
|
||||
maliasframedesc_t frames[1]; // variable sized
|
||||
} aliashdr_t;
|
||||
|
||||
#define MAXALIASVERTS 1024
|
||||
#define MAXALIASFRAMES 256
|
||||
#define MAXALIASTRIS 2048
|
||||
extern aliashdr_t *pheader;
|
||||
extern stvert_t stverts[MAXALIASVERTS];
|
||||
extern mtriangle_t triangles[MAXALIASTRIS];
|
||||
extern trivertx_t *poseverts[MAXALIASFRAMES];
|
||||
|
||||
//===================================================================
|
||||
|
||||
//
|
||||
// Whole model
|
||||
//
|
||||
|
||||
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||
|
||||
#define EF_ROCKET 1 // leave a trail
|
||||
#define EF_GRENADE 2 // leave a trail
|
||||
#define EF_GIB 4 // leave a trail
|
||||
#define EF_ROTATE 8 // rotate (bonus items)
|
||||
#define EF_TRACER 16 // green split trail
|
||||
#define EF_ZOMGIB 32 // small blood trail
|
||||
#define EF_TRACER2 64 // orange split trail + rotate
|
||||
#define EF_TRACER3 128 // purple trail
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
qboolean needload; // bmodels and sprites don't cache normally
|
||||
|
||||
modtype_t type;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model graphics
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// solid volume for clipping
|
||||
//
|
||||
qboolean clipbox;
|
||||
vec3_t clipmins, clipmaxs;
|
||||
|
||||
//
|
||||
// brush model
|
||||
//
|
||||
int firstmodelsurface, nummodelsurfaces;
|
||||
|
||||
int numsubmodels;
|
||||
dmodel_t *submodels;
|
||||
|
||||
int numplanes;
|
||||
mplane_t *planes;
|
||||
|
||||
int numleafs; // number of visible leafs, not counting 0
|
||||
mleaf_t *leafs;
|
||||
|
||||
int numvertexes;
|
||||
mvertex_t *vertexes;
|
||||
|
||||
int numedges;
|
||||
medge_t *edges;
|
||||
|
||||
int numnodes;
|
||||
mnode_t *nodes;
|
||||
|
||||
int numtexinfo;
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
int numsurfaces;
|
||||
msurface_t *surfaces;
|
||||
|
||||
int numsurfedges;
|
||||
int *surfedges;
|
||||
|
||||
int numclipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
||||
hull_t hulls[MAX_MAP_HULLS];
|
||||
|
||||
int numtextures;
|
||||
texture_t **textures;
|
||||
|
||||
byte *visdata;
|
||||
byte *lightdata;
|
||||
char *entities;
|
||||
|
||||
//
|
||||
// additional model data
|
||||
//
|
||||
cache_user_t cache; // only access through Mod_Extradata
|
||||
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_Init (void);
|
||||
void Mod_ClearAll (void);
|
||||
model_t *Mod_ForName (char *name, qboolean crash);
|
||||
void *Mod_Extradata (model_t *mod); // handles caching
|
||||
void Mod_TouchModel (char *name);
|
||||
|
||||
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
|
||||
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
|
||||
|
||||
#endif // __MODEL__
|
||||
51
include/gl_warp_sin.h
Normal file
51
include/gl_warp_sin.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
0, 0.19633, 0.392541, 0.588517, 0.784137, 0.979285, 1.17384, 1.3677,
|
||||
1.56072, 1.75281, 1.94384, 2.1337, 2.32228, 2.50945, 2.69512, 2.87916,
|
||||
3.06147, 3.24193, 3.42044, 3.59689, 3.77117, 3.94319, 4.11282, 4.27998,
|
||||
4.44456, 4.60647, 4.76559, 4.92185, 5.07515, 5.22538, 5.37247, 5.51632,
|
||||
5.65685, 5.79398, 5.92761, 6.05767, 6.18408, 6.30677, 6.42566, 6.54068,
|
||||
6.65176, 6.75883, 6.86183, 6.9607, 7.05537, 7.14579, 7.23191, 7.31368,
|
||||
7.39104, 7.46394, 7.53235, 7.59623, 7.65552, 7.71021, 7.76025, 7.80562,
|
||||
7.84628, 7.88222, 7.91341, 7.93984, 7.96148, 7.97832, 7.99036, 7.99759,
|
||||
8, 7.99759, 7.99036, 7.97832, 7.96148, 7.93984, 7.91341, 7.88222,
|
||||
7.84628, 7.80562, 7.76025, 7.71021, 7.65552, 7.59623, 7.53235, 7.46394,
|
||||
7.39104, 7.31368, 7.23191, 7.14579, 7.05537, 6.9607, 6.86183, 6.75883,
|
||||
6.65176, 6.54068, 6.42566, 6.30677, 6.18408, 6.05767, 5.92761, 5.79398,
|
||||
5.65685, 5.51632, 5.37247, 5.22538, 5.07515, 4.92185, 4.76559, 4.60647,
|
||||
4.44456, 4.27998, 4.11282, 3.94319, 3.77117, 3.59689, 3.42044, 3.24193,
|
||||
3.06147, 2.87916, 2.69512, 2.50945, 2.32228, 2.1337, 1.94384, 1.75281,
|
||||
1.56072, 1.3677, 1.17384, 0.979285, 0.784137, 0.588517, 0.392541, 0.19633,
|
||||
9.79717e-16, -0.19633, -0.392541, -0.588517, -0.784137, -0.979285, -1.17384, -1.3677,
|
||||
-1.56072, -1.75281, -1.94384, -2.1337, -2.32228, -2.50945, -2.69512, -2.87916,
|
||||
-3.06147, -3.24193, -3.42044, -3.59689, -3.77117, -3.94319, -4.11282, -4.27998,
|
||||
-4.44456, -4.60647, -4.76559, -4.92185, -5.07515, -5.22538, -5.37247, -5.51632,
|
||||
-5.65685, -5.79398, -5.92761, -6.05767, -6.18408, -6.30677, -6.42566, -6.54068,
|
||||
-6.65176, -6.75883, -6.86183, -6.9607, -7.05537, -7.14579, -7.23191, -7.31368,
|
||||
-7.39104, -7.46394, -7.53235, -7.59623, -7.65552, -7.71021, -7.76025, -7.80562,
|
||||
-7.84628, -7.88222, -7.91341, -7.93984, -7.96148, -7.97832, -7.99036, -7.99759,
|
||||
-8, -7.99759, -7.99036, -7.97832, -7.96148, -7.93984, -7.91341, -7.88222,
|
||||
-7.84628, -7.80562, -7.76025, -7.71021, -7.65552, -7.59623, -7.53235, -7.46394,
|
||||
-7.39104, -7.31368, -7.23191, -7.14579, -7.05537, -6.9607, -6.86183, -6.75883,
|
||||
-6.65176, -6.54068, -6.42566, -6.30677, -6.18408, -6.05767, -5.92761, -5.79398,
|
||||
-5.65685, -5.51632, -5.37247, -5.22538, -5.07515, -4.92185, -4.76559, -4.60647,
|
||||
-4.44456, -4.27998, -4.11282, -3.94319, -3.77117, -3.59689, -3.42044, -3.24193,
|
||||
-3.06147, -2.87916, -2.69512, -2.50945, -2.32228, -2.1337, -1.94384, -1.75281,
|
||||
-1.56072, -1.3677, -1.17384, -0.979285, -0.784137, -0.588517, -0.392541, -0.19633,
|
||||
263
include/glquake.h
Normal file
263
include/glquake.h
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// disable data conversion warnings
|
||||
|
||||
#if 0
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
#pragma warning(disable : 4136) // X86
|
||||
#pragma warning(disable : 4051) // ALPHA
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLE__
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#else
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#endif
|
||||
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
void GL_EndRendering (void);
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
|
||||
|
||||
extern BINDTEXFUNCPTR bindTexFunc;
|
||||
extern DELTEXFUNCPTR delTexFunc;
|
||||
extern TEXSUBIMAGEPTR TexSubImage2DFunc;
|
||||
#endif
|
||||
|
||||
extern int texture_extension_number;
|
||||
extern int texture_mode;
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
float s, t;
|
||||
float r, g, b;
|
||||
} glvert_t;
|
||||
|
||||
extern glvert_t glv;
|
||||
|
||||
extern int glx, gly, glwidth, glheight;
|
||||
|
||||
#ifdef _WIN32
|
||||
extern PROC glArrayElementEXT;
|
||||
extern PROC glColorPointerEXT;
|
||||
extern PROC glTexturePointerEXT;
|
||||
extern PROC glVertexPointerEXT;
|
||||
#endif
|
||||
|
||||
// r_local.h -- private refresh defs
|
||||
|
||||
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
|
||||
// normalizing factor so player model works out to about
|
||||
// 1 pixel per triangle
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
|
||||
|
||||
#define SKYSHIFT 7
|
||||
#define SKYSIZE (1 << SKYSHIFT)
|
||||
#define SKYMASK (SKYSIZE - 1)
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
void R_TimeRefresh_f (void);
|
||||
void R_ReadPointFile_f (void);
|
||||
texture_t *R_TextureAnimation (texture_t *base);
|
||||
|
||||
typedef struct surfcache_s
|
||||
{
|
||||
struct surfcache_s *next;
|
||||
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
||||
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
||||
int dlight;
|
||||
int size; // including header
|
||||
unsigned width;
|
||||
unsigned height; // DEBUG only needed for debug
|
||||
float mipscale;
|
||||
struct texture_s *texture; // checked for animating textures
|
||||
byte data[4]; // width*height elements
|
||||
} surfcache_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixel_t *surfdat; // destination for generated surface
|
||||
int rowbytes; // destination logical width in bytes
|
||||
msurface_t *surf; // description for surface to generate
|
||||
fixed8_t lightadj[MAXLIGHTMAPS];
|
||||
// adjust for lightmap levels for dynamic lighting
|
||||
texture_t *texture; // corrected for animating textures
|
||||
int surfmip; // mipmapped ratio of surface texels / world pixels
|
||||
int surfwidth; // in mipmapped texels
|
||||
int surfheight; // in mipmapped texels
|
||||
} drawsurf_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2
|
||||
} ptype_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct particle_s
|
||||
{
|
||||
// driver-usable fields
|
||||
vec3_t org;
|
||||
float color;
|
||||
// drivers never touch the following fields
|
||||
struct particle_s *next;
|
||||
vec3_t vel;
|
||||
float ramp;
|
||||
float die;
|
||||
ptype_t type;
|
||||
} particle_t;
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
extern qboolean r_cache_thrash; // compatability
|
||||
extern vec3_t modelorg, r_entorigin;
|
||||
extern entity_t *currententity;
|
||||
extern int r_visframecount; // ??? what difs?
|
||||
extern int r_framecount;
|
||||
extern mplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_refdef;
|
||||
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
extern texture_t *r_notexture_mip;
|
||||
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||
|
||||
extern qboolean envmap;
|
||||
extern int currenttexture;
|
||||
extern int cnttextures[2];
|
||||
extern int particletexture;
|
||||
extern int playertextures;
|
||||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t r_norefresh;
|
||||
extern cvar_t r_drawentities;
|
||||
extern cvar_t r_drawworld;
|
||||
extern cvar_t r_drawviewmodel;
|
||||
extern cvar_t r_speeds;
|
||||
extern cvar_t r_waterwarp;
|
||||
extern cvar_t r_fullbright;
|
||||
extern cvar_t r_lightmap;
|
||||
extern cvar_t r_shadows;
|
||||
extern cvar_t r_mirroralpha;
|
||||
extern cvar_t r_wateralpha;
|
||||
extern cvar_t r_dynamic;
|
||||
extern cvar_t r_novis;
|
||||
|
||||
extern cvar_t gl_clear;
|
||||
extern cvar_t gl_cull;
|
||||
extern cvar_t gl_poly;
|
||||
extern cvar_t gl_texsort;
|
||||
extern cvar_t gl_smoothmodels;
|
||||
extern cvar_t gl_affinemodels;
|
||||
extern cvar_t gl_polyblend;
|
||||
extern cvar_t gl_keeptjunctions;
|
||||
extern cvar_t gl_reporttjunctions;
|
||||
extern cvar_t gl_flashblend;
|
||||
extern cvar_t gl_nocolors;
|
||||
extern cvar_t gl_doubleeyes;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
|
||||
extern cvar_t gl_max_size;
|
||||
extern cvar_t gl_playermip;
|
||||
|
||||
extern int mirrortexturenum; // quake texturenum, not gltexturenum
|
||||
extern qboolean mirror;
|
||||
extern mplane_t *mirror_plane;
|
||||
|
||||
extern float r_world_matrix[16];
|
||||
|
||||
extern const char *gl_vendor;
|
||||
extern const char *gl_renderer;
|
||||
extern const char *gl_version;
|
||||
extern const char *gl_extensions;
|
||||
|
||||
void R_TranslatePlayerSkin (int playernum);
|
||||
void GL_Bind (int texnum);
|
||||
|
||||
// Multitexture
|
||||
#define TEXTURE0_SGIS 0x835E
|
||||
#define TEXTURE1_SGIS 0x835F
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef APIENTRY
|
||||
#undef APIENTRY
|
||||
#endif
|
||||
#define APIENTRY /* */
|
||||
#endif
|
||||
|
||||
typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
|
||||
typedef void (APIENTRY *lpSelTexFUNC) (GLenum);
|
||||
extern lpMTexFUNC qglMTexCoord2fSGIS;
|
||||
extern lpSelTexFUNC qglSelectTextureSGIS;
|
||||
|
||||
extern qboolean gl_mtexable;
|
||||
|
||||
void GL_DisableMultitexture(void);
|
||||
void GL_EnableMultitexture(void);
|
||||
|
||||
#include <glquake_implicit.h>
|
||||
209
include/glquake2.h
Normal file
209
include/glquake2.h
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// disable data conversion warnings
|
||||
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
#pragma warning(disable : 4136) // X86
|
||||
#pragma warning(disable : 4051) // ALPHA
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
void GL_EndRendering (void);
|
||||
|
||||
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
|
||||
|
||||
extern BINDTEXFUNCPTR bindTexFunc;
|
||||
extern DELTEXFUNCPTR delTexFunc;
|
||||
extern TEXSUBIMAGEPTR TexSubImage2DFunc;
|
||||
|
||||
extern int texture_extension_number;
|
||||
extern int texture_mode;
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate);
|
||||
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, int mipmap, int alpha, int modulate);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
float s, t;
|
||||
float r, g, b;
|
||||
} glvert_t;
|
||||
|
||||
extern glvert_t glv;
|
||||
|
||||
extern int glx, gly, glwidth, glheight;
|
||||
|
||||
extern PROC glArrayElementEXT;
|
||||
extern PROC glColorPointerEXT;
|
||||
extern PROC glTexturePointerEXT;
|
||||
extern PROC glVertexPointerEXT;
|
||||
|
||||
|
||||
// r_local.h -- private refresh defs
|
||||
|
||||
#define MAXALIASVERTS 2000 // TODO: tune this
|
||||
|
||||
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
|
||||
// normalizing factor so player model works out to about
|
||||
// 1 pixel per triangle
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
|
||||
|
||||
#define SKYSHIFT 7
|
||||
#define SKYSIZE (1 << SKYSHIFT)
|
||||
#define SKYMASK (SKYSIZE - 1)
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
void R_TimeRefresh_f (void);
|
||||
void R_ReadPointFile_f (void);
|
||||
texture_t *R_TextureAnimation (texture_t *base);
|
||||
|
||||
typedef struct surfcache_s
|
||||
{
|
||||
struct surfcache_s *next;
|
||||
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
||||
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
||||
int dlight;
|
||||
int size; // including header
|
||||
unsigned width;
|
||||
unsigned height; // DEBUG only needed for debug
|
||||
float mipscale;
|
||||
struct texture_s *texture; // checked for animating textures
|
||||
byte data[4]; // width*height elements
|
||||
} surfcache_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixel_t *surfdat; // destination for generated surface
|
||||
int rowbytes; // destination logical width in bytes
|
||||
msurface_t *surf; // description for surface to generate
|
||||
fixed8_t lightadj[MAXLIGHTMAPS];
|
||||
// adjust for lightmap levels for dynamic lighting
|
||||
texture_t *texture; // corrected for animating textures
|
||||
int surfmip; // mipmapped ratio of surface texels / world pixels
|
||||
int surfwidth; // in mipmapped texels
|
||||
int surfheight; // in mipmapped texels
|
||||
} drawsurf_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2
|
||||
} ptype_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct particle_s
|
||||
{
|
||||
// driver-usable fields
|
||||
vec3_t org;
|
||||
float color;
|
||||
// drivers never touch the following fields
|
||||
struct particle_s *next;
|
||||
vec3_t vel;
|
||||
float ramp;
|
||||
float die;
|
||||
ptype_t type;
|
||||
} particle_t;
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
extern qboolean r_cache_thrash; // compatability
|
||||
extern vec3_t modelorg, r_entorigin;
|
||||
extern entity_t *currententity;
|
||||
extern int r_visframecount; // ??? what difs?
|
||||
extern int r_framecount;
|
||||
extern mplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_refdef;
|
||||
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
extern texture_t *r_notexture_mip;
|
||||
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||
|
||||
extern qboolean envmap;
|
||||
extern int currenttexture;
|
||||
extern int particletexture;
|
||||
extern int playertextures;
|
||||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t r_drawentities;
|
||||
extern cvar_t r_drawworld;
|
||||
extern cvar_t r_drawviewmodel;
|
||||
extern cvar_t r_speeds;
|
||||
extern cvar_t r_waterwarp;
|
||||
extern cvar_t r_fullbright;
|
||||
extern cvar_t r_lightmap;
|
||||
extern cvar_t r_shadows;
|
||||
extern cvar_t r_dynamic;
|
||||
|
||||
extern cvar_t gl_clear;
|
||||
extern cvar_t gl_cull;
|
||||
extern cvar_t gl_poly;
|
||||
extern cvar_t gl_texsort;
|
||||
extern cvar_t gl_smoothmodels;
|
||||
extern cvar_t gl_affinemodels;
|
||||
extern cvar_t gl_fogblend;
|
||||
extern cvar_t gl_polyblend;
|
||||
extern cvar_t gl_keeptjunctions;
|
||||
extern cvar_t gl_reporttjunctions;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
|
||||
void R_TranslatePlayerSkin (int playernum);
|
||||
void GL_Bind (int texnum);
|
||||
32
include/glquake_implicit.h
Normal file
32
include/glquake_implicit.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
qboolean VID_Is8bit(void);
|
||||
void GL_SubdivideSurface (msurface_t *fa);
|
||||
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr);
|
||||
int R_LightPoint (vec3_t p);
|
||||
void R_DrawBrushModel (entity_t *e);
|
||||
void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees );
|
||||
void R_AnimateLight (void);
|
||||
void V_CalcBlend (void);
|
||||
void R_DrawWorld (void);
|
||||
void R_RenderDlights (void);
|
||||
void R_DrawParticles (void);
|
||||
void R_DrawWaterSurfaces (void);
|
||||
void R_RenderBrushPoly (msurface_t *fa);
|
||||
void R_InitParticles (void);
|
||||
void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
void R_ClearParticles (void);
|
||||
void GL_BuildLightmaps (void);
|
||||
void EmitWaterPolys (msurface_t *fa);
|
||||
void EmitSkyPolys (msurface_t *fa);
|
||||
void EmitBothSkyLayers (msurface_t *fa);
|
||||
void R_DrawSkyChain (msurface_t *s);
|
||||
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
|
||||
void R_RotateForEntity (entity_t *e);
|
||||
void R_StoreEfrags (efrag_t **ppefrag);
|
||||
void GL_Set2D (void);
|
||||
#ifdef QUAKE2
|
||||
void PF_WaterMove (void);
|
||||
void R_DrawSkyBox (void);
|
||||
void R_ClearSkyBox (void);
|
||||
void R_LoadSkys (void);
|
||||
#endif
|
||||
34
include/input.h
Normal file
34
include/input.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// input.h -- external (non-keyboard) input devices
|
||||
|
||||
void IN_Init (void);
|
||||
|
||||
void IN_Shutdown (void);
|
||||
|
||||
void IN_Commands (void);
|
||||
// oportunity for devices to stick commands on the script buffer
|
||||
|
||||
void IN_Move (usercmd_t *cmd);
|
||||
// add additional movement on top of the keyboard move cmd
|
||||
|
||||
void IN_ClearStates (void);
|
||||
// restores all button and position states to defaults
|
||||
|
||||
133
include/keys.h
Normal file
133
include/keys.h
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// these are the key numbers that should be passed to Key_Event
|
||||
//
|
||||
#define K_TAB 9
|
||||
#define K_ENTER 13
|
||||
#define K_ESCAPE 27
|
||||
#define K_SPACE 32
|
||||
|
||||
// normal keys should be passed as lowercased ascii
|
||||
|
||||
#define K_BACKSPACE 127
|
||||
#define K_UPARROW 128
|
||||
#define K_DOWNARROW 129
|
||||
#define K_LEFTARROW 130
|
||||
#define K_RIGHTARROW 131
|
||||
|
||||
#define K_ALT 132
|
||||
#define K_CTRL 133
|
||||
#define K_SHIFT 134
|
||||
#define K_F1 135
|
||||
#define K_F2 136
|
||||
#define K_F3 137
|
||||
#define K_F4 138
|
||||
#define K_F5 139
|
||||
#define K_F6 140
|
||||
#define K_F7 141
|
||||
#define K_F8 142
|
||||
#define K_F9 143
|
||||
#define K_F10 144
|
||||
#define K_F11 145
|
||||
#define K_F12 146
|
||||
#define K_INS 147
|
||||
#define K_DEL 148
|
||||
#define K_PGDN 149
|
||||
#define K_PGUP 150
|
||||
#define K_HOME 151
|
||||
#define K_END 152
|
||||
|
||||
#define K_PAUSE 255
|
||||
|
||||
//
|
||||
// mouse buttons generate virtual keys
|
||||
//
|
||||
#define K_MOUSE1 200
|
||||
#define K_MOUSE2 201
|
||||
#define K_MOUSE3 202
|
||||
|
||||
//
|
||||
// joystick buttons
|
||||
//
|
||||
#define K_JOY1 203
|
||||
#define K_JOY2 204
|
||||
#define K_JOY3 205
|
||||
#define K_JOY4 206
|
||||
|
||||
//
|
||||
// aux keys are for multi-buttoned joysticks to generate so they can use
|
||||
// the normal binding process
|
||||
//
|
||||
#define K_AUX1 207
|
||||
#define K_AUX2 208
|
||||
#define K_AUX3 209
|
||||
#define K_AUX4 210
|
||||
#define K_AUX5 211
|
||||
#define K_AUX6 212
|
||||
#define K_AUX7 213
|
||||
#define K_AUX8 214
|
||||
#define K_AUX9 215
|
||||
#define K_AUX10 216
|
||||
#define K_AUX11 217
|
||||
#define K_AUX12 218
|
||||
#define K_AUX13 219
|
||||
#define K_AUX14 220
|
||||
#define K_AUX15 221
|
||||
#define K_AUX16 222
|
||||
#define K_AUX17 223
|
||||
#define K_AUX18 224
|
||||
#define K_AUX19 225
|
||||
#define K_AUX20 226
|
||||
#define K_AUX21 227
|
||||
#define K_AUX22 228
|
||||
#define K_AUX23 229
|
||||
#define K_AUX24 230
|
||||
#define K_AUX25 231
|
||||
#define K_AUX26 232
|
||||
#define K_AUX27 233
|
||||
#define K_AUX28 234
|
||||
#define K_AUX29 235
|
||||
#define K_AUX30 236
|
||||
#define K_AUX31 237
|
||||
#define K_AUX32 238
|
||||
|
||||
// JACK: Intellimouse(c) Mouse Wheel Support
|
||||
|
||||
#define K_MWHEELUP 239
|
||||
#define K_MWHEELDOWN 240
|
||||
|
||||
|
||||
|
||||
typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
|
||||
|
||||
extern keydest_t key_dest;
|
||||
extern char *keybindings[256];
|
||||
extern int key_repeats[256];
|
||||
extern int key_count; // incremented every key event
|
||||
extern int key_lastpress;
|
||||
|
||||
void Key_Event (int key, qboolean down);
|
||||
void Key_Init (void);
|
||||
void Key_WriteBindings (FILE *f);
|
||||
void Key_SetBinding (int keynum, char *binding);
|
||||
void Key_ClearStates (void);
|
||||
|
||||
89
include/mathlib.h
Normal file
89
include/mathlib.h
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// mathlib.h
|
||||
|
||||
typedef float vec_t;
|
||||
typedef vec_t vec3_t[3];
|
||||
typedef vec_t vec5_t[5];
|
||||
|
||||
typedef int fixed4_t;
|
||||
typedef int fixed8_t;
|
||||
typedef int fixed16_t;
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
struct mplane_s;
|
||||
|
||||
extern vec3_t vec3_origin;
|
||||
extern int nanmask;
|
||||
|
||||
#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask)
|
||||
|
||||
#define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+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];b[1]=a[1];b[2]=a[2];}
|
||||
|
||||
void VectorMA (vec3_t veca, float scale, vec3_t vecb, vec3_t vecc);
|
||||
|
||||
vec_t _DotProduct (vec3_t v1, vec3_t v2);
|
||||
void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out);
|
||||
void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out);
|
||||
void _VectorCopy (vec3_t in, vec3_t out);
|
||||
|
||||
int VectorCompare (vec3_t v1, vec3_t v2);
|
||||
vec_t Length (vec3_t v);
|
||||
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
|
||||
float VectorNormalize (vec3_t v); // returns vector length
|
||||
void VectorInverse (vec3_t v);
|
||||
void VectorScale (vec3_t in, vec_t scale, vec3_t out);
|
||||
int Q_log2(int val);
|
||||
|
||||
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
|
||||
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
|
||||
|
||||
void FloorDivMod (double numer, double denom, int *quotient,
|
||||
int *rem);
|
||||
fixed16_t Invert24To16(fixed16_t val);
|
||||
int GreatestCommonDivisor (int i1, int i2);
|
||||
|
||||
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane);
|
||||
float anglemod(float a);
|
||||
|
||||
|
||||
|
||||
#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)))
|
||||
38
include/menu.h
Normal file
38
include/menu.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// the net drivers should just set the apropriate bits in m_activenet,
|
||||
// instead of having the menu code look through their internal tables
|
||||
//
|
||||
#define MNET_IPX 1
|
||||
#define MNET_TCP 2
|
||||
|
||||
extern int m_activenet;
|
||||
|
||||
//
|
||||
// menus
|
||||
//
|
||||
void M_Init (void);
|
||||
void M_Keydown (int key);
|
||||
void M_Draw (void);
|
||||
void M_ToggleMenu_f (void);
|
||||
|
||||
|
||||
93468
include/miniaudio.h
Normal file
93468
include/miniaudio.h
Normal file
File diff suppressed because it is too large
Load diff
382
include/model.h
Normal file
382
include/model.h
Normal file
|
|
@ -0,0 +1,382 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MODEL__
|
||||
#define __MODEL__
|
||||
|
||||
#include "modelgen.h"
|
||||
#include "spritegn.h"
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_ON 2
|
||||
|
||||
|
||||
// plane_t structure
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct mplane_s
|
||||
{
|
||||
vec3_t normal;
|
||||
float dist;
|
||||
byte type; // for texture axis selection and fast side tests
|
||||
byte signbits; // signx + signy<<1 + signz<<1
|
||||
byte pad[2];
|
||||
} mplane_t;
|
||||
|
||||
typedef struct texture_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
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
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
} texture_t;
|
||||
|
||||
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWSPRITE 8
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWTILED 0x20
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float vecs[2][4];
|
||||
float mipadjust;
|
||||
texture_t *texture;
|
||||
int flags;
|
||||
} mtexinfo_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
||||
mplane_t *plane;
|
||||
int flags;
|
||||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
// surface generation data
|
||||
struct surfcache_s *cachespots[MIPLEVELS];
|
||||
|
||||
short texturemins[2];
|
||||
short extents[2];
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
// lighting info
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
// common with leaf
|
||||
int contents; // 0, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
short minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
mplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
short minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// leaf specific
|
||||
byte *compressed_vis;
|
||||
efrag_t *efrags;
|
||||
|
||||
msurface_t **firstmarksurface;
|
||||
int nummarksurfaces;
|
||||
int key; // BSP sequence number for leaf's contents
|
||||
byte ambient_sound_level[NUM_AMBIENTS];
|
||||
} mleaf_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
dclipnode_t *clipnodes;
|
||||
mplane_t *planes;
|
||||
int firstclipnode;
|
||||
int lastclipnode;
|
||||
vec3_t clip_mins;
|
||||
vec3_t clip_maxs;
|
||||
} hull_t;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SPRITE MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
// FIXME: shorten these?
|
||||
typedef struct mspriteframe_s
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
void *pcachespot; // remove?
|
||||
float up, down, left, right;
|
||||
byte pixels[4];
|
||||
} mspriteframe_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
float *intervals;
|
||||
mspriteframe_t *frames[1];
|
||||
} mspritegroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
spriteframetype_t type;
|
||||
mspriteframe_t *frameptr;
|
||||
} mspriteframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
int maxwidth;
|
||||
int maxheight;
|
||||
int numframes;
|
||||
float beamlength; // remove?
|
||||
void *cachespot; // remove?
|
||||
mspriteframedesc_t frames[1];
|
||||
} msprite_t;
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
Alias models are position independent, so the cache manager can move them.
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
aliasframetype_t type;
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
char name[16];
|
||||
} maliasframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
aliasskintype_t type;
|
||||
void *pcachespot;
|
||||
int skin;
|
||||
} maliasskindesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
} maliasgroupframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
int intervals;
|
||||
maliasgroupframedesc_t frames[1];
|
||||
} maliasgroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numskins;
|
||||
int intervals;
|
||||
maliasskindesc_t skindescs[1];
|
||||
} maliasskingroup_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct mtriangle_s {
|
||||
int facesfront;
|
||||
int vertindex[3];
|
||||
} mtriangle_t;
|
||||
|
||||
typedef struct {
|
||||
int model;
|
||||
int stverts;
|
||||
int skindesc;
|
||||
int triangles;
|
||||
maliasframedesc_t frames[1];
|
||||
} aliashdr_t;
|
||||
|
||||
//===================================================================
|
||||
|
||||
//
|
||||
// Whole model
|
||||
//
|
||||
|
||||
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||
|
||||
#define EF_ROCKET 1 // leave a trail
|
||||
#define EF_GRENADE 2 // leave a trail
|
||||
#define EF_GIB 4 // leave a trail
|
||||
#define EF_ROTATE 8 // rotate (bonus items)
|
||||
#define EF_TRACER 16 // green split trail
|
||||
#define EF_ZOMGIB 32 // small blood trail
|
||||
#define EF_TRACER2 64 // orange split trail + rotate
|
||||
#define EF_TRACER3 128 // purple trail
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
qboolean needload; // bmodels and sprites don't cache normally
|
||||
|
||||
modtype_t type;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// brush model
|
||||
//
|
||||
int firstmodelsurface, nummodelsurfaces;
|
||||
|
||||
int numsubmodels;
|
||||
dmodel_t *submodels;
|
||||
|
||||
int numplanes;
|
||||
mplane_t *planes;
|
||||
|
||||
int numleafs; // number of visible leafs, not counting 0
|
||||
mleaf_t *leafs;
|
||||
|
||||
int numvertexes;
|
||||
mvertex_t *vertexes;
|
||||
|
||||
int numedges;
|
||||
medge_t *edges;
|
||||
|
||||
int numnodes;
|
||||
mnode_t *nodes;
|
||||
|
||||
int numtexinfo;
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
int numsurfaces;
|
||||
msurface_t *surfaces;
|
||||
|
||||
int numsurfedges;
|
||||
int *surfedges;
|
||||
|
||||
int numclipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
||||
hull_t hulls[MAX_MAP_HULLS];
|
||||
|
||||
int numtextures;
|
||||
texture_t **textures;
|
||||
|
||||
byte *visdata;
|
||||
byte *lightdata;
|
||||
char *entities;
|
||||
|
||||
//
|
||||
// additional model data
|
||||
//
|
||||
cache_user_t cache; // only access through Mod_Extradata
|
||||
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_Init (void);
|
||||
void Mod_ClearAll (void);
|
||||
model_t *Mod_ForName (char *name, qboolean crash);
|
||||
void *Mod_Extradata (model_t *mod); // handles caching
|
||||
void Mod_TouchModel (char *name);
|
||||
|
||||
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
|
||||
byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
|
||||
|
||||
#endif // __MODEL__
|
||||
134
include/modelgen.h
Normal file
134
include/modelgen.h
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
//
|
||||
// modelgen.h: header file for model generation program
|
||||
//
|
||||
|
||||
// *********************************************************
|
||||
// * This file must be identical in the modelgen directory *
|
||||
// * and in the Quake directory, because it's used to *
|
||||
// * 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.h"
|
||||
#include "scriplib.h"
|
||||
#include "trilib.h"
|
||||
#include "lbmlib.h"
|
||||
#include "mathlib.h"
|
||||
|
||||
#endif
|
||||
|
||||
#define ALIAS_VERSION 6
|
||||
|
||||
#define ALIAS_ONSEAM 0x0020
|
||||
|
||||
// must match definition in spritegn.h
|
||||
#ifndef SYNCTYPE_T
|
||||
#define SYNCTYPE_T
|
||||
typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
|
||||
#endif
|
||||
|
||||
typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t;
|
||||
|
||||
typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t;
|
||||
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
vec3_t scale;
|
||||
vec3_t scale_origin;
|
||||
float boundingradius;
|
||||
vec3_t eyeposition;
|
||||
int numskins;
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int numverts;
|
||||
int numtris;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
int flags;
|
||||
float size;
|
||||
} mdl_t;
|
||||
|
||||
// TODO: could be shorts
|
||||
|
||||
typedef struct {
|
||||
int onseam;
|
||||
int s;
|
||||
int t;
|
||||
} stvert_t;
|
||||
|
||||
typedef struct dtriangle_s {
|
||||
int facesfront;
|
||||
int vertindex[3];
|
||||
} dtriangle_t;
|
||||
|
||||
#define DT_FACES_FRONT 0x0010
|
||||
|
||||
// This mirrors trivert_t in trilib.h, is present so Quake knows how to
|
||||
// load this data
|
||||
|
||||
typedef struct {
|
||||
byte v[3];
|
||||
byte lightnormalindex;
|
||||
} trivertx_t;
|
||||
|
||||
typedef struct {
|
||||
trivertx_t bboxmin; // lightnormal isn't used
|
||||
trivertx_t bboxmax; // lightnormal isn't used
|
||||
char name[16]; // frame name from grabbing
|
||||
} daliasframe_t;
|
||||
|
||||
typedef struct {
|
||||
int numframes;
|
||||
trivertx_t bboxmin; // lightnormal isn't used
|
||||
trivertx_t bboxmax; // lightnormal isn't used
|
||||
} daliasgroup_t;
|
||||
|
||||
typedef struct {
|
||||
int numskins;
|
||||
} daliasskingroup_t;
|
||||
|
||||
typedef struct {
|
||||
float interval;
|
||||
} daliasinterval_t;
|
||||
|
||||
typedef struct {
|
||||
float interval;
|
||||
} daliasskininterval_t;
|
||||
|
||||
typedef struct {
|
||||
aliasframetype_t type;
|
||||
} daliasframetype_t;
|
||||
|
||||
typedef struct {
|
||||
aliasskintype_t type;
|
||||
} daliasskintype_t;
|
||||
|
||||
#define IDPOLYHEADER (('O'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
// little-endian "IDPO"
|
||||
|
||||
797
include/mpdosock.h
Normal file
797
include/mpdosock.h
Normal file
|
|
@ -0,0 +1,797 @@
|
|||
/* WINSOCK.H--definitions to be used with the WINSOCK.DLL
|
||||
* Copyright (c) 1993-1995, Microsoft Corp. All rights reserved.
|
||||
*
|
||||
* This header file corresponds to version 1.1 of the Windows Sockets specification.
|
||||
*
|
||||
* This file includes parts which are Copyright (c) 1982-1986 Regents
|
||||
* of the University of California. All rights reserved. The
|
||||
* Berkeley Software License Agreement specifies the terms and
|
||||
* conditions for redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _WINSOCKAPI_
|
||||
#define _WINSOCKAPI_
|
||||
|
||||
#define FAR
|
||||
#define PASCAL
|
||||
|
||||
/*
|
||||
* Basic system type definitions, taken from the BSD file sys/types.h.
|
||||
*/
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
|
||||
/*
|
||||
* The new type to be used in all
|
||||
* instances which refer to sockets.
|
||||
*/
|
||||
typedef u_int SOCKET;
|
||||
|
||||
// FIXME
|
||||
#if 0
|
||||
/*
|
||||
* Select uses arrays of SOCKETs. These macros manipulate such
|
||||
* arrays. FD_SETSIZE may be defined by the user before including
|
||||
* this file, but the default here should be >= 64.
|
||||
*
|
||||
* CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE
|
||||
* INCLUDED IN WINSOCK.H EXACTLY AS SHOWN HERE.
|
||||
*/
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 64
|
||||
#endif /* FD_SETSIZE */
|
||||
|
||||
typedef struct fd_set {
|
||||
u_int fd_count; /* how many are SET? */
|
||||
SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */
|
||||
} fd_set;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#define FD_CLR(fd, set) do { \
|
||||
u_int __i; \
|
||||
for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
|
||||
if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
|
||||
while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
|
||||
((fd_set FAR *)(set))->fd_array[__i] = \
|
||||
((fd_set FAR *)(set))->fd_array[__i+1]; \
|
||||
__i++; \
|
||||
} \
|
||||
((fd_set FAR *)(set))->fd_count--; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define FD_SET(fd, set) do { \
|
||||
if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \
|
||||
((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=(fd);\
|
||||
} while(0)
|
||||
|
||||
#define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0)
|
||||
|
||||
#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set))
|
||||
|
||||
/*
|
||||
* Structure used in select() call, taken from the BSD file sys/time.h.
|
||||
*/
|
||||
struct timeval {
|
||||
long tv_sec; /* seconds */
|
||||
long tv_usec; /* and microseconds */
|
||||
};
|
||||
|
||||
/*
|
||||
* Operations on timevals.
|
||||
*
|
||||
* NB: timercmp does not work for >= or <=.
|
||||
*/
|
||||
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
#define timercmp(tvp, uvp, cmp) \
|
||||
((tvp)->tv_sec cmp (uvp)->tv_sec || \
|
||||
(tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
|
||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Commands for ioctlsocket(), taken from the BSD file fcntl.h.
|
||||
*
|
||||
*
|
||||
* Ioctl's have the command encoded in the lower word,
|
||||
* and the size of any in or out parameters in the upper
|
||||
* word. The high 2 bits of the upper word are used
|
||||
* to encode the in/out status of the parameter; for now
|
||||
* we restrict parameters to at most 128 bytes.
|
||||
*/
|
||||
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
|
||||
#define IOC_VOID 0x20000000 /* no parameters */
|
||||
#define IOC_OUT 0x40000000 /* copy out parameters */
|
||||
#define IOC_IN 0x80000000 /* copy in parameters */
|
||||
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||
/* 0x20000000 distinguishes new &
|
||||
old ioctl's */
|
||||
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
|
||||
|
||||
#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||
|
||||
#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||
|
||||
#define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */
|
||||
#define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */
|
||||
#define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */
|
||||
|
||||
/* Socket I/O Controls */
|
||||
#define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */
|
||||
#define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */
|
||||
#define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */
|
||||
#define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */
|
||||
#define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */
|
||||
|
||||
/*
|
||||
* Structures returned by network data base library, taken from the
|
||||
* BSD file netdb.h. All addresses are supplied in host order, and
|
||||
* returned in network order (suitable for use in system calls).
|
||||
*/
|
||||
|
||||
struct hostent {
|
||||
char FAR * h_name; /* official name of host */
|
||||
char FAR * FAR * h_aliases; /* alias list */
|
||||
short h_addrtype; /* host address type */
|
||||
short h_length; /* length of address */
|
||||
char FAR * FAR * h_addr_list; /* list of addresses */
|
||||
#define h_addr h_addr_list[0] /* address, for backward compat */
|
||||
};
|
||||
|
||||
/*
|
||||
* It is assumed here that a network number
|
||||
* fits in 32 bits.
|
||||
*/
|
||||
struct netent {
|
||||
char FAR * n_name; /* official name of net */
|
||||
char FAR * FAR * n_aliases; /* alias list */
|
||||
short n_addrtype; /* net address type */
|
||||
u_long n_net; /* network # */
|
||||
};
|
||||
|
||||
struct servent {
|
||||
char FAR * s_name; /* official service name */
|
||||
char FAR * FAR * s_aliases; /* alias list */
|
||||
short s_port; /* port # */
|
||||
char FAR * s_proto; /* protocol to use */
|
||||
};
|
||||
|
||||
struct protoent {
|
||||
char FAR * p_name; /* official protocol name */
|
||||
char FAR * FAR * p_aliases; /* alias list */
|
||||
short p_proto; /* protocol # */
|
||||
};
|
||||
|
||||
/*
|
||||
* Constants and structures defined by the internet system,
|
||||
* Per RFC 790, September 1981, taken from the BSD file netinet/in.h.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Protocols
|
||||
*/
|
||||
#define IPPROTO_IP 0 /* dummy for IP */
|
||||
#define IPPROTO_ICMP 1 /* control message protocol */
|
||||
#define IPPROTO_GGP 2 /* gateway^2 (deprecated) */
|
||||
#define IPPROTO_TCP 6 /* tcp */
|
||||
#define IPPROTO_PUP 12 /* pup */
|
||||
#define IPPROTO_UDP 17 /* user datagram protocol */
|
||||
#define IPPROTO_IDP 22 /* xns idp */
|
||||
#define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */
|
||||
|
||||
#define IPPROTO_RAW 255 /* raw IP packet */
|
||||
#define IPPROTO_MAX 256
|
||||
|
||||
/*
|
||||
* Port/socket numbers: network standard functions
|
||||
*/
|
||||
#define IPPORT_ECHO 7
|
||||
#define IPPORT_DISCARD 9
|
||||
#define IPPORT_SYSTAT 11
|
||||
#define IPPORT_DAYTIME 13
|
||||
#define IPPORT_NETSTAT 15
|
||||
#define IPPORT_FTP 21
|
||||
#define IPPORT_TELNET 23
|
||||
#define IPPORT_SMTP 25
|
||||
#define IPPORT_TIMESERVER 37
|
||||
#define IPPORT_NAMESERVER 42
|
||||
#define IPPORT_WHOIS 43
|
||||
#define IPPORT_MTP 57
|
||||
|
||||
/*
|
||||
* Port/socket numbers: host specific functions
|
||||
*/
|
||||
#define IPPORT_TFTP 69
|
||||
#define IPPORT_RJE 77
|
||||
#define IPPORT_FINGER 79
|
||||
#define IPPORT_TTYLINK 87
|
||||
#define IPPORT_SUPDUP 95
|
||||
|
||||
/*
|
||||
* UNIX TCP sockets
|
||||
*/
|
||||
#define IPPORT_EXECSERVER 512
|
||||
#define IPPORT_LOGINSERVER 513
|
||||
#define IPPORT_CMDSERVER 514
|
||||
#define IPPORT_EFSSERVER 520
|
||||
|
||||
/*
|
||||
* UNIX UDP sockets
|
||||
*/
|
||||
#define IPPORT_BIFFUDP 512
|
||||
#define IPPORT_WHOSERVER 513
|
||||
#define IPPORT_ROUTESERVER 520
|
||||
/* 520+1 also used */
|
||||
|
||||
/*
|
||||
* Ports < IPPORT_RESERVED are reserved for
|
||||
* privileged processes (e.g. root).
|
||||
*/
|
||||
#define IPPORT_RESERVED 1024
|
||||
|
||||
/*
|
||||
* Link numbers
|
||||
*/
|
||||
#define IMPLINK_IP 155
|
||||
#define IMPLINK_LOWEXPER 156
|
||||
#define IMPLINK_HIGHEXPER 158
|
||||
|
||||
/*
|
||||
* Internet address (old style... should be updated)
|
||||
*/
|
||||
struct in_addr {
|
||||
union {
|
||||
struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
|
||||
struct { u_short s_w1,s_w2; } S_un_w;
|
||||
u_long S_addr;
|
||||
} S_un;
|
||||
#define s_addr S_un.S_addr
|
||||
/* can be used for most tcp & ip code */
|
||||
#define s_host S_un.S_un_b.s_b2
|
||||
/* host on imp */
|
||||
#define s_net S_un.S_un_b.s_b1
|
||||
/* network */
|
||||
#define s_imp S_un.S_un_w.s_w2
|
||||
/* imp */
|
||||
#define s_impno S_un.S_un_b.s_b4
|
||||
/* imp # */
|
||||
#define s_lh S_un.S_un_b.s_b3
|
||||
/* logical host */
|
||||
};
|
||||
|
||||
/*
|
||||
* Definitions of bits in internet address integers.
|
||||
* On subnets, the decomposition of addresses to host and net parts
|
||||
* is done according to subnet mask, not the masks here.
|
||||
*/
|
||||
#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
|
||||
#define IN_CLASSA_NET 0xff000000
|
||||
#define IN_CLASSA_NSHIFT 24
|
||||
#define IN_CLASSA_HOST 0x00ffffff
|
||||
#define IN_CLASSA_MAX 128
|
||||
|
||||
#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
|
||||
#define IN_CLASSB_NET 0xffff0000
|
||||
#define IN_CLASSB_NSHIFT 16
|
||||
#define IN_CLASSB_HOST 0x0000ffff
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST 0x000000ff
|
||||
|
||||
#define INADDR_ANY (u_long)0x00000000
|
||||
#define INADDR_LOOPBACK 0x7f000001
|
||||
#define INADDR_BROADCAST (u_long)0xffffffff
|
||||
#define INADDR_NONE 0xffffffff
|
||||
|
||||
/*
|
||||
* Socket address, internet style.
|
||||
*/
|
||||
struct sockaddr_in {
|
||||
short sin_family;
|
||||
u_short sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
#define WSADESCRIPTION_LEN 256
|
||||
#define WSASYS_STATUS_LEN 128
|
||||
|
||||
|
||||
/*
|
||||
* Options for use with [gs]etsockopt at the IP level.
|
||||
*/
|
||||
#define IP_OPTIONS 1 /* set/get IP per-packet options */
|
||||
#define IP_MULTICAST_IF 2 /* set/get IP multicast interface */
|
||||
#define IP_MULTICAST_TTL 3 /* set/get IP multicast timetolive */
|
||||
#define IP_MULTICAST_LOOP 4 /* set/get IP multicast loopback */
|
||||
#define IP_ADD_MEMBERSHIP 5 /* add an IP group membership */
|
||||
#define IP_DROP_MEMBERSHIP 6 /* drop an IP group membership */
|
||||
|
||||
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
|
||||
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
|
||||
#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
|
||||
|
||||
/*
|
||||
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
|
||||
*/
|
||||
struct ip_mreq {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
/*
|
||||
* Definitions related to sockets: types, address families, options,
|
||||
* taken from the BSD file sys/socket.h.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is used instead of -1, since the
|
||||
* SOCKET type is unsigned.
|
||||
*/
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
#define SOCKET_ERROR (-1)
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
#define SOCK_STREAM 1 /* stream socket */
|
||||
#define SOCK_DGRAM 2 /* datagram socket */
|
||||
#define SOCK_RAW 3 /* raw-protocol interface */
|
||||
#define SOCK_RDM 4 /* reliably-delivered message */
|
||||
#define SOCK_SEQPACKET 5 /* sequenced packet stream */
|
||||
|
||||
/*
|
||||
* Option flags per-socket.
|
||||
*/
|
||||
#define SO_DEBUG 0x0001 /* turn on debugging info recording */
|
||||
#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
|
||||
#define SO_REUSEADDR 0x0004 /* allow local address reuse */
|
||||
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
|
||||
#define SO_DONTROUTE 0x0010 /* just use interface addresses */
|
||||
#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
|
||||
#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
|
||||
#define SO_LINGER 0x0080 /* linger on close if data present */
|
||||
#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
|
||||
|
||||
#define SO_DONTLINGER (u_int)(~SO_LINGER)
|
||||
|
||||
/*
|
||||
* Additional options.
|
||||
*/
|
||||
#define SO_SNDBUF 0x1001 /* send buffer size */
|
||||
#define SO_RCVBUF 0x1002 /* receive buffer size */
|
||||
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
|
||||
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
|
||||
#define SO_SNDTIMEO 0x1005 /* send timeout */
|
||||
#define SO_RCVTIMEO 0x1006 /* receive timeout */
|
||||
#define SO_ERROR 0x1007 /* get error status and clear */
|
||||
#define SO_TYPE 0x1008 /* get socket type */
|
||||
|
||||
/*
|
||||
* Options for connect and disconnect data and options. Used only by
|
||||
* non-TCP/IP transports such as DECNet, OSI TP4, etc.
|
||||
*/
|
||||
#define SO_CONNDATA 0x7000
|
||||
#define SO_CONNOPT 0x7001
|
||||
#define SO_DISCDATA 0x7002
|
||||
#define SO_DISCOPT 0x7003
|
||||
#define SO_CONNDATALEN 0x7004
|
||||
#define SO_CONNOPTLEN 0x7005
|
||||
#define SO_DISCDATALEN 0x7006
|
||||
#define SO_DISCOPTLEN 0x7007
|
||||
|
||||
/*
|
||||
* Option for opening sockets for synchronous access.
|
||||
*/
|
||||
#define SO_OPENTYPE 0x7008
|
||||
|
||||
#define SO_SYNCHRONOUS_ALERT 0x10
|
||||
#define SO_SYNCHRONOUS_NONALERT 0x20
|
||||
|
||||
/*
|
||||
* Other NT-specific options.
|
||||
*/
|
||||
#define SO_MAXDG 0x7009
|
||||
#define SO_MAXPATHDG 0x700A
|
||||
|
||||
/*
|
||||
* TCP options.
|
||||
*/
|
||||
#define TCP_NODELAY 0x0001
|
||||
#define TCP_BSDURGENT 0x7000
|
||||
|
||||
/*
|
||||
* Address families.
|
||||
*/
|
||||
#define AF_UNSPEC 0 /* unspecified */
|
||||
#define AF_UNIX 1 /* local to host (pipes, portals) */
|
||||
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
|
||||
#define AF_IMPLINK 3 /* arpanet imp addresses */
|
||||
#define AF_PUP 4 /* pup protocols: e.g. BSP */
|
||||
#define AF_CHAOS 5 /* mit CHAOS protocols */
|
||||
#define AF_IPX 6 /* IPX and SPX */
|
||||
#define AF_NS 6 /* XEROX NS protocols */
|
||||
#define AF_ISO 7 /* ISO protocols */
|
||||
#define AF_OSI AF_ISO /* OSI is ISO */
|
||||
#define AF_ECMA 8 /* european computer manufacturers */
|
||||
#define AF_DATAKIT 9 /* datakit protocols */
|
||||
#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
|
||||
#define AF_SNA 11 /* IBM SNA */
|
||||
#define AF_DECnet 12 /* DECnet */
|
||||
#define AF_DLI 13 /* Direct data link interface */
|
||||
#define AF_LAT 14 /* LAT */
|
||||
#define AF_HYLINK 15 /* NSC Hyperchannel */
|
||||
#define AF_APPLETALK 16 /* AppleTalk */
|
||||
#define AF_NETBIOS 17 /* NetBios-style addresses */
|
||||
#define AF_VOICEVIEW 18 /* VoiceView */
|
||||
|
||||
#define AF_MAX 19
|
||||
|
||||
/*
|
||||
* Structure used by kernel to store most
|
||||
* addresses.
|
||||
*/
|
||||
struct sockaddr {
|
||||
u_short sa_family; /* address family */
|
||||
char sa_data[14]; /* up to 14 bytes of direct address */
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure used by kernel to pass protocol
|
||||
* information in raw sockets.
|
||||
*/
|
||||
struct sockproto {
|
||||
u_short sp_family; /* address family */
|
||||
u_short sp_protocol; /* protocol */
|
||||
};
|
||||
|
||||
/*
|
||||
* Protocol families, same as address families for now.
|
||||
*/
|
||||
#define PF_UNSPEC AF_UNSPEC
|
||||
#define PF_UNIX AF_UNIX
|
||||
#define PF_INET AF_INET
|
||||
#define PF_IMPLINK AF_IMPLINK
|
||||
#define PF_PUP AF_PUP
|
||||
#define PF_CHAOS AF_CHAOS
|
||||
#define PF_NS AF_NS
|
||||
#define PF_IPX AF_IPX
|
||||
#define PF_ISO AF_ISO
|
||||
#define PF_OSI AF_OSI
|
||||
#define PF_ECMA AF_ECMA
|
||||
#define PF_DATAKIT AF_DATAKIT
|
||||
#define PF_CCITT AF_CCITT
|
||||
#define PF_SNA AF_SNA
|
||||
#define PF_DECnet AF_DECnet
|
||||
#define PF_DLI AF_DLI
|
||||
#define PF_LAT AF_LAT
|
||||
#define PF_HYLINK AF_HYLINK
|
||||
#define PF_APPLETALK AF_APPLETALK
|
||||
#define PF_VOICEVIEW AF_VOICEVIEW
|
||||
|
||||
#define PF_MAX AF_MAX
|
||||
|
||||
/*
|
||||
* Structure used for manipulating linger option.
|
||||
*/
|
||||
struct linger {
|
||||
u_short l_onoff; /* option on/off */
|
||||
u_short l_linger; /* linger time */
|
||||
};
|
||||
|
||||
/*
|
||||
* Level number for (get/set)sockopt() to apply to socket itself.
|
||||
*/
|
||||
#define SOL_SOCKET 0xffff /* options for socket level */
|
||||
|
||||
/*
|
||||
* Maximum queue length specifiable by listen.
|
||||
*/
|
||||
#define SOMAXCONN 5
|
||||
|
||||
#define MSG_OOB 0x1 /* process out-of-band data */
|
||||
#define MSG_PEEK 0x2 /* peek at incoming message */
|
||||
#define MSG_DONTROUTE 0x4 /* send without using routing tables */
|
||||
|
||||
#define MSG_MAXIOVLEN 16
|
||||
|
||||
#define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */
|
||||
|
||||
/*
|
||||
* Define constant based on rfc883, used by gethostbyxxxx() calls.
|
||||
*/
|
||||
#define MAXGETHOSTSTRUCT 1024
|
||||
|
||||
/*
|
||||
* Define flags to be used with the WSAAsyncSelect() call.
|
||||
*/
|
||||
#define FD_READ 0x01
|
||||
#define FD_WRITE 0x02
|
||||
#define FD_OOB 0x04
|
||||
#define FD_ACCEPT 0x08
|
||||
#define FD_CONNECT 0x10
|
||||
#define FD_CLOSE 0x20
|
||||
|
||||
/*
|
||||
* All Windows Sockets error constants are biased by WSABASEERR from
|
||||
* the "normal"
|
||||
*/
|
||||
#define WSABASEERR 10000
|
||||
/*
|
||||
* Windows Sockets definitions of regular Microsoft C error constants
|
||||
*/
|
||||
#define WSAEINTR (WSABASEERR+4)
|
||||
#define WSAEBADF (WSABASEERR+9)
|
||||
#define WSAEACCES (WSABASEERR+13)
|
||||
#define WSAEFAULT (WSABASEERR+14)
|
||||
#define WSAEINVAL (WSABASEERR+22)
|
||||
#define WSAEMFILE (WSABASEERR+24)
|
||||
|
||||
/*
|
||||
* Windows Sockets definitions of regular Berkeley error constants
|
||||
*/
|
||||
#define WSAEWOULDBLOCK (WSABASEERR+35)
|
||||
#define WSAEINPROGRESS (WSABASEERR+36)
|
||||
#define WSAEALREADY (WSABASEERR+37)
|
||||
#define WSAENOTSOCK (WSABASEERR+38)
|
||||
#define WSAEDESTADDRREQ (WSABASEERR+39)
|
||||
#define WSAEMSGSIZE (WSABASEERR+40)
|
||||
#define WSAEPROTOTYPE (WSABASEERR+41)
|
||||
#define WSAENOPROTOOPT (WSABASEERR+42)
|
||||
#define WSAEPROTONOSUPPORT (WSABASEERR+43)
|
||||
#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
|
||||
#define WSAEOPNOTSUPP (WSABASEERR+45)
|
||||
#define WSAEPFNOSUPPORT (WSABASEERR+46)
|
||||
#define WSAEAFNOSUPPORT (WSABASEERR+47)
|
||||
#define WSAEADDRINUSE (WSABASEERR+48)
|
||||
#define WSAEADDRNOTAVAIL (WSABASEERR+49)
|
||||
#define WSAENETDOWN (WSABASEERR+50)
|
||||
#define WSAENETUNREACH (WSABASEERR+51)
|
||||
#define WSAENETRESET (WSABASEERR+52)
|
||||
#define WSAECONNABORTED (WSABASEERR+53)
|
||||
#define WSAECONNRESET (WSABASEERR+54)
|
||||
#define WSAENOBUFS (WSABASEERR+55)
|
||||
#define WSAEISCONN (WSABASEERR+56)
|
||||
#define WSAENOTCONN (WSABASEERR+57)
|
||||
#define WSAESHUTDOWN (WSABASEERR+58)
|
||||
#define WSAETOOMANYREFS (WSABASEERR+59)
|
||||
#define WSAETIMEDOUT (WSABASEERR+60)
|
||||
#define WSAECONNREFUSED (WSABASEERR+61)
|
||||
#define WSAELOOP (WSABASEERR+62)
|
||||
#define WSAENAMETOOLONG (WSABASEERR+63)
|
||||
#define WSAEHOSTDOWN (WSABASEERR+64)
|
||||
#define WSAEHOSTUNREACH (WSABASEERR+65)
|
||||
#define WSAENOTEMPTY (WSABASEERR+66)
|
||||
#define WSAEPROCLIM (WSABASEERR+67)
|
||||
#define WSAEUSERS (WSABASEERR+68)
|
||||
#define WSAEDQUOT (WSABASEERR+69)
|
||||
#define WSAESTALE (WSABASEERR+70)
|
||||
#define WSAEREMOTE (WSABASEERR+71)
|
||||
|
||||
#define WSAEDISCON (WSABASEERR+101)
|
||||
|
||||
/*
|
||||
* Extended Windows Sockets error constant definitions
|
||||
*/
|
||||
#define WSASYSNOTREADY (WSABASEERR+91)
|
||||
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
|
||||
#define WSANOTINITIALISED (WSABASEERR+93)
|
||||
|
||||
/*
|
||||
* Error return codes from gethostbyname() and gethostbyaddr()
|
||||
* (when using the resolver). Note that these errors are
|
||||
* retrieved via WSAGetLastError() and must therefore follow
|
||||
* the rules for avoiding clashes with error numbers from
|
||||
* specific implementations or language run-time systems.
|
||||
* For this reason the codes are based at WSABASEERR+1001.
|
||||
* Note also that [WSA]NO_ADDRESS is defined only for
|
||||
* compatibility purposes.
|
||||
*/
|
||||
|
||||
#define h_errno WSAGetLastError()
|
||||
|
||||
/* Authoritative Answer: Host not found */
|
||||
#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
|
||||
#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
|
||||
|
||||
/* Non-Authoritative: Host not found, or SERVERFAIL */
|
||||
#define WSATRY_AGAIN (WSABASEERR+1002)
|
||||
#define TRY_AGAIN WSATRY_AGAIN
|
||||
|
||||
/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
|
||||
#define WSANO_RECOVERY (WSABASEERR+1003)
|
||||
#define NO_RECOVERY WSANO_RECOVERY
|
||||
|
||||
/* Valid name, no data record of requested type */
|
||||
#define WSANO_DATA (WSABASEERR+1004)
|
||||
#define NO_DATA WSANO_DATA
|
||||
|
||||
/* no address, look for MX record */
|
||||
#define WSANO_ADDRESS WSANO_DATA
|
||||
#define NO_ADDRESS WSANO_ADDRESS
|
||||
|
||||
/*
|
||||
* Windows Sockets errors redefined as regular Berkeley error constants.
|
||||
* These are commented out in Windows NT to avoid conflicts with errno.h.
|
||||
* Use the WSA constants instead.
|
||||
*/
|
||||
#if 0
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define EALREADY WSAEALREADY
|
||||
#define ENOTSOCK WSAENOTSOCK
|
||||
#define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#define EMSGSIZE WSAEMSGSIZE
|
||||
#define EPROTOTYPE WSAEPROTOTYPE
|
||||
#define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#define ENETDOWN WSAENETDOWN
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#define ENETRESET WSAENETRESET
|
||||
#define ECONNABORTED WSAECONNABORTED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define ENOBUFS WSAENOBUFS
|
||||
#define EISCONN WSAEISCONN
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define ESHUTDOWN WSAESHUTDOWN
|
||||
#define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ELOOP WSAELOOP
|
||||
#define ENAMETOOLONG WSAENAMETOOLONG
|
||||
#define EHOSTDOWN WSAEHOSTDOWN
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#define ENOTEMPTY WSAENOTEMPTY
|
||||
#define EPROCLIM WSAEPROCLIM
|
||||
#define EUSERS WSAEUSERS
|
||||
#define EDQUOT WSAEDQUOT
|
||||
#define ESTALE WSAESTALE
|
||||
#define EREMOTE WSAEREMOTE
|
||||
#endif
|
||||
|
||||
/* Socket function prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SOCKET PASCAL FAR accept (SOCKET s, struct sockaddr FAR *addr,
|
||||
int FAR *addrlen);
|
||||
|
||||
int PASCAL FAR bind (SOCKET s, const struct sockaddr FAR *addr, int namelen);
|
||||
|
||||
int PASCAL FAR closesocket (SOCKET s);
|
||||
|
||||
int PASCAL FAR connect (SOCKET s, const struct sockaddr FAR *name, int namelen);
|
||||
|
||||
int PASCAL FAR ioctlsocket (SOCKET s, long cmd, u_long FAR *argp);
|
||||
|
||||
int PASCAL FAR getpeername (SOCKET s, struct sockaddr FAR *name,
|
||||
int FAR * namelen);
|
||||
|
||||
int PASCAL FAR getsockname (SOCKET s, struct sockaddr FAR *name,
|
||||
int FAR * namelen);
|
||||
|
||||
int PASCAL FAR getsockopt (SOCKET s, int level, int optname,
|
||||
char FAR * optval, int FAR *optlen);
|
||||
|
||||
u_long PASCAL FAR htonl (u_long hostlong);
|
||||
|
||||
u_short PASCAL FAR htons (u_short hostshort);
|
||||
|
||||
unsigned long PASCAL FAR inet_addr (const char FAR * cp);
|
||||
|
||||
char FAR * PASCAL FAR inet_ntoa (struct in_addr in);
|
||||
|
||||
int PASCAL FAR listen (SOCKET s, int backlog);
|
||||
|
||||
u_long PASCAL FAR ntohl (u_long netlong);
|
||||
|
||||
u_short PASCAL FAR ntohs (u_short netshort);
|
||||
|
||||
int PASCAL FAR recv (SOCKET s, char FAR * buf, int len, int flags);
|
||||
|
||||
int PASCAL FAR recvfrom (SOCKET s, char FAR * buf, int len, int flags,
|
||||
struct sockaddr FAR *from, int FAR * fromlen);
|
||||
|
||||
#if 0
|
||||
int PASCAL FAR select (int nfds, fd_set FAR *readfds, fd_set FAR *writefds,
|
||||
fd_set FAR *exceptfds, const struct timeval FAR *timeout);
|
||||
#endif
|
||||
|
||||
int PASCAL FAR send (SOCKET s, const char FAR * buf, int len, int flags);
|
||||
|
||||
int PASCAL FAR sendto (SOCKET s, const char FAR * buf, int len, int flags,
|
||||
const struct sockaddr FAR *to, int tolen);
|
||||
|
||||
int PASCAL FAR setsockopt (SOCKET s, int level, int optname,
|
||||
const char FAR * optval, int optlen);
|
||||
|
||||
int PASCAL FAR shutdown (SOCKET s, int how);
|
||||
|
||||
SOCKET PASCAL FAR socket (int af, int type, int protocol);
|
||||
|
||||
/* Database function prototypes */
|
||||
|
||||
struct hostent FAR * PASCAL FAR gethostbyaddr(const char FAR * addr,
|
||||
int len, int type);
|
||||
|
||||
struct hostent FAR * PASCAL FAR gethostbyname(const char FAR * name);
|
||||
|
||||
int PASCAL FAR gethostname (char FAR * name, int namelen);
|
||||
|
||||
struct servent FAR * PASCAL FAR getservbyport(int port, const char FAR * proto);
|
||||
|
||||
struct servent FAR * PASCAL FAR getservbyname(const char FAR * name,
|
||||
const char FAR * proto);
|
||||
|
||||
struct protoent FAR * PASCAL FAR getprotobynumber(int proto);
|
||||
|
||||
struct protoent FAR * PASCAL FAR getprotobyname(const char FAR * name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Microsoft Windows Extended data types */
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
typedef struct sockaddr *PSOCKADDR;
|
||||
typedef struct sockaddr FAR *LPSOCKADDR;
|
||||
|
||||
typedef struct sockaddr_in SOCKADDR_IN;
|
||||
typedef struct sockaddr_in *PSOCKADDR_IN;
|
||||
typedef struct sockaddr_in FAR *LPSOCKADDR_IN;
|
||||
|
||||
typedef struct linger LINGER;
|
||||
typedef struct linger *PLINGER;
|
||||
typedef struct linger FAR *LPLINGER;
|
||||
|
||||
typedef struct in_addr IN_ADDR;
|
||||
typedef struct in_addr *PIN_ADDR;
|
||||
typedef struct in_addr FAR *LPIN_ADDR;
|
||||
|
||||
typedef struct fd_set FD_SET;
|
||||
typedef struct fd_set *PFD_SET;
|
||||
typedef struct fd_set FAR *LPFD_SET;
|
||||
|
||||
typedef struct hostent HOSTENT;
|
||||
typedef struct hostent *PHOSTENT;
|
||||
typedef struct hostent FAR *LPHOSTENT;
|
||||
|
||||
typedef struct servent SERVENT;
|
||||
typedef struct servent *PSERVENT;
|
||||
typedef struct servent FAR *LPSERVENT;
|
||||
|
||||
typedef struct protoent PROTOENT;
|
||||
typedef struct protoent *PPROTOENT;
|
||||
typedef struct protoent FAR *LPPROTOENT;
|
||||
|
||||
typedef struct timeval TIMEVAL;
|
||||
typedef struct timeval *PTIMEVAL;
|
||||
typedef struct timeval FAR *LPTIMEVAL;
|
||||
|
||||
#endif /* _WINSOCKAPI_ */
|
||||
337
include/net.h
Normal file
337
include/net.h
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net.h -- quake's interface to the networking layer
|
||||
|
||||
struct qsockaddr
|
||||
{
|
||||
short sa_family;
|
||||
unsigned char sa_data[14];
|
||||
};
|
||||
|
||||
|
||||
#define NET_NAMELEN 64
|
||||
|
||||
#define NET_MAXMESSAGE 8192
|
||||
#define NET_HEADERSIZE (2 * sizeof(unsigned int))
|
||||
#define NET_DATAGRAMSIZE (MAX_DATAGRAM + NET_HEADERSIZE)
|
||||
|
||||
// NetHeader flags
|
||||
#define NETFLAG_LENGTH_MASK 0x0000ffff
|
||||
#define NETFLAG_DATA 0x00010000
|
||||
#define NETFLAG_ACK 0x00020000
|
||||
#define NETFLAG_NAK 0x00040000
|
||||
#define NETFLAG_EOM 0x00080000
|
||||
#define NETFLAG_UNRELIABLE 0x00100000
|
||||
#define NETFLAG_CTL 0x80000000
|
||||
|
||||
|
||||
#define NET_PROTOCOL_VERSION 3
|
||||
|
||||
// This is the network info/connection protocol. It is used to find Quake
|
||||
// servers, get info about them, and connect to them. Once connected, the
|
||||
// Quake game protocol (documented elsewhere) is used.
|
||||
//
|
||||
//
|
||||
// General notes:
|
||||
// game_name is currently always "QUAKE", but is there so this same protocol
|
||||
// can be used for future games as well; can you say Quake2?
|
||||
//
|
||||
// CCREQ_CONNECT
|
||||
// string game_name "QUAKE"
|
||||
// byte net_protocol_version NET_PROTOCOL_VERSION
|
||||
//
|
||||
// CCREQ_SERVER_INFO
|
||||
// string game_name "QUAKE"
|
||||
// byte net_protocol_version NET_PROTOCOL_VERSION
|
||||
//
|
||||
// CCREQ_PLAYER_INFO
|
||||
// byte player_number
|
||||
//
|
||||
// CCREQ_RULE_INFO
|
||||
// string rule
|
||||
//
|
||||
//
|
||||
//
|
||||
// CCREP_ACCEPT
|
||||
// long port
|
||||
//
|
||||
// CCREP_REJECT
|
||||
// string reason
|
||||
//
|
||||
// CCREP_SERVER_INFO
|
||||
// string server_address
|
||||
// string host_name
|
||||
// string level_name
|
||||
// byte current_players
|
||||
// byte max_players
|
||||
// byte protocol_version NET_PROTOCOL_VERSION
|
||||
//
|
||||
// CCREP_PLAYER_INFO
|
||||
// byte player_number
|
||||
// string name
|
||||
// long colors
|
||||
// long frags
|
||||
// long connect_time
|
||||
// string address
|
||||
//
|
||||
// CCREP_RULE_INFO
|
||||
// string rule
|
||||
// string value
|
||||
|
||||
// note:
|
||||
// There are two address forms used above. The short form is just a
|
||||
// port number. The address that goes along with the port is defined as
|
||||
// "whatever address you receive this reponse from". This lets us use
|
||||
// the host OS to solve the problem of multiple host addresses (possibly
|
||||
// with no routing between them); the host will use the right address
|
||||
// when we reply to the inbound connection request. The long from is
|
||||
// a full address and port in a string. It is used for returning the
|
||||
// address of a server that is not running locally.
|
||||
|
||||
#define CCREQ_CONNECT 0x01
|
||||
#define CCREQ_SERVER_INFO 0x02
|
||||
#define CCREQ_PLAYER_INFO 0x03
|
||||
#define CCREQ_RULE_INFO 0x04
|
||||
|
||||
#define CCREP_ACCEPT 0x81
|
||||
#define CCREP_REJECT 0x82
|
||||
#define CCREP_SERVER_INFO 0x83
|
||||
#define CCREP_PLAYER_INFO 0x84
|
||||
#define CCREP_RULE_INFO 0x85
|
||||
|
||||
typedef struct qsocket_s
|
||||
{
|
||||
struct qsocket_s *next;
|
||||
double connecttime;
|
||||
double lastMessageTime;
|
||||
double lastSendTime;
|
||||
|
||||
qboolean disconnected;
|
||||
qboolean canSend;
|
||||
qboolean sendNext;
|
||||
|
||||
int driver;
|
||||
int landriver;
|
||||
int socket;
|
||||
void *driverdata;
|
||||
|
||||
unsigned int ackSequence;
|
||||
unsigned int sendSequence;
|
||||
unsigned int unreliableSendSequence;
|
||||
int sendMessageLength;
|
||||
byte sendMessage [NET_MAXMESSAGE];
|
||||
|
||||
unsigned int receiveSequence;
|
||||
unsigned int unreliableReceiveSequence;
|
||||
int receiveMessageLength;
|
||||
byte receiveMessage [NET_MAXMESSAGE];
|
||||
|
||||
struct qsockaddr addr;
|
||||
char address[NET_NAMELEN];
|
||||
|
||||
} qsocket_t;
|
||||
|
||||
extern qsocket_t *net_activeSockets;
|
||||
extern qsocket_t *net_freeSockets;
|
||||
extern int net_numsockets;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
qboolean initialized;
|
||||
int controlSock;
|
||||
int (*Init) (void);
|
||||
void (*Shutdown) (void);
|
||||
void (*Listen) (qboolean state);
|
||||
int (*OpenSocket) (int port);
|
||||
int (*CloseSocket) (int socket);
|
||||
int (*Connect) (int socket, struct qsockaddr *addr);
|
||||
int (*CheckNewConnections) (void);
|
||||
int (*Read) (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int (*Write) (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int (*Broadcast) (int socket, byte *buf, int len);
|
||||
char * (*AddrToString) (struct qsockaddr *addr);
|
||||
int (*StringToAddr) (char *string, struct qsockaddr *addr);
|
||||
int (*GetSocketAddr) (int socket, struct qsockaddr *addr);
|
||||
int (*GetNameFromAddr) (struct qsockaddr *addr, char *name);
|
||||
int (*GetAddrFromName) (char *name, struct qsockaddr *addr);
|
||||
int (*AddrCompare) (struct qsockaddr *addr1, struct qsockaddr *addr2);
|
||||
int (*GetSocketPort) (struct qsockaddr *addr);
|
||||
int (*SetSocketPort) (struct qsockaddr *addr, int port);
|
||||
} net_landriver_t;
|
||||
|
||||
#define MAX_NET_DRIVERS 8
|
||||
extern int net_numlandrivers;
|
||||
extern net_landriver_t net_landrivers[MAX_NET_DRIVERS];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
qboolean initialized;
|
||||
int (*Init) (void);
|
||||
void (*Listen) (qboolean state);
|
||||
void (*SearchForHosts) (qboolean xmit);
|
||||
qsocket_t *(*Connect) (char *host);
|
||||
qsocket_t *(*CheckNewConnections) (void);
|
||||
int (*QGetMessage) (qsocket_t *sock);
|
||||
int (*QSendMessage) (qsocket_t *sock, sizebuf_t *data);
|
||||
int (*SendUnreliableMessage) (qsocket_t *sock, sizebuf_t *data);
|
||||
qboolean (*CanSendMessage) (qsocket_t *sock);
|
||||
qboolean (*CanSendUnreliableMessage) (qsocket_t *sock);
|
||||
void (*Close) (qsocket_t *sock);
|
||||
void (*Shutdown) (void);
|
||||
int controlSock;
|
||||
} net_driver_t;
|
||||
|
||||
extern int net_numdrivers;
|
||||
extern net_driver_t net_drivers[MAX_NET_DRIVERS];
|
||||
|
||||
extern int DEFAULTnet_hostport;
|
||||
extern int net_hostport;
|
||||
|
||||
extern int net_driverlevel;
|
||||
extern cvar_t hostname;
|
||||
extern char playername[];
|
||||
extern int playercolor;
|
||||
|
||||
extern int messagesSent;
|
||||
extern int messagesReceived;
|
||||
extern int unreliableMessagesSent;
|
||||
extern int unreliableMessagesReceived;
|
||||
|
||||
qsocket_t *NET_NewQSocket (void);
|
||||
void NET_FreeQSocket(qsocket_t *);
|
||||
double SetNetTime(void);
|
||||
|
||||
|
||||
#define HOSTCACHESIZE 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[16];
|
||||
char map[16];
|
||||
char cname[32];
|
||||
int users;
|
||||
int maxusers;
|
||||
int driver;
|
||||
int ldriver;
|
||||
struct qsockaddr addr;
|
||||
} hostcache_t;
|
||||
|
||||
extern int hostCacheCount;
|
||||
extern hostcache_t hostcache[HOSTCACHESIZE];
|
||||
|
||||
#if !defined(_WIN32 ) && !defined (__linux__) && !defined (__sun__)
|
||||
#ifndef htonl
|
||||
extern unsigned long htonl (unsigned long hostlong);
|
||||
#endif
|
||||
#ifndef htons
|
||||
extern unsigned short htons (unsigned short hostshort);
|
||||
#endif
|
||||
#ifndef ntohl
|
||||
extern unsigned long ntohl (unsigned long netlong);
|
||||
#endif
|
||||
#ifndef ntohs
|
||||
extern unsigned short ntohs (unsigned short netshort);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef IDGODS
|
||||
qboolean IsID(struct qsockaddr *addr);
|
||||
#endif
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// public network functions
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
extern double net_time;
|
||||
extern sizebuf_t net_message;
|
||||
extern int net_activeconnections;
|
||||
|
||||
void NET_Init (void);
|
||||
void NET_Shutdown (void);
|
||||
|
||||
struct qsocket_s *NET_CheckNewConnections (void);
|
||||
// returns a new connection number if there is one pending, else -1
|
||||
|
||||
struct qsocket_s *NET_Connect (char *host);
|
||||
// called by client to connect to a host. Returns -1 if not able to
|
||||
|
||||
qboolean NET_CanSendMessage (qsocket_t *sock);
|
||||
// Returns true or false if the given qsocket can currently accept a
|
||||
// message to be transmitted.
|
||||
|
||||
int NET_GetMessage (struct qsocket_s *sock);
|
||||
// returns data in net_message sizebuf
|
||||
// returns 0 if no data is waiting
|
||||
// returns 1 if a message was received
|
||||
// returns 2 if an unreliable message was received
|
||||
// returns -1 if the connection died
|
||||
|
||||
int NET_SendMessage (struct qsocket_s *sock, sizebuf_t *data);
|
||||
int NET_SendUnreliableMessage (struct qsocket_s *sock, sizebuf_t *data);
|
||||
// returns 0 if the message connot be delivered reliably, but the connection
|
||||
// is still considered valid
|
||||
// returns 1 if the message was sent properly
|
||||
// returns -1 if the connection died
|
||||
|
||||
int NET_SendToAll(sizebuf_t *data, int blocktime);
|
||||
// This is a reliable *blocking* send to all attached clients.
|
||||
|
||||
|
||||
void NET_Close (struct qsocket_s *sock);
|
||||
// if a dead connection is returned by a get or send function, this function
|
||||
// should be called when it is convenient
|
||||
|
||||
// Server calls when a client is kicked off for a game related misbehavior
|
||||
// like an illegal protocal conversation. Client calls when disconnecting
|
||||
// from a server.
|
||||
// A netcon_t number will not be reused until this function is called for it
|
||||
|
||||
void NET_Poll(void);
|
||||
|
||||
|
||||
typedef struct _PollProcedure
|
||||
{
|
||||
struct _PollProcedure *next;
|
||||
double nextTime;
|
||||
void (*procedure)();
|
||||
void *arg;
|
||||
} PollProcedure;
|
||||
|
||||
void SchedulePollProcedure(PollProcedure *pp, double timeOffset);
|
||||
|
||||
extern qboolean serialAvailable;
|
||||
extern qboolean ipxAvailable;
|
||||
extern qboolean tcpipAvailable;
|
||||
extern char my_ipx_address[NET_NAMELEN];
|
||||
extern char my_tcpip_address[NET_NAMELEN];
|
||||
extern void (*GetComPortConfig) (int portNumber, int *port, int *irq, int *baud, qboolean *useModem);
|
||||
extern void (*SetComPortConfig) (int portNumber, int port, int irq, int baud, qboolean useModem);
|
||||
extern void (*GetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
||||
extern void (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup);
|
||||
|
||||
extern qboolean slistInProgress;
|
||||
extern qboolean slistSilent;
|
||||
extern qboolean slistLocal;
|
||||
|
||||
void NET_Slist_f (void);
|
||||
39
include/net_bw.h
Normal file
39
include/net_bw.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_bw.h
|
||||
|
||||
int BW_Init (void);
|
||||
void BW_Shutdown (void);
|
||||
void BW_Listen (qboolean state);
|
||||
int BW_OpenSocket (int port);
|
||||
int BW_CloseSocket (int socket);
|
||||
int BW_Connect (int socket, struct qsockaddr *addr);
|
||||
int BW_CheckNewConnections (void);
|
||||
int BW_Read (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int BW_Write (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int BW_Broadcast (int socket, byte *buf, int len);
|
||||
char *BW_AddrToString (struct qsockaddr *addr);
|
||||
int BW_StringToAddr (char *string, struct qsockaddr *addr);
|
||||
int BW_GetSocketAddr (int socket, struct qsockaddr *addr);
|
||||
int BW_GetNameFromAddr (struct qsockaddr *addr, char *name);
|
||||
int BW_GetAddrFromName (char *name, struct qsockaddr *addr);
|
||||
int BW_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2);
|
||||
int BW_GetSocketPort (struct qsockaddr *addr);
|
||||
int BW_SetSocketPort (struct qsockaddr *addr, int port);
|
||||
34
include/net_dgrm.h
Normal file
34
include/net_dgrm.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_dgrm.h
|
||||
|
||||
|
||||
int Datagram_Init (void);
|
||||
void Datagram_Listen (qboolean state);
|
||||
void Datagram_SearchForHosts (qboolean xmit);
|
||||
qsocket_t *Datagram_Connect (char *host);
|
||||
qsocket_t *Datagram_CheckNewConnections (void);
|
||||
int Datagram_GetMessage (qsocket_t *sock);
|
||||
int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
qboolean Datagram_CanSendMessage (qsocket_t *sock);
|
||||
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock);
|
||||
void Datagram_Close (qsocket_t *sock);
|
||||
void Datagram_Shutdown (void);
|
||||
39
include/net_ipx.h
Normal file
39
include/net_ipx.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_ipx.h
|
||||
|
||||
int IPX_Init (void);
|
||||
void IPX_Shutdown (void);
|
||||
void IPX_Listen (qboolean state);
|
||||
int IPX_OpenSocket (int port);
|
||||
int IPX_CloseSocket (int socket);
|
||||
int IPX_Connect (int socket, struct qsockaddr *addr);
|
||||
int IPX_CheckNewConnections (void);
|
||||
int IPX_Read (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int IPX_Write (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int IPX_Broadcast (int socket, byte *buf, int len);
|
||||
char *IPX_AddrToString (struct qsockaddr *addr);
|
||||
int IPX_StringToAddr (char *string, struct qsockaddr *addr);
|
||||
int IPX_GetSocketAddr (int socket, struct qsockaddr *addr);
|
||||
int IPX_GetNameFromAddr (struct qsockaddr *addr, char *name);
|
||||
int IPX_GetAddrFromName (char *name, struct qsockaddr *addr);
|
||||
int IPX_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2);
|
||||
int IPX_GetSocketPort (struct qsockaddr *addr);
|
||||
int IPX_SetSocketPort (struct qsockaddr *addr, int port);
|
||||
33
include/net_loop.h
Normal file
33
include/net_loop.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_loop.h
|
||||
|
||||
int Loop_Init (void);
|
||||
void Loop_Listen (qboolean state);
|
||||
void Loop_SearchForHosts (qboolean xmit);
|
||||
qsocket_t *Loop_Connect (char *host);
|
||||
qsocket_t *Loop_CheckNewConnections (void);
|
||||
int Loop_GetMessage (qsocket_t *sock);
|
||||
int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
qboolean Loop_CanSendMessage (qsocket_t *sock);
|
||||
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock);
|
||||
void Loop_Close (qsocket_t *sock);
|
||||
void Loop_Shutdown (void);
|
||||
39
include/net_mp.h
Normal file
39
include/net_mp.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_mpath.h
|
||||
|
||||
int MPATH_Init (void);
|
||||
void MPATH_Shutdown (void);
|
||||
void MPATH_Listen (qboolean state);
|
||||
int MPATH_OpenSocket (int port);
|
||||
int MPATH_CloseSocket (int socket);
|
||||
int MPATH_Connect (int socket, struct qsockaddr *addr);
|
||||
int MPATH_CheckNewConnections (void);
|
||||
int MPATH_Read (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int MPATH_Write (int socket, byte *buf, int len, struct qsockaddr *addr);
|
||||
int MPATH_Broadcast (int socket, byte *buf, int len);
|
||||
char *MPATH_AddrToString (struct qsockaddr *addr);
|
||||
int MPATH_StringToAddr (char *string, struct qsockaddr *addr);
|
||||
int MPATH_GetSocketAddr (int socket, struct qsockaddr *addr);
|
||||
int MPATH_GetNameFromAddr (struct qsockaddr *addr, char *name);
|
||||
int MPATH_GetAddrFromName (char *name, struct qsockaddr *addr);
|
||||
int MPATH_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2);
|
||||
int MPATH_GetSocketPort (struct qsockaddr *addr);
|
||||
int MPATH_SetSocketPort (struct qsockaddr *addr, int port);
|
||||
33
include/net_ser.h
Normal file
33
include/net_ser.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// net_ser.h
|
||||
|
||||
int Serial_Init (void);
|
||||
void Serial_Listen (qboolean state);
|
||||
void Serial_SearchForHosts (qboolean xmit);
|
||||
qsocket_t *Serial_Connect (char *host);
|
||||
qsocket_t *Serial_CheckNewConnections (void);
|
||||
int Serial_GetMessage (qsocket_t *sock);
|
||||
int Serial_SendMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
int Serial_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
|
||||
qboolean Serial_CanSendMessage (qsocket_t *sock);
|
||||
qboolean Serial_CanSendUnreliableMessage (qsocket_t *sock);
|
||||
void Serial_Close (qsocket_t *sock);
|
||||
void Serial_Shutdown (void);
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue