Browse Source

initial commit

master
Alison Watson 2 years ago
commit
242a51027b
100 changed files with 57687 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +187
    -0
      CMakeLists.txt
  3. +339
    -0
      LICENSE.txt
  4. +580
    -0
      source/anorm_dots.h
  5. +182
    -0
      source/anorms.h
  6. +170
    -0
      source/arch_def.h
  7. +469
    -0
      source/bgmusic.c
  8. +43
    -0
      source/bgmusic.h
  9. +410
    -0
      source/bspfile.h
  10. +53
    -0
      source/cd_null.c
  11. +585
    -0
      source/cd_sdl.c
  12. +35
    -0
      source/cdaudio.h
  13. +175
    -0
      source/cfgfile.c
  14. +42
    -0
      source/cfgfile.h
  15. +118
    -0
      source/chase.c
  16. +504
    -0
      source/cl_demo.c
  17. +454
    -0
      source/cl_input.c
  18. +817
    -0
      source/cl_main.c
  19. +1246
    -0
      source/cl_parse.c
  20. +361
    -0
      source/cl_tent.c
  21. +376
    -0
      source/client.h
  22. +862
    -0
      source/cmd.c
  23. +127
    -0
      source/cmd.h
  24. +2463
    -0
      source/common.c
  25. +308
    -0
      source/common.h
  26. +1308
    -0
      source/console.c
  27. +69
    -0
      source/console.h
  28. +94
    -0
      source/crc.c
  29. +33
    -0
      source/crc.h
  30. +652
    -0
      source/cvar.c
  31. +143
    -0
      source/cvar.h
  32. +48
    -0
      source/draw.h
  33. +193
    -0
      source/filenames.h
  34. +772
    -0
      source/gl_draw.c
  35. +410
    -0
      source/gl_fog.c
  36. +614
    -0
      source/gl_mesh.c
  37. +2865
    -0
      source/gl_model.c
  38. +519
    -0
      source/gl_model.h
  39. +220
    -0
      source/gl_refrag.c
  40. +395
    -0
      source/gl_rlight.c
  41. +1148
    -0
      source/gl_rmain.c
  42. +651
    -0
      source/gl_rmisc.c
  43. +1133
    -0
      source/gl_screen.c
  44. +1029
    -0
      source/gl_sky.c
  45. +1544
    -0
      source/gl_texmgr.c
  46. +110
    -0
      source/gl_texmgr.h
  47. +2106
    -0
      source/gl_vidsdl.c
  48. +272
    -0
      source/gl_warp.c
  49. +84
    -0
      source/gl_warp_sin.h
  50. +405
    -0
      source/glquake.h
  51. +935
    -0
      source/host.c
  52. +2338
    -0
      source/host_cmd.c
  53. +601
    -0
      source/image.c
  54. +38
    -0
      source/image.h
  55. +947
    -0
      source/in_sdl.c
  56. +57
    -0
      source/input.h
  57. +1201
    -0
      source/keys.c
  58. +200
    -0
      source/keys.h
  59. +6248
    -0
      source/lodepng.c
  60. +1769
    -0
      source/lodepng.h
  61. +167
    -0
      source/main_sdl.c
  62. +504
    -0
      source/mathlib.c
  63. +122
    -0
      source/mathlib.h
  64. +2782
    -0
      source/menu.c
  65. +75
    -0
      source/menu.h
  66. +141
    -0
      source/modelgen.h
  67. +115
    -0
      source/net.h
  68. +97
    -0
      source/net_bsd.c
  69. +260
    -0
      source/net_defs.h
  70. +1421
    -0
      source/net_dgrm.c
  71. +39
    -0
      source/net_dgrm.h
  72. +250
    -0
      source/net_loop.c
  73. +40
    -0
      source/net_loop.h
  74. +906
    -0
      source/net_main.c
  75. +199
    -0
      source/net_sys.h
  76. +462
    -0
      source/net_udp.c
  77. +45
    -0
      source/net_udp.h
  78. +122
    -0
      source/net_win.c
  79. +544
    -0
      source/net_wins.c
  80. +45
    -0
      source/net_wins.h
  81. +448
    -0
      source/net_wipx.c
  82. +45
    -0
      source/net_wipx.h
  83. +80
    -0
      source/pl_linux.c
  84. +69
    -0
      source/pl_osx.m
  85. +97
    -0
      source/pl_win.c
  86. +40
    -0
      source/platform.h
  87. +1765
    -0
      source/pr_cmds.c
  88. +197
    -0
      source/pr_comp.h
  89. +1286
    -0
      source/pr_edict.c
  90. +654
    -0
      source/pr_exec.c
  91. +28
    -0
      source/progdefs.h
  92. +143
    -0
      source/progdefs.q1
  93. +144
    -0
      source/progs.h
  94. +257
    -0
      source/protocol.h
  95. +99
    -0
      source/q_ctype.h
  96. +190
    -0
      source/q_sound.h
  97. +245
    -0
      source/q_stdinc.h
  98. +189
    -0
      source/qs_bmp.h
  99. +324
    -0
      source/quakedef.h
  100. +992
    -0
      source/r_alias.c

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
anachronisms
build

+ 187
- 0
CMakeLists.txt View File

@@ -0,0 +1,187 @@
cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0046 NEW)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0071 NEW)

project(agw-quake C)

if(NOT MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Werror")
endif()

find_package(OpenGL REQUIRED)
find_package(PkgConfig REQUIRED)

pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2>=2.0.0)
pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac>=1.3.3)
pkg_check_modules(Vorbis REQUIRED IMPORTED_TARGET vorbis>=1.3.6
vorbisfile>=1.3.6
ogg>=1.3.4)
pkg_check_modules(Opus REQUIRED IMPORTED_TARGET opus>=1.3.1
opusfile>=0.11
ogg>=1.3.4)
pkg_check_modules(MikMod REQUIRED IMPORTED_TARGET libmikmod>=3.3.11)

add_executable(quake WIN32
source/anorm_dots.h
source/anorms.h
source/arch_def.h
source/bgmusic.c
source/bgmusic.h
source/bspfile.h
source/cd_sdl.c
source/cdaudio.h
source/cfgfile.c
source/cfgfile.h
source/chase.c
source/cl_demo.c
source/cl_input.c
source/cl_main.c
source/cl_parse.c
source/cl_tent.c
source/client.h
source/cmd.c
source/cmd.h
source/common.c
source/common.h
source/console.c
source/console.h
source/crc.c
source/crc.h
source/cvar.c
source/cvar.h
source/draw.h
source/filenames.h
source/gl_draw.c
source/gl_fog.c
source/gl_mesh.c
source/gl_model.c
source/gl_model.h
source/gl_refrag.c
source/gl_rlight.c
source/gl_rmain.c
source/gl_rmisc.c
source/gl_screen.c
source/gl_sky.c
source/gl_texmgr.c
source/gl_texmgr.h
source/gl_vidsdl.c
source/gl_warp.c
source/gl_warp_sin.h
source/glquake.h
source/host.c
source/host_cmd.c
source/image.c
source/image.h
source/in_sdl.c
source/input.h
source/keys.c
source/keys.h
source/lodepng.h
source/main_sdl.c
source/mathlib.c
source/mathlib.h
source/menu.c
source/menu.h
source/modelgen.h
source/net.h
source/net_bsd.c
source/net_defs.h
source/net_dgrm.c
source/net_dgrm.h
source/net_loop.c
source/net_loop.h
source/net_main.c
source/net_sys.h
source/net_udp.c
source/net_udp.h
source/pl_linux.c
source/platform.h
source/pr_cmds.c
source/pr_comp.h
source/pr_edict.c
source/pr_exec.c
source/progdefs.h
source/progs.h
source/protocol.h
source/q_ctype.h
source/q_sound.h
source/q_stdinc.h
source/qs_bmp.h
source/quakedef.h
source/r_alias.c
source/r_brush.c
source/r_part.c
source/r_sprite.c
source/r_world.c
source/render.h
source/resource.h
source/sbar.c
source/sbar.h
source/screen.h
source/server.h
source/snd_codec.c
source/snd_codec.h
source/snd_codeci.h
source/snd_dma.c
source/snd_flac.c
source/snd_flac.h
source/snd_mem.c
source/snd_mikmod.c
source/snd_mikmod.h
source/snd_mix.c
source/snd_mp3.c
source/snd_mp3.h
source/snd_mpg123.c
source/snd_opus.c
source/snd_opus.h
source/snd_sdl.c
source/snd_umx.c
source/snd_umx.h
source/snd_vorbis.c
source/snd_vorbis.h
source/snd_wave.c
source/snd_wave.h
source/snd_xmp.c
source/snd_xmp.h
source/spritegn.h
source/stb_image_write.h
source/strl_fn.h
source/strlcat.c
source/strlcpy.c
source/sv_main.c
source/sv_move.c
source/sv_phys.c
source/sv_user.c
source/sys.h
source/sys_sdl_unix.c
source/vid.h
source/view.c
source/view.h
source/wad.c
source/wad.h
source/world.c
source/world.h
source/wsaerror.h
source/zone.c
source/zone.h)

target_compile_definitions(
quake
PUBLIC
-DDO_USERDIRS=1
-DUSE_SDL2=1
-DUSE_CODEC_FLAC=1
-DUSE_CODEC_VORBIS=1
-DUSE_CODEC_OPUS=1
-DUSE_CODEC_MIKMOD=1
-DUSE_CODEC_UMX=1)

target_link_libraries(quake
m
OpenGL::GL
PkgConfig::SDL2
PkgConfig::FLAC
PkgConfig::Vorbis
PkgConfig::Opus
PkgConfig::MikMod)

+ 339
- 0
LICENSE.txt View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.

We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

+ 580
- 0
source/anorm_dots.h View File

@@ -0,0 +1,580 @@
/*
* anorm_dots.h
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

// 0
{ 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
{ 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
},

// 2
{ 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
},

// 3
{ 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
},

// 4
{ 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
},

// 5
{ 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
},

// 6
{ 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
},

// 7
{ 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
},

// 8
{ 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
},

// 9
{ 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
},

// 10
{ 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
},

// 11
{ 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
},

// 12
{ 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
},

// 13
{ 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
},

// 14
{ 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
},

// 15
{ 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
}


+ 182
- 0
source/anorms.h View File

@@ -0,0 +1,182 @@
/*
* anorms.h
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 },

+ 170
- 0
source/arch_def.h View File

@@ -0,0 +1,170 @@
/*
* arch_def.h
* platform specific definitions
* - standalone header
* - doesn't and must not include any other headers
* - shouldn't depend on compiler.h, q_stdinc.h, or
* any other headers
*
* Copyright (C) 2007-2016 O.Sezer <sezero@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef ARCHDEFS_H
#define ARCHDEFS_H


#if defined(__DJGPP__) || defined(__MSDOS__) || defined(__DOS__) || defined(_MSDOS)

# if !defined(PLATFORM_DOS)
# define PLATFORM_DOS 1
# endif

#elif defined(__OS2__) || defined(__EMX__)

# if !defined(PLATFORM_OS2)
# define PLATFORM_OS2 1
# endif

#elif defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__NT__) || defined(_Windows)

# if !defined(PLATFORM_WINDOWS)
# define PLATFORM_WINDOWS 1
# endif

#elif defined(__APPLE__) && defined(__MACH__) /* Mac OS X */

# if !defined(PLATFORM_OSX)
# define PLATFORM_OSX 1
# endif

#elif defined(macintosh) /* Mac OS classic */

# if !defined(PLATFORM_MAC)
# define PLATFORM_MAC 1
# endif

#elif defined(__MORPHOS__) || defined(__AROS__) || defined(AMIGAOS) || \
defined(__amigaos__) || defined(__amigaos4__) ||defined(__amigados__) || \
defined(AMIGA) || defined(_AMIGA) || defined(__AMIGA__)

# if !defined(PLATFORM_AMIGA)
# define PLATFORM_AMIGA 1
# endif

#elif defined(__riscos__)

# if !defined(PLATFORM_RISCOS)
# define PLATFORM_RISCOS 1
# endif

#else /* here goes the unix platforms */

#if defined(__unix) || defined(__unix__) || defined(unix) || \
defined(__linux__) || defined(__linux) || \
defined(__FreeBSD__) || defined(__DragonFly__) || \
defined(__FreeBSD_kernel__) /* Debian GNU/kFreeBSD */ || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__hpux) || defined(__hpux__) || defined(_hpux) || \
defined(__sun) || defined(sun) || \
defined(__sgi) || defined(sgi) || defined(__sgi__) || \
defined(__GNU__) /* GNU/Hurd */ || \
defined(__QNX__) || defined(__QNXNTO__)
# if !defined(PLATFORM_UNIX)
# define PLATFORM_UNIX 1
# endif
#endif

#endif /* PLATFORM_xxx */


#if defined (PLATFORM_OSX) /* OS X is unix-based */
# if !defined(PLATFORM_UNIX)
# define PLATFORM_UNIX 2
# endif
#endif /* OS X -> PLATFORM_UNIX */


#if defined(__FreeBSD__) || defined(__DragonFly__) || \
defined(__FreeBSD_kernel__) /* Debian GNU/kFreeBSD */ || \
defined(__OpenBSD__) || defined(__NetBSD__)
# if !defined(PLATFORM_BSD)
# define PLATFORM_BSD 1
# endif
#endif /* PLATFORM_BSD (for convenience) */


#if defined(PLATFORM_AMIGA) && !defined(PLATFORM_AMIGAOS3)
# if !defined(__MORPHOS__) && !defined(__AROS__) && !defined(__amigaos4__)
# define PLATFORM_AMIGAOS3 1
# endif
#endif /* PLATFORM_AMIGAOS3 (for convenience) */


#if defined(_WIN64)
# define PLATFORM_STRING "Win64"
#elif defined(PLATFORM_WINDOWS)
# define PLATFORM_STRING "Windows"
#elif defined(PLATFORM_DOS)
# define PLATFORM_STRING "DOS"
#elif defined(PLATFORM_OS2)
# define PLATFORM_STRING "OS/2"
#elif defined(__linux__) || defined(__linux)
# define PLATFORM_STRING "Linux"
#elif defined(__DragonFly__)
# define PLATFORM_STRING "DragonFly"
#elif defined(__FreeBSD__)
# define PLATFORM_STRING "FreeBSD"
#elif defined(__NetBSD__)
# define PLATFORM_STRING "NetBSD"
#elif defined(__OpenBSD__)
# define PLATFORM_STRING "OpenBSD"
#elif defined(__MORPHOS__)
# define PLATFORM_STRING "MorphOS"
#elif defined(__AROS__)
# define PLATFORM_STRING "AROS"
#elif defined(__amigaos4__)
# define PLATFORM_STRING "AmigaOS4"
#elif defined(PLATFORM_AMIGA)
# define PLATFORM_STRING "AmigaOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_STRING "QNX"
#elif defined(PLATFORM_OSX)
# define PLATFORM_STRING "MacOSX"
#elif defined(PLATFORM_MAC)
# define PLATFORM_STRING "MacOS"
#elif defined(__hpux) || defined(__hpux__) || defined(_hpux)
# define PLATFORM_STRING "HP-UX"
#elif (defined(__sun) || defined(sun)) && (defined(__svr4__) || defined(__SVR4))
# define PLATFORM_STRING "Solaris"
#elif defined(__sun) || defined(sun)
# define PLATFORM_STRING "SunOS"
#elif defined(__sgi) || defined(sgi) || defined(__sgi__)
# define PLATFORM_STRING "Irix"
#elif defined(PLATFORM_RISCOS)
# define PLATFORM_STRING "RiscOS"
#elif defined(__GNU__)
# define PLATFORM_STRING "GNU/Hurd"
#elif defined(PLATFORM_UNIX)
# define PLATFORM_STRING "Unix"
#else
# define PLATFORM_STRING "Unknown"
# warning "Platform is UNKNOWN."
#endif /* PLATFORM_STRING */

#endif /* ARCHDEFS_H */


+ 469
- 0
source/bgmusic.c View File

@@ -0,0 +1,469 @@
/*
* Background music handling for Quakespasm (adapted from uHexen2)
* Handles streaming music as raw sound samples and runs the midi driver
*
* Copyright (C) 1999-2005 Id Software, Inc.
* Copyright (C) 2010-2018 O.Sezer <sezero@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/

#include "quakedef.h"
#include "snd_codec.h"
#include "bgmusic.h"

#define MUSIC_DIRNAME "music"

qboolean bgmloop;
cvar_t bgm_extmusic = {"bgm_extmusic", "1", CVAR_ARCHIVE};

static qboolean no_extmusic= false;
static float old_volume = -1.0f;

typedef enum _bgm_player
{
BGM_NONE = -1,
BGM_MIDIDRV = 1,
BGM_STREAMER
} bgm_player_t;

typedef struct music_handler_s
{
unsigned int type; /* 1U << n (see snd_codec.h) */
bgm_player_t player; /* Enumerated bgm player type */
int is_available; /* -1 means not present */
const char *ext; /* Expected file extension */
const char *dir; /* Where to look for music file */
struct music_handler_s *next;
} music_handler_t;

static music_handler_t wanted_handlers[] =
{
{ CODECTYPE_VORBIS,BGM_STREAMER,-1, "ogg", MUSIC_DIRNAME, NULL },
{ CODECTYPE_OPUS, BGM_STREAMER, -1, "opus", MUSIC_DIRNAME, NULL },
{ CODECTYPE_MP3, BGM_STREAMER, -1, "mp3", MUSIC_DIRNAME, NULL },
{ CODECTYPE_FLAC, BGM_STREAMER, -1, "flac", MUSIC_DIRNAME, NULL },
{ CODECTYPE_WAV, BGM_STREAMER, -1, "wav", MUSIC_DIRNAME, NULL },
{ CODECTYPE_MOD, BGM_STREAMER, -1, "it", MUSIC_DIRNAME, NULL },
{ CODECTYPE_MOD, BGM_STREAMER, -1, "s3m", MUSIC_DIRNAME, NULL },
{ CODECTYPE_MOD, BGM_STREAMER, -1, "xm", MUSIC_DIRNAME, NULL },
{ CODECTYPE_MOD, BGM_STREAMER, -1, "mod", MUSIC_DIRNAME, NULL },
{ CODECTYPE_UMX, BGM_STREAMER, -1, "umx", MUSIC_DIRNAME, NULL },
{ CODECTYPE_NONE, BGM_NONE, -1, NULL, NULL, NULL }
};

static music_handler_t *music_handlers = NULL;

#define ANY_CODECTYPE 0xFFFFFFFF
#define CDRIP_TYPES (CODECTYPE_VORBIS | CODECTYPE_MP3 | CODECTYPE_FLAC | CODECTYPE_WAV | CODECTYPE_OPUS)
#define CDRIPTYPE(x) (((x) & CDRIP_TYPES) != 0)

static snd_stream_t *bgmstream = NULL;

static void BGM_Play_f (void)
{
if (Cmd_Argc() == 2)
{
BGM_Play (Cmd_Argv(1));
}
else
{
Con_Printf ("music <musicfile>\n");
return;
}
}

static void BGM_Pause_f (void)
{
BGM_Pause ();
}

static void BGM_Resume_f (void)
{
BGM_Resume ();
}

static void BGM_Loop_f (void)
{
if (Cmd_Argc() == 2)
{
if (q_strcasecmp(Cmd_Argv(1), "0") == 0 ||
q_strcasecmp(Cmd_Argv(1),"off") == 0)
bgmloop = false;
else if (q_strcasecmp(Cmd_Argv(1), "1") == 0 ||
q_strcasecmp(Cmd_Argv(1),"on") == 0)
bgmloop = true;
else if (q_strcasecmp(Cmd_Argv(1),"toggle") == 0)
bgmloop = !bgmloop;
}

if (bgmloop)
Con_Printf("Music will be looped\n");
else
Con_Printf("Music will not be looped\n");
}

static void BGM_Stop_f (void)
{
BGM_Stop();
}

qboolean BGM_Init (void)
{
music_handler_t *handlers = NULL;
int i;

Cvar_RegisterVariable(&bgm_extmusic);
Cmd_AddCommand("music", BGM_Play_f);
Cmd_AddCommand("music_pause", BGM_Pause_f);
Cmd_AddCommand("music_resume", BGM_Resume_f);
Cmd_AddCommand("music_loop", BGM_Loop_f);
Cmd_AddCommand("music_stop", BGM_Stop_f);

if (COM_CheckParm("-noextmusic") != 0)
no_extmusic = true;

bgmloop = true;

for (i = 0; wanted_handlers[i].type != CODECTYPE_NONE; i++)
{
switch (wanted_handlers[i].player)
{
case BGM_MIDIDRV:
/* not supported in quake */
break;
case BGM_STREAMER:
wanted_handlers[i].is_available =
S_CodecIsAvailable(wanted_handlers[i].type);
break;
case BGM_NONE:
default:
break;
}
if (wanted_handlers[i].is_available != -1)
{
if (handlers)
{
handlers->next = &wanted_handlers[i];
handlers = handlers->next;
}
else
{
music_handlers = &wanted_handlers[i];
handlers = music_handlers;
}
}
}

return true;
}

void BGM_Shutdown (void)
{
BGM_Stop();
/* sever our connections to
* midi_drv and snd_codec */
music_handlers = NULL;
}

static void BGM_Play_noext (const char *filename, unsigned int allowed_types)
{
char tmp[MAX_QPATH];
music_handler_t *handler;

handler = music_handlers;
while (handler)
{
if (! (handler->type & allowed_types))
{
handler = handler->next;
continue;
}
if (!handler->is_available)
{
handler = handler->next;
continue;
}
q_snprintf(tmp, sizeof(tmp), "%s/%s.%s",
handler->dir, filename, handler->ext);
switch (handler->player)
{
case BGM_MIDIDRV:
/* not supported in quake */
break;
case BGM_STREAMER:
bgmstream = S_CodecOpenStreamType(tmp, handler->type);
if (bgmstream)
return; /* success */
break;
case BGM_NONE:
default:
break;
}
handler = handler->next;
}

Con_Printf("Couldn't handle music file %s\n", filename);
}

void BGM_Play (const char *filename)
{
char tmp[MAX_QPATH];
const char *ext;
music_handler_t *handler;

BGM_Stop();

if (music_handlers == NULL)
return;

if (!filename || !*filename)
{
Con_DPrintf("null music file name\n");
return;
}

ext = COM_FileGetExtension(filename);
if (! *ext) /* try all things */
{
BGM_Play_noext(filename, ANY_CODECTYPE);
return;
}

handler = music_handlers;
while (handler)
{
if (handler->is_available &&
!q_strcasecmp(ext, handler->ext))
break;
handler = handler->next;
}
if (!handler)
{
Con_Printf("Unhandled extension for %s\n", filename);
return;
}
q_snprintf(tmp, sizeof(tmp), "%s/%s", handler->dir, filename);
switch (handler->player)
{
case BGM_MIDIDRV:
/* not supported in quake */
break;
case BGM_STREAMER:
bgmstream = S_CodecOpenStreamType(tmp, handler->type);
if (bgmstream)
return; /* success */
break;
case BGM_NONE:
default:
break;
}

Con_Printf("Couldn't handle music file %s\n", filename);
}

void BGM_PlayCDtrack (byte track, qboolean looping)
{
/* instead of searching by the order of music_handlers, do so by
* the order of searchpath priority: the file from the searchpath
* with the highest path_id is most likely from our own gamedir
* itself. This way, if a mod has track02 as a *.mp3 file, which
* is below *.ogg in the music_handler order, the mp3 will still
* have priority over track02.ogg from, say, id1.
*/
char tmp[MAX_QPATH];
const char *ext;
unsigned int path_id, prev_id, type;
music_handler_t *handler;

BGM_Stop();
if (CDAudio_Play(track, looping) == 0)
return; /* success */

if (music_handlers == NULL)
return;

if (no_extmusic || !bgm_extmusic.value)
return;

prev_id = 0;
type = 0;
ext = NULL;
handler = music_handlers;
while (handler)
{
if (! handler->is_available)
goto _next;
if (! CDRIPTYPE(handler->type))
goto _next;
q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s",
MUSIC_DIRNAME, (int)track, handler->ext);
if (! COM_FileExists(tmp, &path_id))
goto _next;
if (path_id > prev_id)
{
prev_id = path_id;
type = handler->type;
ext = handler->ext;
}
_next:
handler = handler->next;
}
if (ext == NULL)
Con_Printf("Couldn't find a cdrip for track %d\n", (int)track);
else
{
q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s",
MUSIC_DIRNAME, (int)track, ext);
bgmstream = S_CodecOpenStreamType(tmp, type);
if (! bgmstream)
Con_Printf("Couldn't handle music file %s\n", tmp);
}
}

void BGM_Stop (void)
{
if (bgmstream)
{
bgmstream->status = STREAM_NONE;
S_CodecCloseStream(bgmstream);
bgmstream = NULL;
s_rawend = 0;
}
}

void BGM_Pause (void)
{
if (bgmstream)
{
if (bgmstream->status == STREAM_PLAY)
bgmstream->status = STREAM_PAUSE;
}
}

void BGM_Resume (void)
{
if (bgmstream)
{
if (bgmstream->status == STREAM_PAUSE)
bgmstream->status = STREAM_PLAY;
}
}

static void BGM_UpdateStream (void)
{
qboolean did_rewind = false;
int res; /* Number of bytes read. */
int bufferSamples;
int fileSamples;
int fileBytes;
byte raw[16384];

if (bgmstream->status != STREAM_PLAY)
return;

/* don't bother playing anything if musicvolume is 0 */
if (bgmvolume.value <= 0)
return;

/* see how many samples should be copied into the raw buffer */
if (s_rawend < paintedtime)
s_rawend = paintedtime;

while (s_rawend < paintedtime + MAX_RAW_SAMPLES)
{
bufferSamples = MAX_RAW_SAMPLES - (s_rawend - paintedtime);

/* decide how much data needs to be read from the file */
fileSamples = bufferSamples * bgmstream->info.rate / shm->speed;
if (!fileSamples)
return;

/* our max buffer size */
fileBytes = fileSamples * (bgmstream->info.width * bgmstream->info.channels);
if (fileBytes > (int) sizeof(raw))
{
fileBytes = (int) sizeof(raw);
fileSamples = fileBytes /
(bgmstream->info.width * bgmstream->info.channels);
}

/* Read */
res = S_CodecReadStream(bgmstream, fileBytes, raw);
if (res < fileBytes)
{
fileBytes = res;
fileSamples = res / (bgmstream->info.width * bgmstream->info.channels);
}

if (res > 0) /* data: add to raw buffer */
{
S_RawSamples(fileSamples, bgmstream->info.rate,
bgmstream->info.width,
bgmstream->info.channels,
raw, bgmvolume.value);
did_rewind = false;
}
else if (res == 0) /* EOF */
{
if (bgmloop)
{
if (did_rewind)
{
Con_Printf("Stream keeps returning EOF.\n");
BGM_Stop();
return;
}

res = S_CodecRewindStream(bgmstream);
if (res != 0)
{
Con_Printf("Stream seek error (%i), stopping.\n", res);
BGM_Stop();
return;
}
did_rewind = true;
}
else
{
BGM_Stop();
return;
}
}
else /* res < 0: some read error */
{
Con_Printf("Stream read error (%i), stopping.\n", res);
BGM_Stop();
return;
}
}
}

void BGM_Update (void)
{
if (old_volume != bgmvolume.value)
{
if (bgmvolume.value < 0)
Cvar_SetQuick (&bgmvolume, "0");
else if (bgmvolume.value > 1)
Cvar_SetQuick (&bgmvolume, "1");
old_volume = bgmvolume.value;
}
if (bgmstream)
BGM_UpdateStream ();
}


+ 43
- 0
source/bgmusic.h View File

@@ -0,0 +1,43 @@
/*
* Background music handling for Quakespasm (adapted from uHexen2)
* Handles streaming music as raw sound samples and runs the midi driver
*
* Copyright (C) 1999-2005 Id Software, Inc.
* Copyright (C) 2010-2012 O.Sezer <sezero@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/

#ifndef _BGMUSIC_H_
#define _BGMUSIC_H_

extern qboolean bgmloop;
extern cvar_t bgm_extmusic;

qboolean BGM_Init (void);
void BGM_Shutdown (void);

void BGM_Play (const char *filename);
void BGM_Stop (void);
void BGM_Update (void);
void BGM_Pause (void);
void BGM_Resume (void);

void BGM_PlayCDtrack (byte track, qboolean looping);

#endif /* _BGMUSIC_H_ */


+ 410
- 0
source/bspfile.h View File

@@ -0,0 +1,410 @@
/*
Copyright (C) 1996-2001 Id Software, Inc.
Copyright (C) 2002-2009 John Fitzgibbons and others
Copyright (C) 2010-2014 QuakeSpasm developers

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

#ifndef __BSPFILE_H
#define __BSPFILE_H

// 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 80000 //johnfitz -- was 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

/* RMQ support (2PSB). 32bits instead of shorts for all but bbox sizes (which
* still use shorts) */
#define BSP2VERSION_2PSB (('B' << 24) | ('S' << 16) | ('P' << 8) | '2')

/* BSP2 support. 32bits instead of shorts for everything (bboxes use floats) */
#define BSP2VERSION_BSP2 (('B' << 0) | ('S' << 8) | ('P' << 16) | ('2'<<24))

#define TOOLVERSION 2

typedef struct
{
int fileofs, filelen;