Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3113d96de6 | ||
|
|
ebdb590018 | ||
|
|
d828613b6a | ||
|
|
bb4baafd1e | ||
|
|
ea21b25711 | ||
|
|
8038c5aff4 | ||
|
|
5f19ff2c6a | ||
|
|
39436339ad | ||
|
|
d4a494d7ae | ||
|
|
2af0140300 | ||
|
|
31f81a4a53 | ||
|
|
420424bbb6 | ||
|
|
0adaceaf3b | ||
|
|
7487cc1752 | ||
|
|
4e22d3e61a | ||
|
|
ec5bff710d | ||
|
|
6f5115f6cb | ||
|
|
ec9ff014c8 | ||
|
|
b9f9462f92 | ||
|
|
c1dda61094 | ||
|
|
7d64ec103d | ||
|
|
2077315f24 | ||
|
|
6af1c41e73 | ||
|
|
c7dd38ed9f | ||
|
|
9bea6eddbd | ||
|
|
f4e5f7249c | ||
|
|
e1f0b97926 | ||
|
|
132fc98211 | ||
|
|
2e52a7c7cb | ||
|
|
80ffa12848 | ||
|
|
98c8e965e5 | ||
|
|
cc3ced8cd2 | ||
|
|
6fec71196b | ||
|
|
05a8f1822e | ||
|
|
6209f4fc1b | ||
|
|
cb27730622 | ||
|
|
decaa79d20 | ||
|
|
aeb06a26ee | ||
|
|
536b141935 | ||
|
|
cfe90cce7d | ||
|
|
ea1075d330 | ||
|
|
66a68396a5 | ||
|
|
514b5a86a2 | ||
|
|
c806e92743 | ||
|
|
e438c818ae | ||
|
|
2f960296a3 | ||
|
|
ad739706c3 | ||
|
|
938a9ef813 | ||
|
|
8dc81de608 | ||
|
|
d87f675f38 | ||
|
|
7677b7f616 | ||
|
|
48dfe5cb75 | ||
|
|
ed57c27629 | ||
|
|
8e5633a23f | ||
|
|
8bcada1fda | ||
|
|
771152b919 | ||
|
|
b4277c88c1 | ||
|
|
63026cc11d | ||
|
|
b8385d1579 | ||
|
|
916cc9d8ca | ||
|
|
347000a326 | ||
|
|
4967313720 | ||
|
|
19b64a8b61 | ||
|
|
6a7b2b9721 | ||
|
|
e167d7b641 | ||
|
|
2d426ac38c | ||
|
|
0844c02668 | ||
|
|
ee2afb7047 | ||
|
|
52713c0112 | ||
|
|
ec5afd3caf | ||
|
|
9b8a86a47d | ||
|
|
bdece8deb5 | ||
|
|
7647a3dfb5 | ||
|
|
ba549148ac | ||
|
|
23732faf35 | ||
|
|
70942af38e | ||
|
|
88390555c6 | ||
|
|
5c6f5c7f9e | ||
|
|
7e05c707c7 | ||
|
|
f3e46f8bfd | ||
|
|
25f200574e | ||
|
|
e1dadce2ad | ||
|
|
99d5590435 | ||
|
|
9b2cfe51d6 | ||
|
|
66619f42f9 | ||
|
|
890677e2b5 | ||
|
|
1105526eb1 | ||
|
|
d963df36f1 | ||
|
|
846967cb91 | ||
|
|
6c8862ee4b | ||
|
|
a49ea4defd | ||
|
|
3c776b321d | ||
|
|
1ed9bfc9b4 | ||
|
|
a05413d925 | ||
|
|
fa9637fba4 | ||
|
|
7f50a09bcd | ||
|
|
e25191d7df | ||
|
|
f4d8a903e8 | ||
|
|
8a8cbffd12 | ||
|
|
0adf356325 | ||
|
|
0fef290858 | ||
|
|
2516873ba1 | ||
|
|
c650394c31 | ||
|
|
1fb6c63097 | ||
|
|
e95382075c | ||
|
|
2d9776d792 | ||
|
|
7fa3d119e8 | ||
|
|
e65741acaa | ||
|
|
b36ab31a56 | ||
|
|
a335da3473 | ||
|
|
c312380944 | ||
|
|
b5bb2b42bf | ||
|
|
d074f375ca | ||
|
|
6fd14f0a80 | ||
|
|
d6bbb2c1b3 | ||
|
|
fa66b87965 | ||
|
|
c59d5db03e | ||
|
|
d2f3d5aa4d | ||
|
|
913b8878d8 | ||
|
|
f02b9f953e | ||
|
|
5c8c1e91b8 | ||
|
|
b6edc90553 | ||
|
|
23735121ff | ||
|
|
20950b698f | ||
|
|
44df85d6a4 | ||
|
|
42d53f1f6f | ||
|
|
48f2d0ff83 | ||
|
|
517723f9c1 | ||
|
|
6915077e0f | ||
|
|
406dbf333d | ||
|
|
a730dfd212 | ||
|
|
3058d365f3 | ||
|
|
ccc453e0b0 | ||
|
|
c3d02090e4 | ||
|
|
20cd7621c3 | ||
|
|
945218bead | ||
|
|
bd3cedf233 | ||
|
|
8ffff231e1 | ||
|
|
dda1d59ec9 | ||
|
|
6014b4c79d | ||
|
|
16377d603d | ||
|
|
0fcef67d2a | ||
|
|
eaa1976a47 | ||
|
|
91036129aa | ||
|
|
556068281e | ||
|
|
21a24cf48e | ||
|
|
18e574fe98 | ||
|
|
caf8d35464 | ||
|
|
5ca33a8b6e | ||
|
|
b676e1d420 | ||
|
|
69797b883b | ||
|
|
28800b72f7 | ||
|
|
c4d964297c | ||
|
|
2594834886 | ||
|
|
4a3e059bc3 | ||
|
|
2bbc71c5e0 | ||
|
|
bcbb495a71 | ||
|
|
bddf3c0c30 | ||
|
|
eb4e6b5c87 | ||
|
|
005c742d57 | ||
|
|
cab6247acf | ||
|
|
befc598bab | ||
|
|
19b1eed0f5 | ||
|
|
978fb619bc | ||
|
|
66d406ef22 | ||
|
|
993366f485 | ||
|
|
105be82f45 | ||
|
|
39389bda8f | ||
|
|
89c0859423 | ||
|
|
7792c7a6d2 | ||
|
|
cd61b2cba8 | ||
|
|
675a873485 | ||
|
|
2f023e00d8 | ||
|
|
8dd8f655ec | ||
|
|
8ce8f8f7f2 | ||
|
|
8b395274c0 | ||
|
|
52ef8a9e77 | ||
|
|
2429aa5dc0 | ||
|
|
85286593b0 | ||
|
|
ba23e1233b | ||
|
|
842a79071a | ||
|
|
6000bb952a | ||
|
|
f73657aa79 | ||
|
|
fa3b8652ca | ||
|
|
23a29767e9 | ||
|
|
2503c891e1 | ||
|
|
67facba812 | ||
|
|
a7dabea6a3 | ||
|
|
7b5129e2fe | ||
|
|
30418950cb | ||
|
|
042bc7b4d3 | ||
|
|
53be790fbf | ||
|
|
8b04ca5d6c | ||
|
|
da7429f768 | ||
|
|
17d03c6b43 | ||
|
|
fd86f13150 | ||
|
|
facacbd64c | ||
|
|
11aa7dbecb | ||
|
|
e61c526b7d | ||
|
|
7515f05d80 | ||
|
|
1bd291f1fe | ||
|
|
e7e09b46bd | ||
|
|
a14f6de20c | ||
|
|
4997374710 | ||
|
|
abc224dd56 | ||
|
|
2f865f97c7 | ||
|
|
228292f779 | ||
|
|
3defed0d12 | ||
|
|
cdbeead3ce | ||
|
|
95979597ca | ||
|
|
3cc86141c8 | ||
|
|
88f8abf00e | ||
|
|
fb9132859c | ||
|
|
d49a735c42 | ||
|
|
80595133be | ||
|
|
b0c4d129c6 | ||
|
|
62883a8504 | ||
|
|
30b5db9c96 | ||
|
|
e0bcdd6d90 | ||
|
|
7f9ccfbc34 | ||
|
|
658241c4ba | ||
|
|
ab79a02462 | ||
|
|
221079e393 | ||
|
|
016f89fd55 | ||
|
|
3b6b8cc1bf |
No files matched your search
@@ -1,3 +1,69 @@
|
||||
2.8.1:
|
||||
* Added Stop/Start/Pause/Resume for Fluidsynth
|
||||
|
||||
2.8.0:
|
||||
* Added support for loading wavpack sound files (https://www.wavpack.com/)
|
||||
* Added support for loading classic console sound files using Game_Music_Emu (https://github.com/libgme/game-music-emu)
|
||||
* Use minimp3 instead of dr_mp3 as the default backend for MP3 music
|
||||
* Use libxmp instead of modplug as the default backend for MOD music
|
||||
To use libmodplug instead, configure using --enable-music-mod-modplug --disable-music-mod-xmp
|
||||
* Added support for FLAC audio in Ogg containers
|
||||
* Added Mix_PauseAudio() to pause and resume all audio playback
|
||||
* Added Mix_GetNumTracks() and Mix_StartTrack() for managing tracks in GME files
|
||||
|
||||
2.6.2:
|
||||
* Updated autotools to use ax_compute_relative_paths, fixing homebrew on macOS
|
||||
|
||||
2.6.1:
|
||||
* Fixed issue with incorrect version reported by pkg-config
|
||||
|
||||
2.6.0:
|
||||
* Added support for building with CMake
|
||||
* Added support for playing Ogg files using stb_vorbis, which is now the default Vorbis backend.
|
||||
To use libvorbis instead, configure using --disable-music-ogg-stb --enable-music-ogg-vorbis
|
||||
* Added support for playing FLAC files using dr_flac, which is now the default FLAC music backend.
|
||||
To use libflac instead, configure using --disable-music-flac-drflac --enable-music-flac-libflac
|
||||
* Added support for playing MP3 files using dr_mp3, which is now the default MP3 music backend.
|
||||
To use libmpg123 instead, configure using --disable-music-mp3-drmp3 --enable-music-mp3-mpg123
|
||||
* Added libxmp support for mod music playback. Modplug is still the default backend for MOD music.
|
||||
To use libxmp instead, configure using --disable-music-mod-modplug --enable-music-mod-xmp
|
||||
* Removed support for libmad as a MP3 music backend.
|
||||
* Removed support for libmikmod as a MOD music backend.
|
||||
* Added Mix_MasterVolume() for additional volume control over all channels
|
||||
* Update Mix_Init() return value to match documentation, including MIXER_INIT_* flags for already-initialized modules
|
||||
* Added Mix_HasMusicDecoder()
|
||||
* Memory leak fixes and F32 format support to fluidsynth player
|
||||
* Fixed distorted MIDI playback with FluidSynth if sample rate is out of library's limits
|
||||
* Added Mix_ModMusicJumpToOrder() for mod music formats
|
||||
* Enabled module internal loops in modplug player
|
||||
* Respect original mp3 file offset
|
||||
* Support setting soundfont via SDL_SOUNDFONTS in OSX native midi
|
||||
* Fixed mp3 file detection
|
||||
* Fixes to ogg playback on big-endian devices
|
||||
* Added functions to get metadata information:
|
||||
Mix_GetMusicTitle()
|
||||
Mix_GetMusicTitleTag()
|
||||
Mix_GetMusicArtistTag()
|
||||
Mix_GetMusicAlbumTag()
|
||||
Mix_GetMusicCopyrightTag()
|
||||
* Add functions to get loop point information:
|
||||
Mix_GetMusicLoopStartTime()
|
||||
Mix_GetMusicLoopEndTime()
|
||||
Mix_GetMusicLoopLengthTime()
|
||||
* Added Mix_GetMusicVolume() and Mix_GetMusicPosition()
|
||||
* Added Mix_MusicDuration() to return music duration in seconds
|
||||
* Fixed music_mpg123 seek bug when sample rate of the file and the stream don't match
|
||||
* Timidity improvements, added Mix_SetTimidityCfg()
|
||||
* Improved mp3 tag detection/skipping
|
||||
* Extended support for WAV files
|
||||
* Allow rmid files be opened by native midi
|
||||
* Fixed possible crash in win32 native midi
|
||||
* Prevent clipping due to volume settings in modplug music
|
||||
* Added looping support for Opus files
|
||||
* Added looping support for FLAC files
|
||||
* Improved OGG looping support
|
||||
* Fixed loading Opus audio as audio chunks
|
||||
|
||||
2.0.4:
|
||||
Ozkan Sezer - Wed, 10 Oct 2018 14:56:10
|
||||
* Removed smpeg support for mp3 music, now that it's replaced by libmpg123
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
SDL_mixer: An audio mixer library based on the SDL library
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
@@ -1,32 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_mixer/file/default/external
|
||||
---
|
||||
|
||||
Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,5 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_mixer/file/default/external
|
||||
---
|
||||
|
||||
ModPlug-XMMS and libmodplug are now in the public domain.
|
||||
@@ -1,776 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_mixer/file/default/external
|
||||
---
|
||||
|
||||
This is the file that contains the terms of use, copying, etc. for the mpg123 distribution package.
|
||||
|
||||
Main message, to include in "About ..." boxes, etc:
|
||||
|
||||
Copyright (c) 1995-2013 by Michael Hipp and others,
|
||||
free software under the terms of the LGPL v2.1
|
||||
|
||||
There is an attempt to cover the actual list of authors in the AUTHORS file.
|
||||
Project maintainer since 2006 is Thomas Orgis and many people have contributed
|
||||
since the Michael Hipp era, but he stays the initial source and it would
|
||||
be impractical to count them all individually, so it's "and others".
|
||||
Source files contain the phrase "the mpg123 project" to the same effect
|
||||
in their license boilerplate; especially those that were added after
|
||||
maintainership changed. The person mainly responsible for the first version
|
||||
is usually named in the phrase "initially written by ...".
|
||||
|
||||
All files in the distribution that don't carry a license note on their own are
|
||||
licensed under the terms of the LGPL 2.1; exceptions may apply, especially to
|
||||
files not in the official distribution but in the revision control repository.
|
||||
|
||||
The formal license text follows.
|
||||
|
||||
=======================
|
||||
1. The LGPL version 2.1
|
||||
=======================
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
====================
|
||||
2. The GPL version 2
|
||||
====================
|
||||
|
||||
|
||||
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
|
||||
@@ -1,32 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_image/file/default/external
|
||||
---
|
||||
|
||||
Copyright (c) 2002-2008 Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,48 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_mixer/file/default/external
|
||||
---
|
||||
|
||||
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
|
||||
Jean-Marc Valin, Timothy B. Terriberry,
|
||||
CSIRO, Gregory Maxwell, Mark Borgerding,
|
||||
Erik de Castro Lopo
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
||||
names of specific contributors, may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Opus is subject to the royalty-free patent licenses which are
|
||||
specified at:
|
||||
|
||||
Xiph.Org Foundation:
|
||||
https://datatracker.ietf.org/ipr/1524/
|
||||
|
||||
Microsoft Corporation:
|
||||
https://datatracker.ietf.org/ipr/1914/
|
||||
|
||||
Broadcom Corporation:
|
||||
https://datatracker.ietf.org/ipr/1526/
|
||||
@@ -1,32 +0,0 @@
|
||||
The source code to this library used with SDL_mixer can be found here:
|
||||
https://hg.libsdl.org/SDL_mixer/file/default/external
|
||||
---
|
||||
|
||||
Copyright (c) 1994-2013 Xiph.Org Foundation and contributors
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.Org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,17 @@
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
+16
-39
@@ -1,54 +1,31 @@
|
||||
|
||||
SDL_mixer 2.0
|
||||
|
||||
The latest version of this library is available from:
|
||||
http://www.libsdl.org/projects/SDL_mixer/
|
||||
The latest version of this library is available from GitHub:
|
||||
https://github.com/libsdl-org/SDL_mixer/releases
|
||||
|
||||
Due to popular demand, here is a simple multi-channel audio mixer.
|
||||
It supports 8 channels of 16 bit stereo audio, plus a single channel
|
||||
of music.
|
||||
It supports 8 channels of 16 bit stereo audio, plus a single channel of music. It can load FLAC, MP3, Ogg, VOC, and WAV format audio. It can also load MIDI, MOD, and Opus audio, depending on build options (see the note below for details.)
|
||||
|
||||
See the header file SDL_mixer.h and the examples playwave.c and playmus.c
|
||||
for documentation on this mixer library.
|
||||
See the header file SDL_mixer.h and the examples playwave.c and playmus.c for documentation on this mixer library. This documentation is also available online at https://wiki.libsdl.org/SDL2_mixer
|
||||
|
||||
The mixer can currently load Microsoft WAVE files and Creative Labs VOC
|
||||
files as audio samples, it can load FLAC files with libFLAC, it can load
|
||||
Ogg Vorbis files with Ogg Vorbis or Tremor libraries, it can load MP3 files
|
||||
using mpg123 or libmad, and it can load MIDI files with Timidity,
|
||||
FluidSynth, and natively on Windows, Mac OSX, and Linux, and finally it can
|
||||
load the following file formats via ModPlug or MikMod: .MOD .S3M .IT .XM.
|
||||
The process of mixing MIDI files to wave output is very CPU intensive, so if playing regular WAVE files sound great, but playing MIDI files sound choppy, try using 8-bit audio, mono audio, or lower frequencies.
|
||||
|
||||
Tremor decoding is disabled by default; you can enable it by passing
|
||||
--enable-music-ogg-tremor
|
||||
to configure, or by defining MUSIC_OGG and OGG_USE_TREMOR.
|
||||
|
||||
libmad decoding is disabled by default; you can enable it by passing
|
||||
--enable-music-mp3-mad
|
||||
to configure, or by defining MUSIC_MP3_MAD
|
||||
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
WARNING: The license for libmad is GPL, which means that in order to
|
||||
use it your application must also be GPL!
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The process of mixing MIDI files to wave output is very CPU intensive,
|
||||
so if playing regular WAVE files sound great, but playing MIDI files
|
||||
sound choppy, try using 8-bit audio, mono audio, or lower frequencies.
|
||||
|
||||
To play MIDI files using FluidSynth, you'll need to set the SDL_SOUNDFONTS
|
||||
environment variable to a Sound Font 2 (.sf2) file containing the musical
|
||||
instruments you want to use for MIDI playback.
|
||||
If you have built with FluidSynth support, you'll need to set the SDL_SOUNDFONTS environment variable to a Sound Font 2 (.sf2) file containing the musical instruments you want to use for MIDI playback.
|
||||
(On some Linux distributions you can install the fluid-soundfont-gm package)
|
||||
|
||||
To play MIDI files using Timidity, you'll need to get a complete set of
|
||||
GUS patches from:
|
||||
To play MIDI files using Timidity, you'll need to get a complete set of GUS patches from:
|
||||
http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz
|
||||
and unpack them in /usr/local/lib under UNIX, and C:\ under Win32.
|
||||
|
||||
iOS:
|
||||
In order to use this library on iOS, you should include the SDL.xcodeproj
|
||||
and Xcode-iOS/SDL_mixer.xcodeproj in your application, add the SDL/include
|
||||
and SDL_mixer directories to your "Header Search Paths" setting, then add the
|
||||
libSDL2.a and libSDL2_mixer.a to your "Link Binary with Libraries" setting.
|
||||
This library is under the zlib license, see the file "LICENSE.txt" for details.
|
||||
|
||||
This library is under the zlib license, see the file "COPYING.txt" for details.
|
||||
Note:
|
||||
Support for software MIDI, MOD, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
|
||||
- When building with CMake, you can enable the appropriate SDL2MIXER_* options defined in CMakeLists.txt. SDL2MIXER_VENDORED allows switching between system and vendored libraries.
|
||||
- When building with configure/make, you can build and install them normally and the configure script will detect and use them.
|
||||
- When building with Visual Studio, you will need to build the libraries and then add the appropriate LOAD_* preprocessor define to the Visual Studio project.
|
||||
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
|
||||
- For Android, you can edit the config at the top of Android.mk to enable them.
|
||||
|
||||
The default MP3 support is provided using minimp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_FLAC QUIET flac)
|
||||
|
||||
find_library(FLAC_LIBRARY
|
||||
NAMES FLAC
|
||||
HINTS ${PC_FLAC_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(FLAC_INCLUDE_PATH
|
||||
NAMES FLAC/all.h
|
||||
HINTS ${PC_FLAC_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_FLAC_FOUND)
|
||||
get_flags_from_pkg_config("${FLAC_LIBRARY}" "PC_FLAC" "_flac")
|
||||
endif()
|
||||
|
||||
set(FLAC_COMPILE_OPTIONS "${_flac_compile_options}" CACHE STRING "Extra compile options of FLAC")
|
||||
|
||||
set(FLAC_LINK_LIBRARIES "${_flac_link_libraries}" CACHE STRING "Extra link libraries of FLAC")
|
||||
|
||||
set(FLAC_LINK_OPTIONS "${_flac_link_options}" CACHE STRING "Extra link flags of FLAC")
|
||||
|
||||
set(FLAC_LINK_DIRECTORIES "${_flac_link_directories}" CACHE PATH "Extra link directories of FLAC")
|
||||
|
||||
find_package_handle_standard_args(FLAC
|
||||
REQUIRED_VARS FLAC_LIBRARY FLAC_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(FLAC_FOUND)
|
||||
if(NOT TARGET FLAC::FLAC)
|
||||
add_library(FLAC::FLAC UNKNOWN IMPORTED)
|
||||
set_target_properties(FLAC::FLAC PROPERTIES
|
||||
IMPORTED_LOCATION "${FLAC_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FLAC_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FLAC_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${FLAC_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${FLAC_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_FLUIDSYNTH QUIET fluidsynth)
|
||||
|
||||
find_library(FluidSynth_LIBRARY
|
||||
NAMES fluidsynth libfluidsynth
|
||||
HINTS ${PC_FLUIDSYNTH_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(FluidSynth_INCLUDE_PATH
|
||||
NAMES fluidsynth.h
|
||||
HINTS ${PC_FLUIDSYNTH_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_FLUIDSYNTH_FOUND)
|
||||
get_flags_from_pkg_config("${FluidSynth_LIBRARY}" "PC_FLUIDSYNTH" "_fluidsynth")
|
||||
endif()
|
||||
|
||||
set(FluidSynth_COMPILE_OPTIONS "${_fluidsynth_compile_options}" CACHE STRING "Extra compile options of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_LIBRARIES "${_fluidsynth_link_libraries}" CACHE STRING "Extra link libraries of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_OPTIONS "${_fluidsynth_link_options}" CACHE STRING "Extra link flags of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_DIRECTORIES "${_fluidsynth_link_directories}" CACHE PATH "Extra link directories of FluidSynth")
|
||||
|
||||
find_package_handle_standard_args(FluidSynth
|
||||
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(FluidSynth_FOUND)
|
||||
if(NOT TARGET FluidSynth::libfluidsynth)
|
||||
add_library(FluidSynth::libfluidsynth UNKNOWN IMPORTED)
|
||||
set_target_properties(FluidSynth::libfluidsynth PROPERTIES
|
||||
IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FluidSynth_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FluidSynth_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${FluidSynth_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${FluidSynth_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,49 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_OPUSFILE QUIET opusfile)
|
||||
|
||||
find_library(OpusFile_LIBRARY
|
||||
NAMES opusfile
|
||||
HINTS ${PC_OPUSFILE_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(OpusFile_INCLUDE_PATH
|
||||
NAMES opusfile.h
|
||||
PATH_SUFFIXES opus
|
||||
HINTS ${PC_OPUSFILE_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_OPUSFILE_FOUND)
|
||||
get_flags_from_pkg_config("${OpusFile_LIBRARY}" "PC_OPUSFILE" "_opusfile")
|
||||
endif()
|
||||
|
||||
set(OpusFile_COMPILE_OPTIONS "${_opusfile_compile_options}" CACHE STRING "Extra compile options of opusfile")
|
||||
|
||||
set(OpusFile_LINK_LIBRARIES "${_opusfile_link_libraries}" CACHE STRING "Extra link libraries of opusfile")
|
||||
|
||||
set(OpusFile_LINK_OPTIONS "${_opusfile_link_options}" CACHE STRING "Extra link flags of opusfile")
|
||||
|
||||
set(OpusFile_LINK_DIRECTORIES "${_opusfile_link_directories}" CACHE PATH "Extra link directories of opusfile")
|
||||
|
||||
find_package_handle_standard_args(OpusFile
|
||||
REQUIRED_VARS OpusFile_LIBRARY OpusFile_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (OpusFile_FOUND)
|
||||
set(OpusFile_dirs ${OpusFile_INCLUDE_PATH})
|
||||
if(EXISTS "${OpusFile_INCLUDE_PATH}/opus")
|
||||
list(APPEND OpusFile_dirs "${OpusFile_INCLUDE_PATH}/opus")
|
||||
endif()
|
||||
if (NOT TARGET OpusFile::opusfile)
|
||||
add_library(OpusFile::opusfile UNKNOWN IMPORTED)
|
||||
set_target_properties(OpusFile::opusfile PROPERTIES
|
||||
IMPORTED_LOCATION "${OpusFile_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpusFile_dirs}"
|
||||
INTERFACE_COMPILE_OPTIONS "${OpusFile_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${OpusFile_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${OpusFile_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${OpusFile_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_VORBIS QUIET vorbisfile)
|
||||
|
||||
find_library(Vorbis_vorbisfile_LIBRARY
|
||||
NAMES vorbisfile
|
||||
HINTS ${PC_VORBIS_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(Vorbis_vorbisfile_INCLUDE_PATH
|
||||
NAMES vorbis/vorbisfile.h
|
||||
HINTS ${PC_VORBIS_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_VORBIS_FOUND)
|
||||
get_flags_from_pkg_config("${Vorbis_vorbisfile_LIBRARY}" "PC_VORBIS" "_vorbisfile")
|
||||
endif()
|
||||
|
||||
set(Vorbis_vorbisfile_COMPILE_OPTIONS "${_vorbisfile_compile_options}" CACHE STRING "Extra compile options of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_LIBRARIES "${_vorbisfile_link_libraries}" CACHE STRING "Extra link libraries of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_OPTIONS "${_vorbisfile_link_options}" CACHE STRING "Extra link flags of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_DIRECTORIES "${_vorbisfile_link_directories}" CACHE PATH "Extra link directories of vorbisfile")
|
||||
|
||||
find_package_handle_standard_args(Vorbis
|
||||
REQUIRED_VARS Vorbis_vorbisfile_LIBRARY Vorbis_vorbisfile_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (Vorbis_FOUND)
|
||||
if (NOT TARGET Vorbis::vorbisfile)
|
||||
add_library(Vorbis::vorbisfile UNKNOWN IMPORTED)
|
||||
set_target_properties(Vorbis::vorbisfile PROPERTIES
|
||||
IMPORTED_LOCATION "${Vorbis_vorbisfile_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Vorbis_vorbisfile_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${Vorbis_vorbisfile_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${Vorbis_vorbisfile_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${Vorbis_vorbisfile_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${Vorbis_vorbisfile_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,48 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_GME QUIET libgme)
|
||||
|
||||
find_library(gme_LIBRARY
|
||||
NAMES gme
|
||||
HINTS ${PC_GME_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(gme_INCLUDE_PATH
|
||||
NAMES gme/gme.h
|
||||
HINTS ${PC_GME_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_GME_FOUND)
|
||||
get_flags_from_pkg_config("${gme_LIBRARY}" "PC_GME" "_gme")
|
||||
endif()
|
||||
|
||||
set(gme_COMPILE_OPTIONS "${_gme_compile_options}" CACHE STRING "Extra compile options of gme")
|
||||
|
||||
set(gme_LINK_LIBRARIES "${_gme_link_libraries}" CACHE STRING "Extra link libraries of gme")
|
||||
|
||||
set(gme_LINK_OPTIONS "${_gme_link_options}" CACHE STRING "Extra link flags of gme")
|
||||
|
||||
set(gme_LINK_DIRECTORIES "${_gme_link_directories}" CACHE PATH "Extra link directories of gme")
|
||||
|
||||
find_package_handle_standard_args(gme
|
||||
REQUIRED_VARS gme_LIBRARY gme_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(gme_FOUND)
|
||||
set(gme_dirs ${gme_INCLUDE_PATH})
|
||||
if(EXISTS "${gme_INCLUDE_PATH}/gme")
|
||||
list(APPEND gme_dirs "${gme_INCLUDE_PATH}/gme")
|
||||
endif()
|
||||
if(NOT TARGET gme::gme)
|
||||
add_library(gme::gme UNKNOWN IMPORTED)
|
||||
set_target_properties(gme::gme PROPERTIES
|
||||
IMPORTED_LOCATION "${gme_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${gme_dirs}"
|
||||
INTERFACE_COMPILE_OPTIONS "${gme_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${gme_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${gme_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${gme_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,45 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_XMPLITE QUIET libxmp-lite)
|
||||
|
||||
find_library(libxmp_lite_LIBRARY
|
||||
NAMES xmp-lite libxmp-lite
|
||||
HINTS ${PC_XMPLITE_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(libxmp_lite_INCLUDE_PATH
|
||||
NAMES xmp.h
|
||||
PATH_SUFFIXES libxmp-lite
|
||||
HINTS ${PC_XMPLITE_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_XMPLITE_FOUND)
|
||||
get_flags_from_pkg_config("${libxmp_lite_LIBRARY}" "PC_XMPLITE" "_libxmp_lite")
|
||||
endif()
|
||||
|
||||
set(libxmp_lite_COMPILE_OPTIONS "${_libxmp_lite_compile_options}" CACHE STRING "Extra compile options of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_LIBRARIES "${_libxmp_lite_link_libraries}" CACHE STRING "Extra link libraries of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_OPTIONS "${_libxmp_lite_link_options}" CACHE STRING "Extra link flags of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_DIRECTORIES "${_libxmp_lite_link_directories}" CACHE PATH "Extra link directories of libxmp_lite")
|
||||
|
||||
find_package_handle_standard_args(libxmp-lite
|
||||
REQUIRED_VARS libxmp_lite_LIBRARY libxmp_lite_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(libxmp-lite_FOUND)
|
||||
if(NOT TARGET libxmp-lite::libxmp-lite)
|
||||
add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED)
|
||||
set_target_properties(libxmp-lite::libxmp-lite PROPERTIES
|
||||
IMPORTED_LOCATION "${libxmp_lite_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libxmp_lite_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${libxmp_lite_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${libxmp_lite_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_XMP QUIET libxmp)
|
||||
|
||||
find_library(libxmp_LIBRARY
|
||||
NAMES xmp
|
||||
HINTS ${PC_XMP_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(libxmp_INCLUDE_PATH
|
||||
NAMES xmp.h
|
||||
HINTS ${PC_XMP_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_XMP_FOUND)
|
||||
get_flags_from_pkg_config("${libxmp_LIBRARY}" "PC_XMP" "_libxmp")
|
||||
endif()
|
||||
|
||||
set(libxmp_COMPILE_OPTIONS "${_libxmp_compile_options}" CACHE STRING "Extra compile options of libxmp")
|
||||
|
||||
set(libxmp_LINK_LIBRARIES "${_libxmp_link_libraries}" CACHE STRING "Extra link libraries of libxmp")
|
||||
|
||||
set(libxmp_LINK_OPTIONS "${_libxmp_link_options}" CACHE STRING "Extra link flags of libxmp")
|
||||
|
||||
set(libxmp_LINK_DIRECTORIES "${_libxmp_link_directories}" CACHE PATH "Extra link flags of libxmp")
|
||||
|
||||
find_package_handle_standard_args(libxmp
|
||||
REQUIRED_VARS libxmp_LIBRARY libxmp_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(libxmp_FOUND)
|
||||
if(NOT TARGET libxmp::libxmp)
|
||||
add_library(libxmp::libxmp UNKNOWN IMPORTED)
|
||||
set_target_properties(libxmp::libxmp PROPERTIES
|
||||
IMPORTED_LOCATION "${libxmp_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libxmp_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libxmp_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${libxmp_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${libxmp_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,43 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MODPLUG QUIET libmodplug)
|
||||
|
||||
find_library(modplug_LIBRARY
|
||||
NAMES modplug
|
||||
)
|
||||
|
||||
find_path(modplug_INCLUDE_PATH
|
||||
NAMES libmodplug/modplug.h
|
||||
)
|
||||
|
||||
if(PC_MODPLUG_FOUND)
|
||||
get_flags_from_pkg_config("${modplug_LIBRARY}" "PC_MODPLUG" "_modplug")
|
||||
endif()
|
||||
|
||||
set(modplug_COMPILE_OPTIONS "${_modplug_compile_options}" CACHE STRING "Extra compile options of modplug")
|
||||
|
||||
set(modplug_LINK_LIBRARIES "${_modplug_link_libraries}" CACHE STRING "Extra link libraries of modplug")
|
||||
|
||||
set(modplug_LINK_OPTIONS "${_modplug_link_options}" CACHE STRING "Extra link flags of modplug")
|
||||
|
||||
set(modplug_LINK_DIRECTORIES "${_modplug_link_directories}" CACHE PATH "Extra link directories of modplug")
|
||||
|
||||
find_package_handle_standard_args(modplug
|
||||
REQUIRED_VARS modplug_LIBRARY modplug_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (modplug_FOUND)
|
||||
if (NOT TARGET modplug::modplug)
|
||||
add_library(modplug::modplug UNKNOWN IMPORTED)
|
||||
set_target_properties(modplug::modplug PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${modplug_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${modplug_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${modplug_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${modplug_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${modplug_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${modplug_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MPG123 QUIET libmpg123)
|
||||
|
||||
find_library(mpg123_LIBRARY
|
||||
NAMES mpg123
|
||||
HINTS ${PC_MPG123_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(mpg123_INCLUDE_PATH
|
||||
NAMES mpg123.h
|
||||
HINTS ${PC_MPG123_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_MPG123_FOUND)
|
||||
get_flags_from_pkg_config("${mpg123_LIBRARY}" "PC_MPG123" "_mpg123")
|
||||
endif()
|
||||
|
||||
set(mpg123_COMPILE_OPTIONS "${_mpg123_compile_options}" CACHE STRING "Extra compile options of mpg123")
|
||||
|
||||
set(mpg123_LINK_LIBRARIES "${_mpg123_link_libraries}" CACHE STRING "Extra link libraries of mpg123")
|
||||
|
||||
set(mpg123_LINK_OPTIONS "${_mpg123_link_options}" CACHE STRING "Extra link flags of mpg123")
|
||||
|
||||
set(mpg123_LINK_DIRECTORIES "${_mpg123_link_directories}" CACHE PATH "Extra link directories of mpg123")
|
||||
|
||||
find_package_handle_standard_args(mpg123
|
||||
REQUIRED_VARS mpg123_LIBRARY mpg123_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(mpg123_FOUND)
|
||||
if(NOT TARGET MPG123::libmpg123)
|
||||
add_library(MPG123::libmpg123 UNKNOWN IMPORTED)
|
||||
set_target_properties(MPG123::libmpg123 PROPERTIES
|
||||
IMPORTED_LOCATION "${mpg123_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${mpg123_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${mpg123_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${mpg123_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${mpg123_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${mpg123_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_TREMOR QUIET vorbisidec)
|
||||
|
||||
find_library(tremor_LIBRARY
|
||||
NAMES vorbisidec libvorbisidec
|
||||
HINTS ${PC_TREMOR_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(tremor_INCLUDE_PATH
|
||||
NAMES tremor/ivorbisfile.h
|
||||
HINTS ${PC_TREMOR_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_TREMOR_FOUND)
|
||||
get_flags_from_pkg_config("${tremor_LIBRARY}" "PC_TREMOR" "_tremor")
|
||||
endif()
|
||||
|
||||
set(tremor_COMPILE_OPTIONS "${_tremor_compile_options}" CACHE STRING "Extra compile options of vorbis")
|
||||
|
||||
set(tremor_LINK_LIBRARIES "${_tremor_link_libraries}" CACHE STRING "Extra link libraries of vorbis")
|
||||
|
||||
set(tremor_LINK_OPTIONS "${_tremor_link_options}" CACHE STRING "Extra link flags of vorbis")
|
||||
|
||||
set(tremor_LINK_DIRECTORIES "${_tremor_link_directories}" CACHE PATH "Extra link directories of vorbis")
|
||||
|
||||
find_package_handle_standard_args(tremor
|
||||
REQUIRED_VARS tremor_LIBRARY tremor_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (tremor_FOUND)
|
||||
if (NOT TARGET tremor::tremor)
|
||||
add_library(tremor::tremor UNKNOWN IMPORTED)
|
||||
set_target_properties(tremor::tremor PROPERTIES
|
||||
IMPORTED_LOCATION "${tremor_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${tremor_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${tremor_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${tremor_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${tremor_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${tremor_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,37 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if(WIN32)
|
||||
set(wavpack_find_names wavpack libwavpack wavpackdll)
|
||||
else()
|
||||
set(wavpack_find_names wavpack)
|
||||
endif()
|
||||
find_library(wavpack_LIBRARY
|
||||
NAMES ${wavpack_find_names}
|
||||
)
|
||||
|
||||
find_path(wavpack_INCLUDE_PATH
|
||||
NAMES wavpack/wavpack.h
|
||||
)
|
||||
|
||||
set(wavpack_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of wavpack")
|
||||
|
||||
set(wavpack_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of wavpack")
|
||||
|
||||
set(wavpack_LINK_OPTIONS "" CACHE STRING "Extra link flags of wavpack")
|
||||
|
||||
find_package_handle_standard_args(wavpack
|
||||
REQUIRED_VARS wavpack_LIBRARY wavpack_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (wavpack_FOUND)
|
||||
if (NOT TARGET WavPack::WavPack)
|
||||
add_library(WavPack::WavPack UNKNOWN IMPORTED)
|
||||
set_target_properties(WavPack::WavPack PROPERTIES
|
||||
IMPORTED_LOCATION "${wavpack_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${wavpack_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${wavpack_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${wavpack_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${wavpack_LINK_OPTIONS}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,34 @@
|
||||
# Helper for Find modules
|
||||
|
||||
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
|
||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
||||
else()
|
||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
|
||||
endif()
|
||||
|
||||
# The *_LIBRARIES lists always start with the library itself
|
||||
list(POP_FRONT "${_link_libraries}")
|
||||
|
||||
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
|
||||
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
|
||||
|
||||
set(${_out_prefix}_compile_options
|
||||
"${${_cflags}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_libraries
|
||||
"${${_link_libraries}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_options
|
||||
"${_filtered_link_options}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_directories
|
||||
"${${_library_dirs}}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,12 @@
|
||||
# sdl2_mixer cmake project-config-version input for ./configure scripts
|
||||
|
||||
set(PACKAGE_VERSION "2.8.1")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,195 @@
|
||||
# sdl2_mixer cmake project-config input for ./configure scripts
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL2_mixer PROPERTIES
|
||||
URL "https://www.libsdl.org/projects/SDL_mixer/"
|
||||
DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library"
|
||||
)
|
||||
|
||||
set(SDL2_mixer_FOUND TRUE)
|
||||
|
||||
set(SDL2MIXER_VENDORED 0)
|
||||
|
||||
set(SDL2MIXER_CMD 0)
|
||||
|
||||
set(SDL2MIXER_FLAC_LIBFLAC 0)
|
||||
set(SDL2MIXER_FLAC_DRFLAC 1)
|
||||
if(SDL2MIXER_FLAC_LIBFLAC OR SDL2MIXER_FLAC_DRFLAC)
|
||||
set(SDL2MIXER_FLAC 1)
|
||||
else()
|
||||
set(SDL2MIXER_FLAC 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_GME 1)
|
||||
|
||||
set(SDL2MIXER_MOD_MODPLUG 0)
|
||||
set(SDL2MIXER_MOD_XMP 1)
|
||||
set(SDL2MIXER_MOD_XMP_LITE 0)
|
||||
if(SDL2MIXER_MOD_MODPLUG OR SDL2MIXER_MOD_XMP OR SDL2MIXER_MOD_XMP_LITE)
|
||||
set(SDL2MIXER_MOD 1)
|
||||
else()
|
||||
set(SDL2MIXER_MOD 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_MP3_MINIMP3 1)
|
||||
set(SDL2MIXER_MP3_MPG123 0)
|
||||
if(SDL2MIXER_MP3_MINIMP3 OR SDL2MIXER_MP3_MPG123)
|
||||
set(SDL2MIXER_MP3 1)
|
||||
else()
|
||||
set(SDL2MIXER_MP3 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_MIDI_FLUIDSYNTH 0)
|
||||
set(SDL2MIXER_MIDI_NATIVE 1)
|
||||
set(SDL2MIXER_MIDI_TIMIDITY 1)
|
||||
if(SDL2MIXER_MIDI_FLUIDSYNTH OR SDL2MIXER_MIDI_NATIVE OR SDL2MIXER_MIDI_TIMIDITY)
|
||||
set(SDL2MIXER_MIDI 1)
|
||||
else()
|
||||
set(SDL2MIXER_MIDI 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_OPUS 1)
|
||||
|
||||
set(SDL2MIXER_VORBIS)
|
||||
set(SDL2MIXER_VORBIS_STB 1)
|
||||
set(SDL2MIXER_VORBIS_VORBISFILE 0)
|
||||
set(SDL2MIXER_VORBIS_TREMOR 0)
|
||||
if(SDL2MIXER_VORBIS_STB)
|
||||
set(SDL2MIXER_VORBIS STB)
|
||||
endif()
|
||||
if(SDL2MIXER_VORBIS_VORBISFILE)
|
||||
set(SDL2MIXER_VORBIS VORBISFILE)
|
||||
endif()
|
||||
if(SDL2MIXER_VORBIS_TREMOR)
|
||||
set(SDL2MIXER_VORBIS TREMOR)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_WAVE 1)
|
||||
|
||||
set(SDL2MIXER_WAVPACK 1)
|
||||
|
||||
set(SDL2MIXER_SDL2_REQUIRED_VERSION 2.0.9)
|
||||
|
||||
get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR} REALPATH)
|
||||
get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
|
||||
set(exec_prefix "${prefix}")
|
||||
set(bindir "${prefix}/bin")
|
||||
set(includedir "${prefix}/include")
|
||||
set(libdir "${prefix}/lib")
|
||||
set(_sdl2mixer_extra_static_libraries ";winmm")
|
||||
string(REGEX REPLACE "(^[;]+|[;]+$)" "" _sdl2mixer_extra_static_libraries "${_sdl2mixer_extra_static_libraries}")
|
||||
|
||||
set(_sdl2mixer_bindir "${bindir}")
|
||||
set(_sdl2mixer_libdir "${libdir}")
|
||||
set(_sdl2mixer_incdir "${includedir}/SDL2")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
set(_original_cmake_module_path "${CMAKE_MODULE_PATH}")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PkgConfigHelper.cmake")
|
||||
|
||||
if("modplug::modplug" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(modplug)
|
||||
endif()
|
||||
|
||||
if("libxmp::libxmp" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(libxmp)
|
||||
endif()
|
||||
|
||||
if("libxmp-lite::libxmp-lite" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(libxmp-lite)
|
||||
endif()
|
||||
|
||||
if("FluidSynth::libfluidsynth" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(FluidSynth)
|
||||
endif()
|
||||
|
||||
if("Vorbis::vorbisfile" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(Vorbis)
|
||||
endif()
|
||||
|
||||
if("tremor::tremor" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(tremor)
|
||||
endif()
|
||||
|
||||
if("FLAC::FLAC" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(FLAC)
|
||||
endif()
|
||||
|
||||
if("MPG123::libmpg123" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(mpg123)
|
||||
endif()
|
||||
|
||||
if("OpusFile::opusfile" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(OpusFile)
|
||||
endif()
|
||||
|
||||
if("WavPack::WavPack" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(wavpack)
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH "${_original_cmake_module_path}")
|
||||
unset(_original_cmake_module_path)
|
||||
|
||||
unset(prefix)
|
||||
unset(exec_prefix)
|
||||
unset(bindir)
|
||||
unset(includedir)
|
||||
unset(libdir)
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT TARGET SDL2_mixer::SDL2_mixer)
|
||||
if(WIN32)
|
||||
set(_sdl2mixer_dll "${_sdl2mixer_bindir}/SDL2_mixer.dll")
|
||||
set(_sdl2mixer_imp "${_sdl2mixer_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_mixer.dll${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_dll}" AND EXISTS "${_sdl2mixer_imp}")
|
||||
add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${_sdl2mixer_dll}"
|
||||
IMPORTED_IMPLIB "${_sdl2mixer_imp}"
|
||||
)
|
||||
endif()
|
||||
unset(_sdl2mixer_dll)
|
||||
unset(_sdl2mixer_imp)
|
||||
else()
|
||||
set(_sdl2mixer_shl "${_sdl2mixer_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_mixer${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_shl}")
|
||||
add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${_sdl2mixer_shl}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(TARGET SDL2_mixer::SDL2_mixer)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_sdl2mixer_incdir}"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||
INTERFACE_SDL2_SHARED "ON"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET SDL2_mixer::SDL2_mixer-static)
|
||||
set(_sdl2mixer_stl "${_sdl2mixer_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_mixer${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_stl}")
|
||||
add_library(SDL2_mixer::SDL2_mixer-static STATIC IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer-static
|
||||
PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_sdl2mixer_incdir}"
|
||||
IMPORTED_LOCATION "${_sdl2mixer_stl}"
|
||||
INTERFACE_LINK_LIBRARIES "${_sdl2mixer_extra_static_libraries}"
|
||||
)
|
||||
endif()
|
||||
unset(_sdl2mixer_stl)
|
||||
endif()
|
||||
|
||||
unset(_sdl2mixer_extra_static_libraries)
|
||||
unset(_sdl2mixer_bindir)
|
||||
unset(_sdl2mixer_libdir)
|
||||
unset(_sdl2mixer_incdir)
|
||||
Binary file not shown.
Binary file not shown.
@@ -17,15 +17,15 @@ old_library='libSDL2_mixer.a'
|
||||
inherited_linker_flags=''
|
||||
|
||||
# Libraries that this one depends upon.
|
||||
dependency_libs=' -L/opt/local/i686-w64-mingw32/lib -lmingw32 /opt/local/i686-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -lwinmm'
|
||||
dependency_libs=' -L/tmp/tardir/SDL2_mixer-2.8.1/VisualC/external/optional/x86 -L/home/runner/work/SDL_mixer/SDL_mixer/deps/mingw-deps/i686-w64-mingw32/lib -lmingw32 /home/runner/work/SDL_mixer/SDL_mixer/deps/mingw-deps/i686-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -lwinmm'
|
||||
|
||||
# Names of additional weak libraries provided by this library
|
||||
weak_library_names=''
|
||||
|
||||
# Version information for libSDL2_mixer.
|
||||
current=2
|
||||
age=2
|
||||
revision=2
|
||||
current=800
|
||||
age=800
|
||||
revision=1
|
||||
|
||||
# Is this an already installed library?
|
||||
installed=yes
|
||||
@@ -38,4 +38,4 @@ dlopen=''
|
||||
dlpreopen=''
|
||||
|
||||
# Directory that this library needs to be installed in:
|
||||
libdir='/Users/valve/release/SDL_mixer/SDL2_mixer-2.0.4/i686-w64-mingw32/lib'
|
||||
libdir='/tmp/tardir/SDL2_mixer-2.8.1/build-mingw/install-i686-w64-mingw32/lib'
|
||||
@@ -1,12 +1,13 @@
|
||||
prefix=/opt/local/i686-w64-mingw32
|
||||
prefix=/tmp/tardir/SDL2_mixer-2.8.1/build-mingw/install-i686-w64-mingw32
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: SDL2_mixer
|
||||
Description: mixer library for Simple DirectMedia Layer
|
||||
Version: 2.0.4
|
||||
Requires: sdl2 >= 2.0.7
|
||||
Version: 2.8.1
|
||||
Requires: sdl2 >= 2.0.9
|
||||
Libs: -L${libdir} -lSDL2_mixer
|
||||
Cflags: -I${includedir}/SDL2
|
||||
|
||||
Requires.private:
|
||||
Libs.private: -lwinmm
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_FLAC QUIET flac)
|
||||
|
||||
find_library(FLAC_LIBRARY
|
||||
NAMES FLAC
|
||||
HINTS ${PC_FLAC_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(FLAC_INCLUDE_PATH
|
||||
NAMES FLAC/all.h
|
||||
HINTS ${PC_FLAC_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_FLAC_FOUND)
|
||||
get_flags_from_pkg_config("${FLAC_LIBRARY}" "PC_FLAC" "_flac")
|
||||
endif()
|
||||
|
||||
set(FLAC_COMPILE_OPTIONS "${_flac_compile_options}" CACHE STRING "Extra compile options of FLAC")
|
||||
|
||||
set(FLAC_LINK_LIBRARIES "${_flac_link_libraries}" CACHE STRING "Extra link libraries of FLAC")
|
||||
|
||||
set(FLAC_LINK_OPTIONS "${_flac_link_options}" CACHE STRING "Extra link flags of FLAC")
|
||||
|
||||
set(FLAC_LINK_DIRECTORIES "${_flac_link_directories}" CACHE PATH "Extra link directories of FLAC")
|
||||
|
||||
find_package_handle_standard_args(FLAC
|
||||
REQUIRED_VARS FLAC_LIBRARY FLAC_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(FLAC_FOUND)
|
||||
if(NOT TARGET FLAC::FLAC)
|
||||
add_library(FLAC::FLAC UNKNOWN IMPORTED)
|
||||
set_target_properties(FLAC::FLAC PROPERTIES
|
||||
IMPORTED_LOCATION "${FLAC_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FLAC_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FLAC_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${FLAC_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${FLAC_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_FLUIDSYNTH QUIET fluidsynth)
|
||||
|
||||
find_library(FluidSynth_LIBRARY
|
||||
NAMES fluidsynth libfluidsynth
|
||||
HINTS ${PC_FLUIDSYNTH_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(FluidSynth_INCLUDE_PATH
|
||||
NAMES fluidsynth.h
|
||||
HINTS ${PC_FLUIDSYNTH_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_FLUIDSYNTH_FOUND)
|
||||
get_flags_from_pkg_config("${FluidSynth_LIBRARY}" "PC_FLUIDSYNTH" "_fluidsynth")
|
||||
endif()
|
||||
|
||||
set(FluidSynth_COMPILE_OPTIONS "${_fluidsynth_compile_options}" CACHE STRING "Extra compile options of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_LIBRARIES "${_fluidsynth_link_libraries}" CACHE STRING "Extra link libraries of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_OPTIONS "${_fluidsynth_link_options}" CACHE STRING "Extra link flags of FluidSynth")
|
||||
|
||||
set(FluidSynth_LINK_DIRECTORIES "${_fluidsynth_link_directories}" CACHE PATH "Extra link directories of FluidSynth")
|
||||
|
||||
find_package_handle_standard_args(FluidSynth
|
||||
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(FluidSynth_FOUND)
|
||||
if(NOT TARGET FluidSynth::libfluidsynth)
|
||||
add_library(FluidSynth::libfluidsynth UNKNOWN IMPORTED)
|
||||
set_target_properties(FluidSynth::libfluidsynth PROPERTIES
|
||||
IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FluidSynth_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FluidSynth_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${FluidSynth_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${FluidSynth_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,49 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_OPUSFILE QUIET opusfile)
|
||||
|
||||
find_library(OpusFile_LIBRARY
|
||||
NAMES opusfile
|
||||
HINTS ${PC_OPUSFILE_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(OpusFile_INCLUDE_PATH
|
||||
NAMES opusfile.h
|
||||
PATH_SUFFIXES opus
|
||||
HINTS ${PC_OPUSFILE_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_OPUSFILE_FOUND)
|
||||
get_flags_from_pkg_config("${OpusFile_LIBRARY}" "PC_OPUSFILE" "_opusfile")
|
||||
endif()
|
||||
|
||||
set(OpusFile_COMPILE_OPTIONS "${_opusfile_compile_options}" CACHE STRING "Extra compile options of opusfile")
|
||||
|
||||
set(OpusFile_LINK_LIBRARIES "${_opusfile_link_libraries}" CACHE STRING "Extra link libraries of opusfile")
|
||||
|
||||
set(OpusFile_LINK_OPTIONS "${_opusfile_link_options}" CACHE STRING "Extra link flags of opusfile")
|
||||
|
||||
set(OpusFile_LINK_DIRECTORIES "${_opusfile_link_directories}" CACHE PATH "Extra link directories of opusfile")
|
||||
|
||||
find_package_handle_standard_args(OpusFile
|
||||
REQUIRED_VARS OpusFile_LIBRARY OpusFile_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (OpusFile_FOUND)
|
||||
set(OpusFile_dirs ${OpusFile_INCLUDE_PATH})
|
||||
if(EXISTS "${OpusFile_INCLUDE_PATH}/opus")
|
||||
list(APPEND OpusFile_dirs "${OpusFile_INCLUDE_PATH}/opus")
|
||||
endif()
|
||||
if (NOT TARGET OpusFile::opusfile)
|
||||
add_library(OpusFile::opusfile UNKNOWN IMPORTED)
|
||||
set_target_properties(OpusFile::opusfile PROPERTIES
|
||||
IMPORTED_LOCATION "${OpusFile_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpusFile_dirs}"
|
||||
INTERFACE_COMPILE_OPTIONS "${OpusFile_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${OpusFile_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${OpusFile_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${OpusFile_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_VORBIS QUIET vorbisfile)
|
||||
|
||||
find_library(Vorbis_vorbisfile_LIBRARY
|
||||
NAMES vorbisfile
|
||||
HINTS ${PC_VORBIS_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(Vorbis_vorbisfile_INCLUDE_PATH
|
||||
NAMES vorbis/vorbisfile.h
|
||||
HINTS ${PC_VORBIS_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_VORBIS_FOUND)
|
||||
get_flags_from_pkg_config("${Vorbis_vorbisfile_LIBRARY}" "PC_VORBIS" "_vorbisfile")
|
||||
endif()
|
||||
|
||||
set(Vorbis_vorbisfile_COMPILE_OPTIONS "${_vorbisfile_compile_options}" CACHE STRING "Extra compile options of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_LIBRARIES "${_vorbisfile_link_libraries}" CACHE STRING "Extra link libraries of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_OPTIONS "${_vorbisfile_link_options}" CACHE STRING "Extra link flags of vorbisfile")
|
||||
|
||||
set(Vorbis_vorbisfile_LINK_DIRECTORIES "${_vorbisfile_link_directories}" CACHE PATH "Extra link directories of vorbisfile")
|
||||
|
||||
find_package_handle_standard_args(Vorbis
|
||||
REQUIRED_VARS Vorbis_vorbisfile_LIBRARY Vorbis_vorbisfile_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (Vorbis_FOUND)
|
||||
if (NOT TARGET Vorbis::vorbisfile)
|
||||
add_library(Vorbis::vorbisfile UNKNOWN IMPORTED)
|
||||
set_target_properties(Vorbis::vorbisfile PROPERTIES
|
||||
IMPORTED_LOCATION "${Vorbis_vorbisfile_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Vorbis_vorbisfile_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${Vorbis_vorbisfile_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${Vorbis_vorbisfile_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${Vorbis_vorbisfile_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${Vorbis_vorbisfile_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,48 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_GME QUIET libgme)
|
||||
|
||||
find_library(gme_LIBRARY
|
||||
NAMES gme
|
||||
HINTS ${PC_GME_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(gme_INCLUDE_PATH
|
||||
NAMES gme/gme.h
|
||||
HINTS ${PC_GME_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_GME_FOUND)
|
||||
get_flags_from_pkg_config("${gme_LIBRARY}" "PC_GME" "_gme")
|
||||
endif()
|
||||
|
||||
set(gme_COMPILE_OPTIONS "${_gme_compile_options}" CACHE STRING "Extra compile options of gme")
|
||||
|
||||
set(gme_LINK_LIBRARIES "${_gme_link_libraries}" CACHE STRING "Extra link libraries of gme")
|
||||
|
||||
set(gme_LINK_OPTIONS "${_gme_link_options}" CACHE STRING "Extra link flags of gme")
|
||||
|
||||
set(gme_LINK_DIRECTORIES "${_gme_link_directories}" CACHE PATH "Extra link directories of gme")
|
||||
|
||||
find_package_handle_standard_args(gme
|
||||
REQUIRED_VARS gme_LIBRARY gme_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(gme_FOUND)
|
||||
set(gme_dirs ${gme_INCLUDE_PATH})
|
||||
if(EXISTS "${gme_INCLUDE_PATH}/gme")
|
||||
list(APPEND gme_dirs "${gme_INCLUDE_PATH}/gme")
|
||||
endif()
|
||||
if(NOT TARGET gme::gme)
|
||||
add_library(gme::gme UNKNOWN IMPORTED)
|
||||
set_target_properties(gme::gme PROPERTIES
|
||||
IMPORTED_LOCATION "${gme_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${gme_dirs}"
|
||||
INTERFACE_COMPILE_OPTIONS "${gme_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${gme_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${gme_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${gme_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,45 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_XMPLITE QUIET libxmp-lite)
|
||||
|
||||
find_library(libxmp_lite_LIBRARY
|
||||
NAMES xmp-lite libxmp-lite
|
||||
HINTS ${PC_XMPLITE_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(libxmp_lite_INCLUDE_PATH
|
||||
NAMES xmp.h
|
||||
PATH_SUFFIXES libxmp-lite
|
||||
HINTS ${PC_XMPLITE_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_XMPLITE_FOUND)
|
||||
get_flags_from_pkg_config("${libxmp_lite_LIBRARY}" "PC_XMPLITE" "_libxmp_lite")
|
||||
endif()
|
||||
|
||||
set(libxmp_lite_COMPILE_OPTIONS "${_libxmp_lite_compile_options}" CACHE STRING "Extra compile options of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_LIBRARIES "${_libxmp_lite_link_libraries}" CACHE STRING "Extra link libraries of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_OPTIONS "${_libxmp_lite_link_options}" CACHE STRING "Extra link flags of libxmp_lite")
|
||||
|
||||
set(libxmp_lite_LINK_DIRECTORIES "${_libxmp_lite_link_directories}" CACHE PATH "Extra link directories of libxmp_lite")
|
||||
|
||||
find_package_handle_standard_args(libxmp-lite
|
||||
REQUIRED_VARS libxmp_lite_LIBRARY libxmp_lite_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(libxmp-lite_FOUND)
|
||||
if(NOT TARGET libxmp-lite::libxmp-lite)
|
||||
add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED)
|
||||
set_target_properties(libxmp-lite::libxmp-lite PROPERTIES
|
||||
IMPORTED_LOCATION "${libxmp_lite_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libxmp_lite_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${libxmp_lite_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${libxmp_lite_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_XMP QUIET libxmp)
|
||||
|
||||
find_library(libxmp_LIBRARY
|
||||
NAMES xmp
|
||||
HINTS ${PC_XMP_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(libxmp_INCLUDE_PATH
|
||||
NAMES xmp.h
|
||||
HINTS ${PC_XMP_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_XMP_FOUND)
|
||||
get_flags_from_pkg_config("${libxmp_LIBRARY}" "PC_XMP" "_libxmp")
|
||||
endif()
|
||||
|
||||
set(libxmp_COMPILE_OPTIONS "${_libxmp_compile_options}" CACHE STRING "Extra compile options of libxmp")
|
||||
|
||||
set(libxmp_LINK_LIBRARIES "${_libxmp_link_libraries}" CACHE STRING "Extra link libraries of libxmp")
|
||||
|
||||
set(libxmp_LINK_OPTIONS "${_libxmp_link_options}" CACHE STRING "Extra link flags of libxmp")
|
||||
|
||||
set(libxmp_LINK_DIRECTORIES "${_libxmp_link_directories}" CACHE PATH "Extra link flags of libxmp")
|
||||
|
||||
find_package_handle_standard_args(libxmp
|
||||
REQUIRED_VARS libxmp_LIBRARY libxmp_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(libxmp_FOUND)
|
||||
if(NOT TARGET libxmp::libxmp)
|
||||
add_library(libxmp::libxmp UNKNOWN IMPORTED)
|
||||
set_target_properties(libxmp::libxmp PROPERTIES
|
||||
IMPORTED_LOCATION "${libxmp_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libxmp_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${libxmp_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${libxmp_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${libxmp_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,43 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MODPLUG QUIET libmodplug)
|
||||
|
||||
find_library(modplug_LIBRARY
|
||||
NAMES modplug
|
||||
)
|
||||
|
||||
find_path(modplug_INCLUDE_PATH
|
||||
NAMES libmodplug/modplug.h
|
||||
)
|
||||
|
||||
if(PC_MODPLUG_FOUND)
|
||||
get_flags_from_pkg_config("${modplug_LIBRARY}" "PC_MODPLUG" "_modplug")
|
||||
endif()
|
||||
|
||||
set(modplug_COMPILE_OPTIONS "${_modplug_compile_options}" CACHE STRING "Extra compile options of modplug")
|
||||
|
||||
set(modplug_LINK_LIBRARIES "${_modplug_link_libraries}" CACHE STRING "Extra link libraries of modplug")
|
||||
|
||||
set(modplug_LINK_OPTIONS "${_modplug_link_options}" CACHE STRING "Extra link flags of modplug")
|
||||
|
||||
set(modplug_LINK_DIRECTORIES "${_modplug_link_directories}" CACHE PATH "Extra link directories of modplug")
|
||||
|
||||
find_package_handle_standard_args(modplug
|
||||
REQUIRED_VARS modplug_LIBRARY modplug_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (modplug_FOUND)
|
||||
if (NOT TARGET modplug::modplug)
|
||||
add_library(modplug::modplug UNKNOWN IMPORTED)
|
||||
set_target_properties(modplug::modplug PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${modplug_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${modplug_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${modplug_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${modplug_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${modplug_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${modplug_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_MPG123 QUIET libmpg123)
|
||||
|
||||
find_library(mpg123_LIBRARY
|
||||
NAMES mpg123
|
||||
HINTS ${PC_MPG123_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(mpg123_INCLUDE_PATH
|
||||
NAMES mpg123.h
|
||||
HINTS ${PC_MPG123_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_MPG123_FOUND)
|
||||
get_flags_from_pkg_config("${mpg123_LIBRARY}" "PC_MPG123" "_mpg123")
|
||||
endif()
|
||||
|
||||
set(mpg123_COMPILE_OPTIONS "${_mpg123_compile_options}" CACHE STRING "Extra compile options of mpg123")
|
||||
|
||||
set(mpg123_LINK_LIBRARIES "${_mpg123_link_libraries}" CACHE STRING "Extra link libraries of mpg123")
|
||||
|
||||
set(mpg123_LINK_OPTIONS "${_mpg123_link_options}" CACHE STRING "Extra link flags of mpg123")
|
||||
|
||||
set(mpg123_LINK_DIRECTORIES "${_mpg123_link_directories}" CACHE PATH "Extra link directories of mpg123")
|
||||
|
||||
find_package_handle_standard_args(mpg123
|
||||
REQUIRED_VARS mpg123_LIBRARY mpg123_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if(mpg123_FOUND)
|
||||
if(NOT TARGET MPG123::libmpg123)
|
||||
add_library(MPG123::libmpg123 UNKNOWN IMPORTED)
|
||||
set_target_properties(MPG123::libmpg123 PROPERTIES
|
||||
IMPORTED_LOCATION "${mpg123_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${mpg123_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${mpg123_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${mpg123_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${mpg123_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${mpg123_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,44 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_TREMOR QUIET vorbisidec)
|
||||
|
||||
find_library(tremor_LIBRARY
|
||||
NAMES vorbisidec libvorbisidec
|
||||
HINTS ${PC_TREMOR_LIBDIR}
|
||||
)
|
||||
|
||||
find_path(tremor_INCLUDE_PATH
|
||||
NAMES tremor/ivorbisfile.h
|
||||
HINTS ${PC_TREMOR_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if(PC_TREMOR_FOUND)
|
||||
get_flags_from_pkg_config("${tremor_LIBRARY}" "PC_TREMOR" "_tremor")
|
||||
endif()
|
||||
|
||||
set(tremor_COMPILE_OPTIONS "${_tremor_compile_options}" CACHE STRING "Extra compile options of vorbis")
|
||||
|
||||
set(tremor_LINK_LIBRARIES "${_tremor_link_libraries}" CACHE STRING "Extra link libraries of vorbis")
|
||||
|
||||
set(tremor_LINK_OPTIONS "${_tremor_link_options}" CACHE STRING "Extra link flags of vorbis")
|
||||
|
||||
set(tremor_LINK_DIRECTORIES "${_tremor_link_directories}" CACHE PATH "Extra link directories of vorbis")
|
||||
|
||||
find_package_handle_standard_args(tremor
|
||||
REQUIRED_VARS tremor_LIBRARY tremor_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (tremor_FOUND)
|
||||
if (NOT TARGET tremor::tremor)
|
||||
add_library(tremor::tremor UNKNOWN IMPORTED)
|
||||
set_target_properties(tremor::tremor PROPERTIES
|
||||
IMPORTED_LOCATION "${tremor_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${tremor_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${tremor_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${tremor_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${tremor_LINK_OPTIONS}"
|
||||
INTERFACE_LINK_DIRECTORIES "${tremor_LINK_DIRECTORIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,37 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if(WIN32)
|
||||
set(wavpack_find_names wavpack libwavpack wavpackdll)
|
||||
else()
|
||||
set(wavpack_find_names wavpack)
|
||||
endif()
|
||||
find_library(wavpack_LIBRARY
|
||||
NAMES ${wavpack_find_names}
|
||||
)
|
||||
|
||||
find_path(wavpack_INCLUDE_PATH
|
||||
NAMES wavpack/wavpack.h
|
||||
)
|
||||
|
||||
set(wavpack_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of wavpack")
|
||||
|
||||
set(wavpack_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of wavpack")
|
||||
|
||||
set(wavpack_LINK_OPTIONS "" CACHE STRING "Extra link flags of wavpack")
|
||||
|
||||
find_package_handle_standard_args(wavpack
|
||||
REQUIRED_VARS wavpack_LIBRARY wavpack_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (wavpack_FOUND)
|
||||
if (NOT TARGET WavPack::WavPack)
|
||||
add_library(WavPack::WavPack UNKNOWN IMPORTED)
|
||||
set_target_properties(WavPack::WavPack PROPERTIES
|
||||
IMPORTED_LOCATION "${wavpack_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${wavpack_INCLUDE_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS "${wavpack_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${wavpack_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${wavpack_LINK_OPTIONS}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,34 @@
|
||||
# Helper for Find modules
|
||||
|
||||
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
|
||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
||||
else()
|
||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
|
||||
endif()
|
||||
|
||||
# The *_LIBRARIES lists always start with the library itself
|
||||
list(POP_FRONT "${_link_libraries}")
|
||||
|
||||
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
|
||||
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
|
||||
|
||||
set(${_out_prefix}_compile_options
|
||||
"${${_cflags}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_libraries
|
||||
"${${_link_libraries}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_options
|
||||
"${_filtered_link_options}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_link_directories
|
||||
"${${_library_dirs}}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# sdl2_mixer cmake project-config-version input for ./configure scripts
|
||||
|
||||
set(PACKAGE_VERSION "2.8.1")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,195 @@
|
||||
# sdl2_mixer cmake project-config input for ./configure scripts
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL2_mixer PROPERTIES
|
||||
URL "https://www.libsdl.org/projects/SDL_mixer/"
|
||||
DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library"
|
||||
)
|
||||
|
||||
set(SDL2_mixer_FOUND TRUE)
|
||||
|
||||
set(SDL2MIXER_VENDORED 0)
|
||||
|
||||
set(SDL2MIXER_CMD 0)
|
||||
|
||||
set(SDL2MIXER_FLAC_LIBFLAC 0)
|
||||
set(SDL2MIXER_FLAC_DRFLAC 1)
|
||||
if(SDL2MIXER_FLAC_LIBFLAC OR SDL2MIXER_FLAC_DRFLAC)
|
||||
set(SDL2MIXER_FLAC 1)
|
||||
else()
|
||||
set(SDL2MIXER_FLAC 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_GME 1)
|
||||
|
||||
set(SDL2MIXER_MOD_MODPLUG 0)
|
||||
set(SDL2MIXER_MOD_XMP 1)
|
||||
set(SDL2MIXER_MOD_XMP_LITE 0)
|
||||
if(SDL2MIXER_MOD_MODPLUG OR SDL2MIXER_MOD_XMP OR SDL2MIXER_MOD_XMP_LITE)
|
||||
set(SDL2MIXER_MOD 1)
|
||||
else()
|
||||
set(SDL2MIXER_MOD 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_MP3_MINIMP3 1)
|
||||
set(SDL2MIXER_MP3_MPG123 0)
|
||||
if(SDL2MIXER_MP3_MINIMP3 OR SDL2MIXER_MP3_MPG123)
|
||||
set(SDL2MIXER_MP3 1)
|
||||
else()
|
||||
set(SDL2MIXER_MP3 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_MIDI_FLUIDSYNTH 0)
|
||||
set(SDL2MIXER_MIDI_NATIVE 1)
|
||||
set(SDL2MIXER_MIDI_TIMIDITY 1)
|
||||
if(SDL2MIXER_MIDI_FLUIDSYNTH OR SDL2MIXER_MIDI_NATIVE OR SDL2MIXER_MIDI_TIMIDITY)
|
||||
set(SDL2MIXER_MIDI 1)
|
||||
else()
|
||||
set(SDL2MIXER_MIDI 0)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_OPUS 1)
|
||||
|
||||
set(SDL2MIXER_VORBIS)
|
||||
set(SDL2MIXER_VORBIS_STB 1)
|
||||
set(SDL2MIXER_VORBIS_VORBISFILE 0)
|
||||
set(SDL2MIXER_VORBIS_TREMOR 0)
|
||||
if(SDL2MIXER_VORBIS_STB)
|
||||
set(SDL2MIXER_VORBIS STB)
|
||||
endif()
|
||||
if(SDL2MIXER_VORBIS_VORBISFILE)
|
||||
set(SDL2MIXER_VORBIS VORBISFILE)
|
||||
endif()
|
||||
if(SDL2MIXER_VORBIS_TREMOR)
|
||||
set(SDL2MIXER_VORBIS TREMOR)
|
||||
endif()
|
||||
|
||||
set(SDL2MIXER_WAVE 1)
|
||||
|
||||
set(SDL2MIXER_WAVPACK 1)
|
||||
|
||||
set(SDL2MIXER_SDL2_REQUIRED_VERSION 2.0.9)
|
||||
|
||||
get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR} REALPATH)
|
||||
get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
|
||||
set(exec_prefix "${prefix}")
|
||||
set(bindir "${prefix}/bin")
|
||||
set(includedir "${prefix}/include")
|
||||
set(libdir "${prefix}/lib")
|
||||
set(_sdl2mixer_extra_static_libraries ";winmm")
|
||||
string(REGEX REPLACE "(^[;]+|[;]+$)" "" _sdl2mixer_extra_static_libraries "${_sdl2mixer_extra_static_libraries}")
|
||||
|
||||
set(_sdl2mixer_bindir "${bindir}")
|
||||
set(_sdl2mixer_libdir "${libdir}")
|
||||
set(_sdl2mixer_incdir "${includedir}/SDL2")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
set(_original_cmake_module_path "${CMAKE_MODULE_PATH}")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PkgConfigHelper.cmake")
|
||||
|
||||
if("modplug::modplug" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(modplug)
|
||||
endif()
|
||||
|
||||
if("libxmp::libxmp" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(libxmp)
|
||||
endif()
|
||||
|
||||
if("libxmp-lite::libxmp-lite" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(libxmp-lite)
|
||||
endif()
|
||||
|
||||
if("FluidSynth::libfluidsynth" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(FluidSynth)
|
||||
endif()
|
||||
|
||||
if("Vorbis::vorbisfile" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(Vorbis)
|
||||
endif()
|
||||
|
||||
if("tremor::tremor" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(tremor)
|
||||
endif()
|
||||
|
||||
if("FLAC::FLAC" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(FLAC)
|
||||
endif()
|
||||
|
||||
if("MPG123::libmpg123" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(mpg123)
|
||||
endif()
|
||||
|
||||
if("OpusFile::opusfile" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(OpusFile)
|
||||
endif()
|
||||
|
||||
if("WavPack::WavPack" IN_LIST _sdl2mixer_extra_static_libraries)
|
||||
find_dependency(wavpack)
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH "${_original_cmake_module_path}")
|
||||
unset(_original_cmake_module_path)
|
||||
|
||||
unset(prefix)
|
||||
unset(exec_prefix)
|
||||
unset(bindir)
|
||||
unset(includedir)
|
||||
unset(libdir)
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT TARGET SDL2_mixer::SDL2_mixer)
|
||||
if(WIN32)
|
||||
set(_sdl2mixer_dll "${_sdl2mixer_bindir}/SDL2_mixer.dll")
|
||||
set(_sdl2mixer_imp "${_sdl2mixer_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_mixer.dll${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_dll}" AND EXISTS "${_sdl2mixer_imp}")
|
||||
add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${_sdl2mixer_dll}"
|
||||
IMPORTED_IMPLIB "${_sdl2mixer_imp}"
|
||||
)
|
||||
endif()
|
||||
unset(_sdl2mixer_dll)
|
||||
unset(_sdl2mixer_imp)
|
||||
else()
|
||||
set(_sdl2mixer_shl "${_sdl2mixer_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_mixer${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_shl}")
|
||||
add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${_sdl2mixer_shl}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(TARGET SDL2_mixer::SDL2_mixer)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer
|
||||
PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_sdl2mixer_incdir}"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||
INTERFACE_SDL2_SHARED "ON"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET SDL2_mixer::SDL2_mixer-static)
|
||||
set(_sdl2mixer_stl "${_sdl2mixer_libdir}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_mixer${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2mixer_stl}")
|
||||
add_library(SDL2_mixer::SDL2_mixer-static STATIC IMPORTED)
|
||||
set_target_properties(SDL2_mixer::SDL2_mixer-static
|
||||
PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_sdl2mixer_incdir}"
|
||||
IMPORTED_LOCATION "${_sdl2mixer_stl}"
|
||||
INTERFACE_LINK_LIBRARIES "${_sdl2mixer_extra_static_libraries}"
|
||||
)
|
||||
endif()
|
||||
unset(_sdl2mixer_stl)
|
||||
endif()
|
||||
|
||||
unset(_sdl2mixer_extra_static_libraries)
|
||||
unset(_sdl2mixer_bindir)
|
||||
unset(_sdl2mixer_libdir)
|
||||
unset(_sdl2mixer_incdir)
|
||||
Binary file not shown.
Binary file not shown.
@@ -17,15 +17,15 @@ old_library='libSDL2_mixer.a'
|
||||
inherited_linker_flags=''
|
||||
|
||||
# Libraries that this one depends upon.
|
||||
dependency_libs=' -L/opt/local/x86_64-w64-mingw32/lib -lmingw32 /opt/local/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -lwinmm'
|
||||
dependency_libs=' -L/tmp/tardir/SDL2_mixer-2.8.1/VisualC/external/optional/x64 -L/home/runner/work/SDL_mixer/SDL_mixer/deps/mingw-deps/x86_64-w64-mingw32/lib -lmingw32 /home/runner/work/SDL_mixer/SDL_mixer/deps/mingw-deps/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -lwinmm'
|
||||
|
||||
# Names of additional weak libraries provided by this library
|
||||
weak_library_names=''
|
||||
|
||||
# Version information for libSDL2_mixer.
|
||||
current=2
|
||||
age=2
|
||||
revision=2
|
||||
current=800
|
||||
age=800
|
||||
revision=1
|
||||
|
||||
# Is this an already installed library?
|
||||
installed=yes
|
||||
@@ -38,4 +38,4 @@ dlopen=''
|
||||
dlpreopen=''
|
||||
|
||||
# Directory that this library needs to be installed in:
|
||||
libdir='/Users/valve/release/SDL_mixer/SDL2_mixer-2.0.4/x86_64-w64-mingw32/lib'
|
||||
libdir='/tmp/tardir/SDL2_mixer-2.8.1/build-mingw/install-x86_64-w64-mingw32/lib'
|
||||
@@ -1,12 +1,13 @@
|
||||
prefix=/opt/local/x86_64-w64-mingw32
|
||||
prefix=/tmp/tardir/SDL2_mixer-2.8.1/build-mingw/install-x86_64-w64-mingw32
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: SDL2_mixer
|
||||
Description: mixer library for Simple DirectMedia Layer
|
||||
Version: 2.0.4
|
||||
Requires: sdl2 >= 2.0.7
|
||||
Version: 2.8.1
|
||||
Requires: sdl2 >= 2.0.9
|
||||
Libs: -L${libdir} -lSDL2_mixer
|
||||
Cflags: -I${includedir}/SDL2
|
||||
|
||||
Requires.private:
|
||||
Libs.private: -lwinmm
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+12
-11
@@ -93,8 +93,7 @@
|
||||
# NOLDWARNING=1 - ?
|
||||
# NOSDLMAIN=1 - ?
|
||||
# SDLMAIN=1 - ?
|
||||
# NOLTO=1 - Disable link time optimizations
|
||||
# USEJEMALLOC=1 Enable building with jemalloc Allocator to replace GLibc malloc, might improve performance
|
||||
# USELTO=1 - Enable building with LTO.
|
||||
#
|
||||
# Library configuration flags:
|
||||
# Everything here is an override.
|
||||
@@ -261,7 +260,7 @@ debug_opts=-D_DEBUG
|
||||
else # build a normal optimized version
|
||||
debug_opts=-DNDEBUG
|
||||
opts+=-O3
|
||||
ifndef NOLTO
|
||||
ifdef USELTO
|
||||
# compile with LTO
|
||||
opts+=-flto=auto
|
||||
libs+=-flto=auto
|
||||
@@ -270,20 +269,16 @@ endif
|
||||
|
||||
ifdef USEASAN
|
||||
# compile with asan
|
||||
opts+=-O1 -fsanitize=address -fno-omit-frame-pointer -fno-common
|
||||
opts+=-fsanitize=address
|
||||
libs+=-fsanitize=address
|
||||
endif
|
||||
|
||||
ifdef USEUBSAN
|
||||
# compile with ubsan
|
||||
opts+=-O1 -fsanitize=undefined -fno-omit-frame-pointer
|
||||
# compile with asan
|
||||
opts+=-fsanitize=undefined
|
||||
libs+=-fsanitize=undefined
|
||||
endif
|
||||
|
||||
ifdef USEJEMALLOC
|
||||
libs+=-ljemalloc
|
||||
endif
|
||||
|
||||
ifneq (,$(filter $(CC) $(CXX),clang clang++))
|
||||
libs+=-fuse-ld=lld
|
||||
endif
|
||||
@@ -295,12 +290,18 @@ opts+=-g
|
||||
libs+=-g
|
||||
endif
|
||||
|
||||
ifdef MINGW
|
||||
# mingw needs this passed AFTER lto and the likes were passed
|
||||
# otherwise libbacktrace may break
|
||||
opts+=-g
|
||||
libs+=-g
|
||||
endif
|
||||
|
||||
# debug_opts also get passed to windres
|
||||
opts+=$(debug_opts)
|
||||
|
||||
opts+=$(foreach v,$(passthru_opts),$(if $($(v)),-D$(v)))
|
||||
|
||||
CWFLAGS+=-std=gnu17
|
||||
CXXFLAGS+=-std=c++17 # force c17 for c++ since most vpss run older ubuntu versions with old compilers
|
||||
|
||||
opts+=$(WFLAGS) $(CFLAGS)
|
||||
|
||||
@@ -64,7 +64,6 @@ endif
|
||||
|
||||
# This must have high to low order.
|
||||
gcc_versions:=\
|
||||
161 160 16\
|
||||
152 151 150 15\
|
||||
142 141 140 14\
|
||||
133 132 131 130 13\
|
||||
@@ -78,7 +77,7 @@ gcc_versions:=\
|
||||
55 54 53 52 51 50\
|
||||
49 48 47 46 45 44 43 42 41 40
|
||||
|
||||
latest_gcc_version:=16.1
|
||||
latest_gcc_version:=15.2
|
||||
|
||||
# Automatically set version flag, but not if one was
|
||||
# manually set. And don't bother if this is a clean only
|
||||
|
||||
@@ -8,7 +8,6 @@ passthru_opts+=\
|
||||
HAVE_MINIUPNPC\
|
||||
HAVE_DISCORDRPC DEVELOP\
|
||||
NOHOLEPUNCH\
|
||||
HAVE_IPV6\
|
||||
|
||||
# build with debugging information
|
||||
ifdef DEBUGMODE
|
||||
|
||||
+12
-13
@@ -20,8 +20,7 @@ $(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
|
||||
CXXFLAGS+= -Wno-aggregate-return
|
||||
|
||||
# -W -Wno-unused
|
||||
WFLAGS:=-Wall -Wnull-dereference
|
||||
#WFLAGS+=-Wno-trigraphs
|
||||
WFLAGS:=-Wall -Wno-trigraphs -Wnull-dereference
|
||||
ifdef GCC152
|
||||
WFLAGS+=-Wzero-as-null-pointer-constant
|
||||
endif
|
||||
@@ -32,7 +31,7 @@ ifndef RELAXWARNINGS
|
||||
WFLAGS+=-W
|
||||
#WFLAGS+=-Wno-sign-compare
|
||||
ifndef GCC295
|
||||
# WFLAGS+=-Wno-div-by-zero
|
||||
WFLAGS+=-Wno-div-by-zero
|
||||
endif
|
||||
#WFLAGS+=-Wsystem-headers
|
||||
WFLAGS+=-Wfloat-equal
|
||||
@@ -63,7 +62,7 @@ endif
|
||||
endif
|
||||
WFLAGS+=-Wsign-compare
|
||||
ifdef GCC91
|
||||
# WFLAGS+=-Wno-error=address-of-packed-member
|
||||
WFLAGS+=-Wno-error=address-of-packed-member
|
||||
endif
|
||||
ifdef GCC45
|
||||
WFLAGS+=-Wlogical-op
|
||||
@@ -106,14 +105,14 @@ endif
|
||||
endif
|
||||
WFLAGS+=-Wformat-y2k
|
||||
ifdef GCC71
|
||||
#WFLAGS+=-Wno-error=format-overflow=2
|
||||
WFLAGS+=-Wno-error=format-overflow=2
|
||||
endif
|
||||
WFLAGS+=-Wformat-security
|
||||
ifndef GCC29
|
||||
#WFLAGS+=-Winit-self
|
||||
endif
|
||||
ifdef GCC46
|
||||
#WFLAGS+=-Wno-suggest-attribute=noreturn
|
||||
WFLAGS+=-Wno-suggest-attribute=noreturn
|
||||
endif
|
||||
|
||||
ifdef NOLDWARNING
|
||||
@@ -131,21 +130,21 @@ ifdef GCC44
|
||||
#WFLAGS+=-Wno-error=array-bounds
|
||||
endif
|
||||
ifdef GCC46
|
||||
# WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||
endif
|
||||
ifdef GCC54
|
||||
# WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
||||
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
||||
endif
|
||||
ifdef GCC61
|
||||
# WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
||||
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
||||
endif
|
||||
ifdef GCC71
|
||||
WFLAGS+=-Wimplicit-fallthrough=4
|
||||
endif
|
||||
ifdef GCC81
|
||||
# WFLAGS+=-Wno-error=format-overflow
|
||||
# WFLAGS+=-Wno-format-overflow
|
||||
# WFLAGS+=-Wno-error=multistatement-macros
|
||||
WFLAGS+=-Wno-error=format-overflow
|
||||
WFLAGS+=-Wno-format-overflow
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
ifneq (,$(filter $(CC) $(CXX),clang clang++))
|
||||
@@ -184,6 +183,6 @@ endif
|
||||
# Lua
|
||||
ifdef GCC43
|
||||
ifndef GCC44
|
||||
#WFLAGS+=-Wno-logical-op
|
||||
WFLAGS+=-Wno-logical-op
|
||||
endif
|
||||
endif
|
||||
+1
-1
@@ -45,7 +45,7 @@ sounds.c
|
||||
st_stuff.c
|
||||
tables.c
|
||||
v_video.c
|
||||
w_wad.c
|
||||
w_wad.cpp
|
||||
y_inter.c
|
||||
z_zone.cpp
|
||||
r_bsp.cpp
|
||||
|
||||
+29
-14
@@ -434,7 +434,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
|
||||
LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
|
||||
lua_lock(L);
|
||||
luaC_checkGC(L);
|
||||
setsvalue2s(L, L->top, (len == 0) ? luaS_newlstr(L, "", 0) : luaS_newlstr(L, s, len));
|
||||
setsvalue2s(L, L->top, (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len));
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
@@ -519,19 +519,20 @@ LUA_API int lua_pushthread (lua_State *L) {
|
||||
** get functions (Lua -> stack)
|
||||
*/
|
||||
|
||||
static void auxgetstr (lua_State *L, TValue *t, const char *k) {
|
||||
TValue *slot;
|
||||
static void auxgetstr (lua_State *L, const TValue *t, const char *k) {
|
||||
const TValue *slot;
|
||||
TValue key;
|
||||
TString *str = luaS_new(L, k);
|
||||
api_checkvalidindex(L, t);
|
||||
if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
|
||||
setobj2s(L, L->top, slot);
|
||||
api_incr_top(L);
|
||||
}
|
||||
else {
|
||||
setsvalue(L, &key, str);
|
||||
luaV_finishget(L, t, &key, L->top, slot);
|
||||
luaV_finishget(L, t, L->top, L->top, slot);
|
||||
api_incr_top(L);
|
||||
}
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
@@ -639,6 +640,26 @@ LUA_API void lua_getfenv (lua_State *L, int idx) {
|
||||
** set functions (stack -> Lua)
|
||||
*/
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
static void auxsetstr (lua_State *L, const TValue *t, const char *k) {
|
||||
TValue key;
|
||||
const TValue *slot;
|
||||
TString *str = luaS_new(L, k);
|
||||
api_checknelems(L, 1);
|
||||
api_checkvalidindex(L, t);
|
||||
if (luaV_fastset(L, t, str, slot, luaH_setstr, L->top)) {
|
||||
setobj2t(L, cast(TValue *, slot), L->top - 1);
|
||||
L->top--; /* pop value */
|
||||
}
|
||||
else {
|
||||
setsvalue2s(L, &key, str);
|
||||
luaV_finishset(L, t, &key, L->top - 1, slot);
|
||||
L->top--; /* pop value */
|
||||
}
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_settable (lua_State *L, int idx) {
|
||||
StkId t;
|
||||
@@ -651,18 +672,12 @@ LUA_API void lua_settable (lua_State *L, int idx) {
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
|
||||
StkId t;
|
||||
TValue key;
|
||||
lua_lock(L);
|
||||
api_checknelems(L, 1);
|
||||
t = index2adr(L, idx);
|
||||
api_checkvalidindex(L, t);
|
||||
setsvalue(L, &key, luaS_new(L, k));
|
||||
luaV_settable(L, t, &key, L->top - 1);
|
||||
L->top--; /* pop value */
|
||||
lua_unlock(L);
|
||||
auxsetstr(L, index2adr(L, idx), k);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -698,6 +698,6 @@ static int panic (lua_State *L) {
|
||||
|
||||
LUALIB_API lua_State *luaL_newstate (void) {
|
||||
lua_State *L = lua_newstate(l_alloc, NULL);
|
||||
if (l_likely(L)) lua_atpanic(L, &panic);
|
||||
if (L) lua_atpanic(L, &panic);
|
||||
return L;
|
||||
}
|
||||
@@ -626,8 +626,20 @@ static void codenot (FuncState *fs, expdesc *e) {
|
||||
removevalues(fs, e->t);
|
||||
}
|
||||
|
||||
/*
|
||||
** Check whether expression 'e' is a literal string
|
||||
*/
|
||||
static int isKstr (FuncState *fs, expdesc *e) {
|
||||
return (e->k == VK && ttisstring(&fs->f->k[e->u.s.info]));
|
||||
}
|
||||
|
||||
/*
|
||||
** Create expression 't[k]'. 't' must have its final result already in a
|
||||
** register or upvalue. Upvalues can only be indexed by literal strings.
|
||||
*/
|
||||
void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
|
||||
if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non string? */
|
||||
luaK_exp2anyreg(fs, t); /* put it in a register */
|
||||
t->u.s.aux = luaK_exp2RK(fs, k);
|
||||
t->k = VINDEXED;
|
||||
}
|
||||
|
||||
+4
-4
@@ -55,8 +55,8 @@ struct lua_longjmp {
|
||||
|
||||
void luaD_seterrorobj (lua_State *L, int lerrcode, StkId oldtop) {
|
||||
switch (lerrcode) {
|
||||
case LUA_ERRMEM: { /* memory error? */
|
||||
setsvalue2s(L, oldtop, G(L)->memerrmsg); /* reuse preregistered msg. */
|
||||
case LUA_ERRMEM: {
|
||||
setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG));
|
||||
break;
|
||||
}
|
||||
case LUA_ERRERR: {
|
||||
@@ -164,7 +164,7 @@ void luaD_reallocCI (lua_State *L, int newsize) {
|
||||
|
||||
|
||||
void luaD_growstack (lua_State *L, int n) {
|
||||
if (n <= L->stacksize) /* double size is enough? */
|
||||
if (l_likely(n <= L->stacksize)) /* double size is enough? */
|
||||
luaD_reallocstack(L, 2*L->stacksize);
|
||||
else
|
||||
luaD_reallocstack(L, L->stacksize + n);
|
||||
@@ -318,7 +318,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
|
||||
ci->top = L->top + LUA_MINSTACK;
|
||||
lua_assert(ci->top <= L->stack_last);
|
||||
ci->nresults = nresults;
|
||||
if (l_unlikely(L->hookmask & LUA_MASKCALL))
|
||||
if (L->hookmask & LUA_MASKCALL)
|
||||
luaD_callhook(L, LUA_HOOKCALL, -1);
|
||||
lua_unlock(L);
|
||||
n = (*curr_func(L)->c.f)(L); /* do the actual call */
|
||||
|
||||
@@ -544,7 +544,6 @@ static void atomic (lua_State *L) {
|
||||
marktmu(g); /* mark `preserved' userdata */
|
||||
udsize += propagateall(g); /* remark, to propagate `preserveness' */
|
||||
cleartable(g->weak); /* remove collected objects from weak tables */
|
||||
luaS_clearcache(g);
|
||||
/* flip current white */
|
||||
g->currentwhite = cast_byte(otherwhite(g));
|
||||
g->sweepstrgc = 0;
|
||||
|
||||
@@ -41,25 +41,6 @@ typedef unsigned char lu_byte;
|
||||
*/
|
||||
#define IntPoint(p) ((unsigned int)(lu_mem)(p))
|
||||
|
||||
/*
|
||||
** conversion of pointer to unsigned integer: this is for hashing only;
|
||||
** there is no problem if the integer cannot hold the whole pointer
|
||||
** value. (In strict ISO C this may cause undefined behavior, but no
|
||||
** actual machine seems to bother.)
|
||||
*/
|
||||
#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
|
||||
__STDC_VERSION__ >= 199901L
|
||||
#include <stdint.h>
|
||||
#if defined(UINTPTR_MAX) /* even in C99 this type is optional */
|
||||
#define L_P2I uintptr_t
|
||||
#else /* no 'intptr'? */
|
||||
#define L_P2I uintmax_t /* use the largest available integer */
|
||||
#endif
|
||||
#else /* C89 option */
|
||||
#define L_P2I size_t
|
||||
#endif
|
||||
|
||||
#define point2uint(p) ((unsigned int)((L_P2I)(p) & UINT_MAX))
|
||||
|
||||
|
||||
/* type to ensure maximum alignment */
|
||||
@@ -119,17 +100,6 @@ typedef lu_int32 Instruction;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Size of cache for strings in the API. 'N' is the number of
|
||||
** sets (better be a prime) and "M" is the size of each set (M == 1
|
||||
** makes a direct cache.)
|
||||
*/
|
||||
#ifndef STRCACHE_N
|
||||
#define STRCACHE_N 53
|
||||
#define STRCACHE_M 2
|
||||
#endif
|
||||
|
||||
|
||||
/* minimum size for string buffer */
|
||||
#ifndef LUA_MINBUFFER
|
||||
#define LUA_MINBUFFER 32
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "llimits.h"
|
||||
#include "lua.h"
|
||||
|
||||
#define MEMERRMSG "not enough memory"
|
||||
|
||||
|
||||
#define luaM_reallocv(L,b,on,n,e) \
|
||||
((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
|
||||
|
||||
@@ -232,6 +232,8 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
|
||||
(*) In OP_SETLIST, if (B == 0) then B = `top';
|
||||
if (C == 0) then next `instruction' is real C
|
||||
|
||||
(*) In OP_SELF, the index must be a string.
|
||||
|
||||
(*) For comparisons, A specifies what condition the test should accept
|
||||
(true or false).
|
||||
|
||||
|
||||
+2
-1
@@ -73,9 +73,10 @@ static void f_luaopen (lua_State *L, void *ud) {
|
||||
stack_init(L, L); /* init stack */
|
||||
sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */
|
||||
sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */
|
||||
luaS_init(L);
|
||||
luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
|
||||
luaT_init(L);
|
||||
luaX_init(L);
|
||||
luaS_fix(luaS_newliteral(L, MEMERRMSG));
|
||||
g->GCthreshold = 4*g->totalbytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,11 +88,9 @@ typedef struct global_State {
|
||||
lua_CFunction panic; /* to be called in unprotected errors */
|
||||
TValue l_registry;
|
||||
struct lua_State *mainthread;
|
||||
TString *memerrmsg; /* memory-error message */
|
||||
UpVal uvhead; /* head of double-linked list of all open upvalues */
|
||||
struct Table *mt[NUM_TAGS]; /* metatables for basic types */
|
||||
TString *tmname[TM_N]; /* array with tag-method names */
|
||||
TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */
|
||||
} global_State;
|
||||
|
||||
|
||||
|
||||
+4
-118
@@ -18,9 +18,6 @@
|
||||
#include "lstring.h"
|
||||
|
||||
|
||||
#define MEMERRMSG "not enough memory"
|
||||
|
||||
|
||||
|
||||
void luaS_resize (lua_State *L, int newsize) {
|
||||
GCObject **newhash;
|
||||
@@ -54,7 +51,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l,
|
||||
unsigned int h) {
|
||||
TString *ts;
|
||||
stringtable *tb;
|
||||
if (l_unlikely(l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)))
|
||||
if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char))
|
||||
luaM_toobig(L);
|
||||
ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString)));
|
||||
ts->tsv.len = l;
|
||||
@@ -75,106 +72,18 @@ static TString *newlstr (lua_State *L, const char *str, size_t l,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Clear API string cache. (Entries cannot be empty, so fill them with
|
||||
** a non-collectable string.)
|
||||
*/
|
||||
void luaS_clearcache (global_State *g) {
|
||||
int i, j;
|
||||
for (i = 0; i < STRCACHE_N; i++)
|
||||
for (j = 0; j < STRCACHE_M; j++) {
|
||||
if (luaS_iswhite(g->strcache[i][j])) /* will entry be collected? */
|
||||
g->strcache[i][j] = g->memerrmsg; /* replace it with something fixed */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Initialize the string table and the string cache
|
||||
*/
|
||||
void luaS_init (lua_State *L) {
|
||||
global_State *g = G(L);
|
||||
int i, j;
|
||||
luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
|
||||
/* pre-create memory-error message */
|
||||
g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
|
||||
luaS_fix(g->memerrmsg); /* it should never be collected */
|
||||
for (i = 0; i < STRCACHE_N; i++) /* fill cache with valid strings */
|
||||
for (j = 0; j < STRCACHE_M; j++)
|
||||
g->strcache[i][j] = g->memerrmsg;
|
||||
}
|
||||
|
||||
|
||||
// string hash taken from luaJIT
|
||||
|
||||
/* Unaligned load of uint32_t. */
|
||||
static inline __attribute__((always_inline)) uint32_t getu32(const void* ptr)
|
||||
{
|
||||
uint32_t result;
|
||||
memcpy(&result, ptr, 4);
|
||||
return result;
|
||||
}
|
||||
|
||||
// smol macro to look a little less messy lul
|
||||
#define getu8(p) *cast(const uint8_t *, p)
|
||||
|
||||
/* Keyed sparse ARX string hash. Constant time. */
|
||||
static unsigned hash_sparse(const char *str, size_t len)
|
||||
{
|
||||
/* Constants taken from lookup3 hash by Bob Jenkins. */
|
||||
unsigned int a, b, h = cast(unsigned int, len);
|
||||
#define rol(x, n) (((x)<<(n)) | ((x)>>(-cast(int, n)&(8*sizeof(x)-1))))
|
||||
if (len >= 4) { /* Caveat: unaligned access! */
|
||||
a = getu32(str);
|
||||
h ^= getu32(str+len-4);
|
||||
b = getu32(str+(len>>1)-2);
|
||||
h ^= b; h -= rol(b, 14);
|
||||
b += getu32(str+(len>>2)-1);
|
||||
} else if (len > 0) {
|
||||
a = getu8(str);
|
||||
h ^= getu8(str+len-1);
|
||||
b = getu8(str+(len>>1));
|
||||
h ^= b; h -= rol(b, 14);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
a ^= h; a -= rol(h, 11);
|
||||
b ^= a; b -= rol(a, 25);
|
||||
h ^= b; h -= rol(b, 16);
|
||||
#undef rol
|
||||
return h;
|
||||
}
|
||||
|
||||
#undef getu8
|
||||
|
||||
|
||||
static inline __attribute__((always_inline)) unsigned luaS_hash (const char *str, size_t l) {
|
||||
#if 0
|
||||
TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||
GCObject *o;
|
||||
unsigned int h = cast(unsigned int, l); /* seed */
|
||||
size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */
|
||||
size_t l1;
|
||||
for (l1=l; l1>=step; l1-=step) /* compute hash */
|
||||
h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1]));
|
||||
return h;
|
||||
#else
|
||||
return hash_sparse(str, l);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** new string (with explicit length)
|
||||
*/
|
||||
TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||
GCObject *o;
|
||||
unsigned int h = luaS_hash(str, l);
|
||||
for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
|
||||
o != NULL;
|
||||
o = o->gch.next) {
|
||||
TString *ts = rawgco2ts(o);
|
||||
if (ts->tsv.hash == h &&
|
||||
ts->tsv.len == l &&
|
||||
(memcmp(str, getstr(ts), l) == 0)) {
|
||||
if (l_unlikely(ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0))) {
|
||||
/* string may be dead */
|
||||
if (isdead(G(L), o)) changewhite(o);
|
||||
return ts;
|
||||
@@ -184,29 +93,6 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Create or reuse a zero-terminated string, first checking in the
|
||||
** cache (using the string address as a key). The cache can contain
|
||||
** only zero-terminated strings, so it is safe to use 'strcmp' to
|
||||
** check hits.
|
||||
*/
|
||||
TString *luaS_new (lua_State *L, const char *str) {
|
||||
unsigned int i = point2uint(str) % STRCACHE_N; /* hash */
|
||||
int j;
|
||||
TString **p = G(L)->strcache[i];
|
||||
for (j = 0; j < STRCACHE_M; j++) {
|
||||
if (strcmp(str, getstr(p[j])) == 0) /* hit? */
|
||||
return p[j]; /* that is it */
|
||||
}
|
||||
/* normal route */
|
||||
for (j = STRCACHE_M - 1; j > 0; j--)
|
||||
p[j] = p[j - 1]; /* move out last element */
|
||||
/* new element is first in the list */
|
||||
p[0] = luaS_newlstr(L, str, strlen(str));
|
||||
return p[0];
|
||||
}
|
||||
|
||||
|
||||
Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
|
||||
Udata *u;
|
||||
if (l_unlikely(s > MAX_SIZET - sizeof(Udata)))
|
||||
|
||||
+2
-6
@@ -17,19 +17,15 @@
|
||||
|
||||
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
|
||||
|
||||
//#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
|
||||
#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
|
||||
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
|
||||
(sizeof(s)/sizeof(char))-1))
|
||||
|
||||
#define luaS_iswhite(x) test2bits((x)->tsv.marked, WHITE0BIT, WHITE1BIT)
|
||||
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
|
||||
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
|
||||
|
||||
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
|
||||
LUAI_FUNC void luaS_clearcache (global_State *g);
|
||||
LUAI_FUNC void luaS_init (lua_State *L);
|
||||
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
|
||||
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
||||
LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -81,7 +81,6 @@ static /*const*/ Node dummynode_ = {
|
||||
/*
|
||||
** hash for lua_Numbers
|
||||
*/
|
||||
#if 0
|
||||
static Node *hashnum (const Table *t, lua_Number n) {
|
||||
unsigned int a[numints];
|
||||
int i;
|
||||
@@ -91,12 +90,6 @@ static Node *hashnum (const Table *t, lua_Number n) {
|
||||
for (i = 1; i < numints; i++) a[0] += a[i];
|
||||
return hashmod(t, a[0]);
|
||||
}
|
||||
#else
|
||||
// our lua_Number is just typedef´d int32 so no need to do any of the above
|
||||
static inline Node *hashnum (const Table *t, lua_Number n) {
|
||||
return hashmod(t, cast(unsigned int, n));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
|
||||
}
|
||||
|
||||
|
||||
TValue *luaT_gettmbyobj (lua_State *L, TValue *o, TMS event) {
|
||||
TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
|
||||
Table *mt;
|
||||
switch (ttype(o)) {
|
||||
case LUA_TTABLE:
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ LUAI_DATA const char *const luaT_typenames[];
|
||||
|
||||
|
||||
LUAI_FUNC TValue *luaT_gettm (Table *events, TMS event, TString *ename);
|
||||
LUAI_FUNC TValue *luaT_gettmbyobj (lua_State *L, TValue *o, TMS event);
|
||||
LUAI_FUNC TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event);
|
||||
LUAI_FUNC void luaT_init (lua_State *L);
|
||||
|
||||
#endif
|
||||
+74
-71
@@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
|
||||
/* limit for table tag-method chains (to avoid infinite loops) */
|
||||
/* limit for table tag-method chains (to avoid loops) */
|
||||
#define MAXTAGLOOP 100
|
||||
|
||||
|
||||
@@ -110,10 +110,10 @@ static void callTM (lua_State *L, const TValue *f, const TValue *p1,
|
||||
** if 'slot' is NULL, 't' is not a table; otherwise, 'slot' points to
|
||||
** t[k] entry (which must be nil).
|
||||
*/
|
||||
void luaV_finishget (lua_State *L, TValue *t, TValue *key, StkId val,
|
||||
TValue *slot) {
|
||||
void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val,
|
||||
const TValue *slot) {
|
||||
int loop; /* counter to avoid infinite loops */
|
||||
TValue *tm; /* metamethod */
|
||||
const TValue *tm; /* metamethod */
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
if (slot == NULL) { /* 't' is not a table? */
|
||||
lua_assert(!ttistable(t));
|
||||
@@ -136,49 +136,63 @@ void luaV_finishget (lua_State *L, TValue *t, TValue *key, StkId val,
|
||||
return;
|
||||
}
|
||||
t = tm; /* else try to access 'tm[key]' */
|
||||
if (luaV_fastget(L, t, key, slot, luaH_get)) { /* fast track? */
|
||||
if (luaV_fastget(L,t,key,slot,luaH_get)) { /* fast track? */
|
||||
setobj2s(L, val, slot); /* done */
|
||||
return;
|
||||
}
|
||||
/* else repeat (tail call 'luaV_finishget') */
|
||||
}
|
||||
luaG_runerror(L, "loop in gettable");
|
||||
luaG_runerror(L, "'__index' chain too long; possible loop");
|
||||
}
|
||||
|
||||
|
||||
void luaV_settable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
||||
int loop;
|
||||
/*
|
||||
** Finish a table assignment 't[key] = val'.
|
||||
** If 'slot' is NULL, 't' is not a table. Otherwise, 'slot' points
|
||||
** to the entry 't[key]', or to 'luaO_nilobject' if there is no such
|
||||
** entry. (The value at 'slot' must be nil, otherwise 'luaV_fastset'
|
||||
** would have done the job.)
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||
StkId val, const TValue *slot) {
|
||||
int loop; /* counter to avoid infinite loops */
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
TValue *tm = NULL;
|
||||
if (ttistable(t)) { /* `t' is a table? */
|
||||
const TValue *tm;
|
||||
if (slot != NULL) {
|
||||
lua_assert(ttistable(t) && ttisnil(slot));
|
||||
Table *h = hvalue(t);
|
||||
TValue *oldval = luaH_set(L, h, key); /* do a primitive set */
|
||||
/* oldval is nil=> look for newindex, oldval is not nil => look for usedindex */
|
||||
if (ttisnil(oldval)) {
|
||||
tm = fasttm(L, h->metatable, TM_NEWINDEX); /* get metamethod */
|
||||
} else {
|
||||
tm = fasttm(L, h->metatable, TM_USEDINDEX);
|
||||
}
|
||||
if (tm == NULL) { /* no metamethod? */
|
||||
setobj2t(L, oldval, val);
|
||||
/* must check the metamethod */
|
||||
/* slot is nil=> look for newindex, slot is not nil => look for usedindex */
|
||||
if (!((ttisnil(slot) && ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) != NULL)) ||
|
||||
((!ttisnil(slot)) && ((tm = fasttm(L, h->metatable, TM_USEDINDEX)) != NULL)))) {
|
||||
/* no metamethod and (now) there is an entry with given key */
|
||||
setobj2t(L, cast(TValue *, slot), val);
|
||||
luaC_barriert(L, h, val);
|
||||
return;
|
||||
}
|
||||
/* else will try the tag method */
|
||||
/* else will try the metamethod */
|
||||
}
|
||||
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))))
|
||||
luaG_typeerror(L, t, "index");
|
||||
else { /* not a table; check metamethod */
|
||||
if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))))
|
||||
luaG_typeerror(L, t, "index");
|
||||
}
|
||||
/* try the metamethod */
|
||||
if (ttisfunction(tm)) {
|
||||
callTM(L, tm, t, key, val);
|
||||
return;
|
||||
}
|
||||
t = tm; /* else repeat with `tm' */
|
||||
t = tm; /* else repeat assignment over 'tm' */
|
||||
if (luaV_fastset(L, t, key, slot, luaH_set, val))
|
||||
return; /* done */
|
||||
/* else loop */
|
||||
}
|
||||
luaG_runerror(L, "loop in settable");
|
||||
luaG_runerror(L, "settable chain too long; possible loop");
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
static int call_binTM (lua_State *L, TValue *p1, TValue *p2,
|
||||
static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2,
|
||||
StkId res, TMS event) {
|
||||
const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */
|
||||
if (ttisnil(tm))
|
||||
@@ -203,7 +217,7 @@ static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2,
|
||||
}
|
||||
|
||||
|
||||
static int call_orderTM (lua_State *L, TValue *p1, TValue *p2,
|
||||
static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2,
|
||||
TMS event) {
|
||||
const TValue *tm1 = luaT_gettmbyobj(L, p1, event);
|
||||
const TValue *tm2;
|
||||
@@ -385,7 +399,6 @@ static void Arith (lua_State *L, StkId ra, TValue *rb,
|
||||
|
||||
|
||||
#define arith_op(op,tm) { \
|
||||
StkId ra = RA(i); \
|
||||
TValue *rb = RKB(i); \
|
||||
TValue *rc = RKC(i); \
|
||||
if (ttisnumber(rb) && ttisnumber(rc)) { \
|
||||
@@ -397,15 +410,25 @@ static void Arith (lua_State *L, StkId ra, TValue *rb,
|
||||
}
|
||||
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
|
||||
/*
|
||||
** copy of 'luaV_gettable', but protecting call to potential metamethod
|
||||
** (which can reallocate the stack)
|
||||
*/
|
||||
#define gettableProtected(L,t,k,v) { TValue *slot; \
|
||||
#define gettableProtected(L,t,k,v) { const TValue *slot; \
|
||||
if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
|
||||
else Protect(luaV_finishget(L,t,k,v,slot)); }
|
||||
|
||||
|
||||
/* same for 'luaV_settable' */
|
||||
#define settableProtected(L,t,k,v) { const TValue *slot; \
|
||||
if (!luaV_fastset(L,t,k,slot,luaH_set,v)) \
|
||||
Protect(luaV_finishset(L,t,k,v,slot)); }
|
||||
|
||||
|
||||
|
||||
void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
LClosure *cl;
|
||||
StkId base;
|
||||
@@ -420,6 +443,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
/* main loop of interpreter */
|
||||
for (;;) {
|
||||
const Instruction i = *pc++;
|
||||
StkId ra;
|
||||
if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) &&
|
||||
(--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {
|
||||
traceexec(L, pc);
|
||||
@@ -429,28 +453,26 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
base = L->base;
|
||||
}
|
||||
/* warning!! several calls may realloc the stack and invalidate `ra' */
|
||||
ra = RA(i);
|
||||
lua_assert(base == L->base && L->base == L->ci->base);
|
||||
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
|
||||
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
|
||||
switch (GET_OPCODE(i)) {
|
||||
case OP_MOVE: {
|
||||
StkId ra = RA(i);
|
||||
setobjs2s(L, ra, RB(i));
|
||||
continue;
|
||||
}
|
||||
case OP_LOADK: {
|
||||
StkId ra = RA(i);
|
||||
setobj2s(L, ra, KBx(i));
|
||||
continue;
|
||||
}
|
||||
case OP_LOADBOOL: {
|
||||
StkId ra = RA(i);
|
||||
setbvalue(ra, GETARG_B(i));
|
||||
if (GETARG_C(i)) pc++; /* skip next instruction (if C) */
|
||||
continue;
|
||||
}
|
||||
case OP_LOADNIL: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RB(i);
|
||||
do {
|
||||
setnilvalue(rb--);
|
||||
@@ -458,13 +480,11 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_GETUPVAL: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i);
|
||||
setobj2s(L, ra, cl->upvals[b]->v);
|
||||
continue;
|
||||
}
|
||||
case OP_GETGLOBAL: {
|
||||
StkId ra = RA(i);
|
||||
TValue g;
|
||||
TValue *rb = KBx(i);
|
||||
sethvalue(L, &g, cl->env);
|
||||
@@ -473,14 +493,12 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_GETTABLE: {
|
||||
StkId ra = RA(i);
|
||||
StkId rb = RB(i);
|
||||
TValue *rc = RKC(i);
|
||||
gettableProtected(L, rb, rc, ra);
|
||||
continue;
|
||||
}
|
||||
case OP_SETGLOBAL: {
|
||||
StkId ra = RA(i);
|
||||
TValue g;
|
||||
sethvalue(L, &g, cl->env);
|
||||
lua_assert(ttisstring(KBx(i)));
|
||||
@@ -488,21 +506,18 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_SETUPVAL: {
|
||||
StkId ra = RA(i);
|
||||
UpVal *uv = cl->upvals[GETARG_B(i)];
|
||||
setobj(L, uv->v, ra);
|
||||
luaC_barrier(L, uv, ra);
|
||||
continue;
|
||||
}
|
||||
case OP_SETTABLE: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RKB(i);
|
||||
TValue *rc = RKC(i);
|
||||
Protect(luaV_settable(L, ra, rb, rc));
|
||||
settableProtected(L, ra, rb, rc);
|
||||
continue;
|
||||
}
|
||||
case OP_NEWTABLE: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i);
|
||||
int c = GETARG_C(i);
|
||||
sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));
|
||||
@@ -510,11 +525,15 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_SELF: {
|
||||
StkId ra = RA(i);
|
||||
const TValue *slot;
|
||||
StkId rb = RB(i);
|
||||
TValue *rc = RKC(i);
|
||||
TString *key = rawtsvalue(rc); /* key must be a string */
|
||||
setobjs2s(L, ra + 1, rb);
|
||||
gettableProtected(L, rb, rc, ra);
|
||||
if (luaV_fastget(L, rb, key, slot, luaH_getstr)) {
|
||||
setobj2s(L, ra, slot);
|
||||
}
|
||||
else Protect(luaV_finishget(L, rb, rc, ra, slot));
|
||||
continue;
|
||||
}
|
||||
case OP_ADD: {
|
||||
@@ -530,7 +549,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_DIV: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RKB(i);
|
||||
TValue *rc = RKC(i);
|
||||
if (ttisnumber(rb) && ttisnumber(rc)) {
|
||||
@@ -546,7 +564,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_MOD: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RKB(i);
|
||||
TValue *rc = RKC(i);
|
||||
if (ttisnumber(rb) && ttisnumber(rc)) {
|
||||
@@ -566,27 +583,26 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_BAND: {
|
||||
arith_op(luai_numand, TM_AND);
|
||||
continue;
|
||||
arith_op(luai_numand, TM_AND);
|
||||
continue;
|
||||
}
|
||||
case OP_BOR: {
|
||||
arith_op(luai_numor, TM_OR);
|
||||
continue;
|
||||
arith_op(luai_numor, TM_OR);
|
||||
continue;
|
||||
}
|
||||
case OP_BXOR: {
|
||||
arith_op(luai_numxor, TM_XOR);
|
||||
continue;
|
||||
arith_op(luai_numxor, TM_XOR);
|
||||
continue;
|
||||
}
|
||||
case OP_BSHL: {
|
||||
arith_op(luai_numshl, TM_SHL);
|
||||
continue;
|
||||
arith_op(luai_numshl, TM_SHL);
|
||||
continue;
|
||||
}
|
||||
case OP_BSHR: {
|
||||
arith_op(luai_numshr, TM_SHR);
|
||||
continue;
|
||||
arith_op(luai_numshr, TM_SHR);
|
||||
continue;
|
||||
}
|
||||
case OP_BNOT: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RB(i);
|
||||
if (ttisnumber(rb)) {
|
||||
lua_Number nb = nvalue(rb);
|
||||
@@ -598,7 +614,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_UNM: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RB(i);
|
||||
if (ttisnumber(rb)) {
|
||||
lua_Number nb = nvalue(rb);
|
||||
@@ -610,13 +625,11 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_NOT: {
|
||||
StkId ra = RA(i);
|
||||
int res = l_isfalse(RB(i)); /* next assignment may change this value */
|
||||
setbvalue(ra, res);
|
||||
continue;
|
||||
}
|
||||
case OP_LEN: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RB(i);
|
||||
switch (ttype(rb)) {
|
||||
case LUA_TTABLE: {
|
||||
@@ -674,14 +687,12 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_TEST: {
|
||||
StkId ra = RA(i);
|
||||
if (l_isfalse(ra) != GETARG_C(i))
|
||||
dojump(L, pc, GETARG_sBx(*pc));
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
case OP_TESTSET: {
|
||||
StkId ra = RA(i);
|
||||
TValue *rb = RB(i);
|
||||
if (l_isfalse(rb) != GETARG_C(i)) {
|
||||
setobjs2s(L, ra, rb);
|
||||
@@ -691,7 +702,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_CALL: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i);
|
||||
int nresults = GETARG_C(i) - 1;
|
||||
if (b != 0) L->top = ra+b; /* else previous instruction set top */
|
||||
@@ -713,7 +723,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
}
|
||||
case OP_TAILCALL: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i);
|
||||
if (b != 0) L->top = ra+b; /* else previous instruction set top */
|
||||
L->savedpc = pc;
|
||||
@@ -746,7 +755,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
}
|
||||
case OP_RETURN: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i);
|
||||
if (b != 0) L->top = ra+b-1;
|
||||
if (L->openupval) luaF_close(L, base);
|
||||
@@ -762,7 +770,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
}
|
||||
case OP_FORLOOP: {
|
||||
StkId ra = RA(i);
|
||||
lua_Number step = nvalue(ra+2);
|
||||
lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */
|
||||
lua_Number limit = nvalue(ra+1);
|
||||
@@ -775,7 +782,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_FORPREP: {
|
||||
StkId ra = RA(i);
|
||||
const TValue *init = ra;
|
||||
const TValue *plimit = ra+1;
|
||||
const TValue *pstep = ra+2;
|
||||
@@ -792,7 +798,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_TFORLOOP: {
|
||||
StkId ra = RA(i);
|
||||
StkId cb = ra + 3; /* call base */
|
||||
setobjs2s(L, cb+2, ra+2);
|
||||
setobjs2s(L, cb+1, ra+1);
|
||||
@@ -809,7 +814,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_SETLIST: {
|
||||
StkId ra = RA(i);
|
||||
int n = GETARG_B(i);
|
||||
int c = GETARG_C(i);
|
||||
int last;
|
||||
@@ -832,12 +836,10 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_CLOSE: {
|
||||
StkId ra = RA(i);
|
||||
luaF_close(L, ra);
|
||||
continue;
|
||||
}
|
||||
case OP_CLOSURE: {
|
||||
StkId ra = RA(i);
|
||||
Proto *p;
|
||||
Closure *ncl;
|
||||
int nup, j;
|
||||
@@ -858,7 +860,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_VARARG: {
|
||||
StkId ra = RA(i);
|
||||
int b = GETARG_B(i) - 1;
|
||||
int j;
|
||||
CallInfo *ci = L->ci;
|
||||
@@ -882,3 +883,5 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
+30
-5
@@ -38,20 +38,45 @@
|
||||
/*
|
||||
** standard implementation for 'gettable'
|
||||
*/
|
||||
#define luaV_gettable(L,t,k,v) { TValue *slot; \
|
||||
#define luaV_gettable(L,t,k,v) { const TValue *slot; \
|
||||
if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
|
||||
else luaV_finishget(L,t,k,v,slot); }
|
||||
|
||||
|
||||
/*
|
||||
** Fast track for set table. If 't' is a table and 't[k]' is not nil,
|
||||
** call GC barrier, do a raw 't[k]=v', and return true; otherwise,
|
||||
** return false with 'slot' equal to NULL (if 't' is not a table) or
|
||||
** 'nil'. (This is needed by 'luaV_finishget'.) Note that, if the macro
|
||||
** returns true, there is no need to 'invalidateTMcache', because the
|
||||
** call is not creating a new entry.
|
||||
*/
|
||||
#define luaV_fastset(L,t,k,slot,f,v) \
|
||||
(!ttistable(t) \
|
||||
? (slot = NULL, 0) \
|
||||
: (slot = f(L, hvalue(t), k), \
|
||||
ttisnil(slot) ? 0 \
|
||||
: (__extension__ ({ \
|
||||
if (valiswhite(v) && isblack(obj2gco(hvalue(t)))) \
|
||||
luaC_barrierback(L, hvalue(t)); \
|
||||
setobj2t(L, cast(TValue *,slot), v); \
|
||||
1; \
|
||||
}))))
|
||||
|
||||
#define luaV_settable(L,t,k,v) { const TValue *slot; \
|
||||
if (!luaV_fastset(L,t,k,slot,luaH_set,v)) \
|
||||
luaV_finishset(L,t,k,v,slot); }
|
||||
|
||||
|
||||
|
||||
LUAI_FUNC int luaV_lessthan (lua_State *L, TValue *l, TValue *r);
|
||||
LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
|
||||
LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
|
||||
LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
|
||||
LUAI_FUNC void luaV_finishget (lua_State *L, TValue *t, TValue *key,
|
||||
StkId val, TValue *tm);
|
||||
LUAI_FUNC void luaV_settable (lua_State *L, TValue *t, TValue *key,
|
||||
StkId val);
|
||||
LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key,
|
||||
StkId val, const TValue *tm);
|
||||
LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||
StkId val, const TValue *oldval);
|
||||
LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
|
||||
LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
|
||||
|
||||
|
||||
+4
-66
@@ -1165,39 +1165,6 @@ void VS_Print(vsbuf_t *buf, const char *data)
|
||||
//
|
||||
// =========================================================================
|
||||
|
||||
#define NAME cvar_map_t
|
||||
#define KEY_TY const char *
|
||||
#define VAL_TY consvar_t *
|
||||
#define HASH_FN FNV1a_HashLowercaseString
|
||||
#define CMPR_FN vt_cmpr_casestring
|
||||
#include "verstable.h"
|
||||
|
||||
#define NAME netvar_map_t
|
||||
#define KEY_TY UINT16
|
||||
#define VAL_TY consvar_t *
|
||||
#define HASH_FN vt_hash_integer
|
||||
#define CMPR_FN vt_cmpr_integer
|
||||
#include "verstable.h"
|
||||
|
||||
static cvar_map_t cvar_map;
|
||||
static netvar_map_t netvar_map;
|
||||
|
||||
CONSTRUCTOR static void CV_InitMap(void)
|
||||
{
|
||||
// ensure the map is initialized
|
||||
cvar_map_t_init(&cvar_map);
|
||||
cvar_map_t_reserve(&cvar_map, 512);
|
||||
|
||||
netvar_map_t_init(&netvar_map);
|
||||
netvar_map_t_reserve(&netvar_map, 256);
|
||||
}
|
||||
|
||||
DESTRUCTOR static void CV_DestroyMap(void)
|
||||
{
|
||||
cvar_map_t_cleanup(&cvar_map);
|
||||
netvar_map_t_cleanup(&netvar_map);
|
||||
}
|
||||
|
||||
static const char *cv_null_string = "";
|
||||
|
||||
/** Searches if a variable has been registered.
|
||||
@@ -1208,17 +1175,11 @@ static const char *cv_null_string = "";
|
||||
*/
|
||||
consvar_t *CV_FindVar(const char *name)
|
||||
{
|
||||
cvar_map_t_itr it = cvar_map_t_get(&cvar_map, name);
|
||||
if (!cvar_map_t_is_end(it))
|
||||
return it.data->val;
|
||||
|
||||
// fallback linear search
|
||||
/*
|
||||
consvar_t *cvar;
|
||||
|
||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
||||
if (fasticmp(name, cvar->name))
|
||||
if (fasticmp(name,cvar->name))
|
||||
return cvar;
|
||||
*/
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -1233,7 +1194,7 @@ consvar_t *CV_FindVar(const char *name)
|
||||
static inline UINT16 CV_ComputeNetid(const char *s)
|
||||
{
|
||||
UINT16 ret = 0, i = 0;
|
||||
static const UINT16 premiers[16] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};
|
||||
static UINT16 premiers[16] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};
|
||||
|
||||
while (*s)
|
||||
{
|
||||
@@ -1252,17 +1213,11 @@ static inline UINT16 CV_ComputeNetid(const char *s)
|
||||
*/
|
||||
static consvar_t *CV_FindNetVar(UINT16 netid)
|
||||
{
|
||||
netvar_map_t_itr it = netvar_map_t_get(&netvar_map, netid);
|
||||
if (!netvar_map_t_is_end(it))
|
||||
return it.data->val;
|
||||
|
||||
/*
|
||||
consvar_t *cvar;
|
||||
|
||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
||||
if (cvar->netid == netid)
|
||||
return cvar;
|
||||
*/
|
||||
|
||||
if (netid == 44542) // ouch this hack
|
||||
return &cv_karteliminatelast;
|
||||
@@ -1328,11 +1283,6 @@ void CV_RegisterVar(consvar_t *variable)
|
||||
|
||||
// the SetValue will set this bit
|
||||
variable->flags &= ~CV_MODIFIED;
|
||||
|
||||
cvar_map_t_insert(&cvar_map, variable->name, variable);
|
||||
|
||||
if (variable->flags & CV_NETVAR)
|
||||
netvar_map_t_insert(&netvar_map, variable->netid, variable);
|
||||
}
|
||||
|
||||
/** Finds the string value of a console variable.
|
||||
@@ -1638,21 +1588,9 @@ size_t CV_LoadNetVars(const UINT8 *bufstart)
|
||||
// prevent "invalid command received"
|
||||
serverloading = true;
|
||||
|
||||
// we can use our netvar map instead of going through all cvars each time
|
||||
netvar_map_t_itr it;
|
||||
for (it = netvar_map_t_first(&netvar_map);
|
||||
!netvar_map_t_is_end(it);
|
||||
it = netvar_map_t_next(it))
|
||||
{
|
||||
cvar = it.data->val;
|
||||
Setvalue(cvar, cvar->defaultvalue, true);
|
||||
}
|
||||
|
||||
/*
|
||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
||||
if (cvar->flags & CV_NETVAR)
|
||||
Setvalue(cvar, cvar->defaultvalue, true);
|
||||
*/
|
||||
|
||||
count = READUINT16(p);
|
||||
while (count--)
|
||||
@@ -1855,7 +1793,7 @@ void CV_AddValue(consvar_t *var, INT32 increment)
|
||||
if (newvalue == oldvalue)
|
||||
break; // don't loop forever if there's none of a certain gametype
|
||||
|
||||
if (newvalue >= 0 && newvalue < NUMMAPS && !mapheaderinfo[newvalue])
|
||||
if (newvalue >= 0 && !mapheaderinfo[newvalue])
|
||||
continue; // Don't allocate the header. That just makes memory usage skyrocket.
|
||||
|
||||
} while (!M_CanShowLevelInList(newvalue, gt));
|
||||
|
||||
+83
-196
@@ -46,16 +46,16 @@
|
||||
#ifdef HAVE_THREADS
|
||||
I_mutex con_mutex;
|
||||
|
||||
// I_In_Exiting_Signal_Handler is an evil hack
|
||||
// g_in_exiting_signal_handler is an evil hack
|
||||
// to avoid infinite SIGABRT recursion in the signal handler
|
||||
// due to poisoned locks or mach-o kernel not supporting locks in signals
|
||||
// or something like that. idk
|
||||
# define Lock_state() if (!I_In_Exiting_Signal_Handler()) { I_lock_mutex(&con_mutex); }
|
||||
# define Unlock_state() if (!I_In_Exiting_Signal_Handler()) { I_unlock_mutex(con_mutex); }
|
||||
#else /*HAVE_THREADS*/
|
||||
# define Lock_state() if (!g_in_exiting_signal_handler) { I_lock_mutex(&con_mutex); }
|
||||
# define Unlock_state() if (!g_in_exiting_signal_handler) { I_unlock_mutex(con_mutex); }
|
||||
#else/*HAVE_THREADS*/
|
||||
# define Lock_state()
|
||||
# define Unlock_state()
|
||||
#endif /*HAVE_THREADS*/
|
||||
#endif/*HAVE_THREADS*/
|
||||
|
||||
static boolean con_started = false; // console has been initialised
|
||||
boolean con_startup = false; // true at game startup, screen need refreshing
|
||||
@@ -208,6 +208,14 @@ static void CONS_Clear_f(void)
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
// Choose english keymap
|
||||
//
|
||||
/*static void CONS_English_f(void)
|
||||
{
|
||||
shiftxform = english_shiftxform;
|
||||
CONS_Printf(M_GetText("%s keymap.\n"), M_GetText("English"));
|
||||
}*/
|
||||
|
||||
static char *bindtable[NUMINPUTS];
|
||||
|
||||
static void CONS_Bind_f(void)
|
||||
@@ -625,191 +633,72 @@ void CON_MoveConsole(void)
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// KEYBOARD LAYOUTS FOR ENTERING TEXT
|
||||
//======================================================================
|
||||
|
||||
static char english_shiftxform[] =
|
||||
{
|
||||
0,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31,
|
||||
' ', '!', '"', '#', '$', '%', '&',
|
||||
'"', // shift-'
|
||||
'(', ')', '*', '+',
|
||||
'<', // shift-,
|
||||
'_', // shift--
|
||||
'>', // shift-.
|
||||
'?', // shift-/
|
||||
')', // shift-0
|
||||
'!', // shift-1
|
||||
'@', // shift-2
|
||||
'#', // shift-3
|
||||
'$', // shift-4
|
||||
'%', // shift-5
|
||||
'^', // shift-6
|
||||
'&', // shift-7
|
||||
'*', // shift-8
|
||||
'(', // shift-9
|
||||
':',
|
||||
':', // shift-;
|
||||
'<',
|
||||
'+', // shift-=
|
||||
'>', '?', '@',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'{', // shift-[
|
||||
'|', // shift-backslash - OH MY GOD DOES WATCOM SUCK
|
||||
'}', // shift-]
|
||||
'"', '_',
|
||||
'~', // shift-`
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'{', '|', '}', '~', 127
|
||||
};
|
||||
|
||||
static char french_shiftxform[] =
|
||||
{
|
||||
0,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31,
|
||||
' ','$', //shift-!
|
||||
'3', //shift-"
|
||||
'#', '$', '%',
|
||||
'1', //shift-&
|
||||
'4', // shift-'
|
||||
'5', // shift-(
|
||||
')', // shift-)
|
||||
'*', '+',
|
||||
'?', // shift-,
|
||||
'6', // shift--
|
||||
'.', '/',
|
||||
'0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9',
|
||||
'/', // shitf-:
|
||||
'.', // shift-;
|
||||
'>', // shift-<
|
||||
'+', // shift-=
|
||||
'>', '?', '@',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'[', '\\', ']', '^',
|
||||
'8', //shift-_
|
||||
'`',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'{', '|', '}', '~', 127,
|
||||
128, 129,
|
||||
'2',
|
||||
131, 132,
|
||||
'0',
|
||||
134,
|
||||
'9',
|
||||
136, 137,
|
||||
'7',
|
||||
139, 140,
|
||||
'%'
|
||||
};
|
||||
|
||||
static char french_altgrxform[] =
|
||||
{
|
||||
0,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31,
|
||||
' ', '!',
|
||||
'#', //altgr-"
|
||||
'#', '$', '%', '&',
|
||||
'{', //altgr-'
|
||||
'[', //altgr-(
|
||||
']', //altgr-)
|
||||
'*', '+', ',',
|
||||
'|', //altg--
|
||||
'.', '/',
|
||||
'0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9',
|
||||
':', ';', '<',
|
||||
'}', //altgr-=
|
||||
'>', '?', '@',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'[', '\\', ']', '^',
|
||||
'\\', //altgr-backslash
|
||||
'`',
|
||||
'a', 'b', 'c', 'd', 'E', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'{', '|', '}', '~', 127,
|
||||
128, 129,
|
||||
'~',
|
||||
131, 132,
|
||||
'@',
|
||||
134,
|
||||
'^',
|
||||
136, 137,
|
||||
'`',
|
||||
139, 140,
|
||||
KEY_FR_U_GRAVE
|
||||
};
|
||||
|
||||
// fallback for special letter non displayable in the game (i.e.: 'é','à',etc.)
|
||||
static INT32 CON_FallBackFrSpecialLetter(INT32 key)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case KEY_FR_E_AIGUE: return 'e';
|
||||
case KEY_FR_E_GRAVE: return 'e';
|
||||
case KEY_FR_C_CEDILLE: return 'c';
|
||||
case KEY_FR_A_GRAVE: return 'a';
|
||||
case KEY_FR_U_GRAVE: return 'u';
|
||||
default: return key;
|
||||
}
|
||||
}
|
||||
|
||||
// goddang AZERTY
|
||||
static size_t CON_GetShiftSize(void)
|
||||
{
|
||||
return ((cv_keyboardlayout.value == 3) ? sizeof(french_shiftxform) : sizeof(english_shiftxform));
|
||||
}
|
||||
|
||||
static char *CON_Shiftform(void)
|
||||
{
|
||||
return (cv_keyboardlayout.value == 3) ? french_shiftxform : english_shiftxform;
|
||||
}
|
||||
|
||||
INT32 CON_ShiftChar(INT32 ch)
|
||||
{
|
||||
if (I_UseNativeKeyboard() || ch >= (INT32)CON_GetShiftSize())
|
||||
if (I_UseNativeKeyboard())
|
||||
return ch;
|
||||
|
||||
// warning: shiftdown is NOT a boolean, it's 1 or 2 for lshift/rshift
|
||||
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
|
||||
{
|
||||
return !!shiftdown != capslock ? CON_Shiftform()[ch] : ch;
|
||||
if (cv_keyboardlayout.value == 3)
|
||||
{
|
||||
if (shiftdown ^ capslock)
|
||||
ch = shiftxform[ch];
|
||||
else if (altdown & 0x2)
|
||||
ch = french_altgrxform[ch];
|
||||
else
|
||||
ch = HU_FallBackFrSpecialLetter(ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shiftdown ^ capslock)
|
||||
ch = shiftxform[ch];
|
||||
}
|
||||
}
|
||||
|
||||
// if we're holding shift we should still shift non letter symbols
|
||||
if (shiftdown)
|
||||
else // if we're holding shift we should still shift non letter symbols
|
||||
{
|
||||
return CON_Shiftform()[ch];
|
||||
}
|
||||
|
||||
// AZERTY
|
||||
if (cv_keyboardlayout.value == 3)
|
||||
{
|
||||
if (altdown & 0x2)
|
||||
return french_altgrxform[ch];
|
||||
|
||||
return CON_FallBackFrSpecialLetter(ch);
|
||||
if (cv_keyboardlayout.value == 3)
|
||||
{
|
||||
if (shiftdown)
|
||||
ch = shiftxform[ch];
|
||||
else if (altdown & 0x2)
|
||||
ch = french_altgrxform[ch];
|
||||
else
|
||||
ch = HU_FallBackFrSpecialLetter(ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shiftdown)
|
||||
ch = shiftxform[ch];
|
||||
}
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
INT32 CON_ShitAndAltGrChar(INT32 ch)
|
||||
{
|
||||
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
|
||||
{
|
||||
if (shiftdown ^ capslock)
|
||||
ch = shiftxform[ch];
|
||||
}
|
||||
else // if we're holding shift we should still shift non letter symbols
|
||||
{
|
||||
if (shiftdown)
|
||||
ch = shiftxform[ch];
|
||||
else if (altdown & 0x2)
|
||||
{
|
||||
ch = french_altgrxform[ch];
|
||||
}
|
||||
else
|
||||
{
|
||||
ch = HU_FallBackFrSpecialLetter(ch);
|
||||
}
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
// Clear time of console heads up messages
|
||||
//
|
||||
@@ -1003,7 +892,7 @@ boolean CON_Responder(event_t *ev)
|
||||
return true;
|
||||
|
||||
// ctrl modifier -- changes behavior, adds shortcuts
|
||||
if (ctrldown && (cv_keyboardlayout.value != 3 || !altdown))
|
||||
if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
|
||||
{
|
||||
// show all cvars/commands that match what we have inputted
|
||||
if (key == KEY_TAB)
|
||||
@@ -1333,10 +1222,19 @@ void CON_LogMessage(const char *msg)
|
||||
// Console print! Wahooo! Lots o fun!
|
||||
//
|
||||
|
||||
static inline void CONS_PrintMsg(char *txt)
|
||||
void CONS_Printf(const char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
static char *txt = NULL;
|
||||
boolean startup;
|
||||
|
||||
if (txt == NULL)
|
||||
txt = malloc(8192);
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsnprintf(txt, 8192, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
// echo console prints to log file
|
||||
DEBFILE(txt);
|
||||
|
||||
@@ -1362,21 +1260,6 @@ static inline void CONS_PrintMsg(char *txt)
|
||||
}
|
||||
}
|
||||
|
||||
void CONS_Printf(const char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
static char *txt = NULL;
|
||||
|
||||
if (txt == NULL)
|
||||
txt = malloc(8192);
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsnprintf(txt, 8192, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
CONS_PrintMsg(txt);
|
||||
}
|
||||
|
||||
void CONS_Alert(alerttype_t level, const char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
@@ -1405,7 +1288,9 @@ void CONS_Alert(alerttype_t level, const char *fmt, ...)
|
||||
break;
|
||||
}
|
||||
|
||||
CONS_PrintMsg(txt);
|
||||
// I am lazy and I feel like just letting CONS_Printf take care of things.
|
||||
// Is that okay?
|
||||
CONS_Printf("%s", txt);
|
||||
}
|
||||
|
||||
void CONS_Debug(INT32 debugflags, const char *fmt, ...)
|
||||
@@ -1423,9 +1308,11 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...)
|
||||
vsnprintf(txt, 8192, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
CONS_PrintMsg(txt);
|
||||
// Again I am lazy, oh well
|
||||
CONS_Printf("%s", txt);
|
||||
}
|
||||
|
||||
|
||||
// Print an error message, and wait for ENTER key to continue.
|
||||
// To make sure the user has seen the message
|
||||
//
|
||||
|
||||
@@ -49,6 +49,7 @@ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *or
|
||||
extern UINT8 *consolebgmap;
|
||||
|
||||
INT32 CON_ShiftChar(INT32 ch);
|
||||
INT32 CON_ShitAndAltGrChar(INT32 ch);
|
||||
|
||||
void CON_SetupBackColormap(void);
|
||||
void CON_ClearHUD(void); // clear heads up messages
|
||||
|
||||
+75
-187
@@ -100,10 +100,6 @@ static int map_icon_request_count; // current count of icon requests sent
|
||||
static UINT8 *map_icon_data;
|
||||
static patch_t *map_icon;
|
||||
|
||||
// if true, signals the game to only load addons AND gamestate
|
||||
// instead of fully joining a server
|
||||
static boolean cl_addonsonly = false;
|
||||
|
||||
plrinfo playerinfo[MAXPLAYERS] = {};
|
||||
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||
|
||||
@@ -177,11 +173,11 @@ static UINT16 resynch_delay[MAXNETNODES]; // delay time before the player can be
|
||||
static UINT32 resynch_status[MAXNETNODES]; // 0 bit means synched for that player, 1 means possibly desynched
|
||||
static UINT8 resynch_sent[MAXNETNODES][MAXPLAYERS]; // what synch packets have we attempted to send to the player
|
||||
static UINT8 resynch_inprogress[MAXNETNODES];
|
||||
static boolean resynch_local_inprogress = false; // WE are desynched and getting packets to fix it.
|
||||
boolean hu_resynching = false;
|
||||
static UINT8 resynch_local_inprogress = false; // WE are desynched and getting packets to fix it.
|
||||
UINT8 hu_resynching = 0;
|
||||
|
||||
#ifdef SATURNPAK
|
||||
boolean hu_redownloadinggamestate = false;
|
||||
UINT8 hu_redownloadinggamestate = 0;
|
||||
static UINT8 gamestate_resend_counter[MAXNETNODES];
|
||||
#endif
|
||||
|
||||
@@ -196,7 +192,7 @@ static UINT8 mynode; // my address pointofview server
|
||||
|
||||
#ifdef SATURNPAK
|
||||
static boolean cl_redownloadinggamestate = false;
|
||||
static boolean is_client_saturn[MAXNETNODES];
|
||||
boolean is_client_saturn[MAXNETNODES];
|
||||
#endif
|
||||
|
||||
#ifdef SATURNJOIN
|
||||
@@ -1154,67 +1150,6 @@ static void CV_LoadPlayerNames(UINT8 **p)
|
||||
}
|
||||
}
|
||||
|
||||
static void CL_DrawAddonTypes(void)
|
||||
{
|
||||
if (!cv_serveraddoninfo.value)
|
||||
return;
|
||||
|
||||
INT32 y = 0;
|
||||
|
||||
INT32 addontypes_downloaded[NUMADDONTYPES] = {0};
|
||||
|
||||
for (INT32 i = 0; i < fileneedednum; ++i)
|
||||
{
|
||||
switch (fileneeded[i].status)
|
||||
{
|
||||
case FS_FOUND:
|
||||
case FS_OPEN:
|
||||
addontypes_downloaded[fileneeded[i].type]++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (addontype_t type = 0; type < NUMADDONTYPES; ++type)
|
||||
{
|
||||
if (addontypes[type] == 0)
|
||||
continue;
|
||||
|
||||
INT32 flags = V_SNAPTOTOP|V_SNAPTOLEFT|V_ALLOWLOWERCASE;
|
||||
|
||||
if (addontypes[type] == addontypes_downloaded[type])
|
||||
flags |= V_GREENMAP;
|
||||
else
|
||||
flags |= V_YELLOWMAP;
|
||||
|
||||
const char *typestr = "Misc";
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ADDON_SCRIPT:
|
||||
typestr = "Script";
|
||||
break;
|
||||
|
||||
case ADDON_MAP:
|
||||
typestr = "Map";
|
||||
break;
|
||||
|
||||
case ADDON_CHARACTER:
|
||||
typestr = "Character";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
V_DrawSmallString(4, 4 + y, flags, va("%s addons", typestr));
|
||||
V_DrawRightAlignedSmallString(100, 4 + y, flags, va("%d/%d", addontypes_downloaded[type], addontypes[type]));
|
||||
y += 6;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// CL_DrawConnectionStatus
|
||||
//
|
||||
@@ -1255,18 +1190,20 @@ static void CL_DrawConnectionStatus(void)
|
||||
case CL_DOWNLOADSAVEGAME:
|
||||
if (filedownload.current != -1)
|
||||
{
|
||||
UINT32 dldlength = 0;
|
||||
INT32 dldlength = 0;
|
||||
fileneeded_t *file = &fileneeded[filedownload.current];
|
||||
UINT32 currentsize = file->currentsize;
|
||||
UINT32 totalsize = file->totalsize;
|
||||
UINT32 currentsize = min(file->currentsize, totalsize);
|
||||
|
||||
cltext = M_GetText("Downloading game state...");
|
||||
Net_GetNetStat();
|
||||
|
||||
if (totalsize != 0)
|
||||
dldlength = (UINT32)((currentsize/(double)totalsize) * 256);
|
||||
dldlength = (INT32)((currentsize/(double)totalsize) * 256);
|
||||
if (dldlength > 256)
|
||||
dldlength = 256;
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 111);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, (INT32)dldlength, 8, 96);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, dldlength, 8, 96);
|
||||
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
va(" %4uK/%4uK", currentsize>>10, totalsize>>10));
|
||||
@@ -1328,8 +1265,6 @@ static void CL_DrawConnectionStatus(void)
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %2u/%2u Files", checkednum, fileneedednum));
|
||||
|
||||
CL_DrawAddonTypes();
|
||||
}
|
||||
else if (cl_mode == CL_LOADFILES)
|
||||
{
|
||||
@@ -1353,8 +1288,6 @@ static void CL_DrawConnectionStatus(void)
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %2u/%2u Files", loadcompletednum, fileneedednum));
|
||||
|
||||
CL_DrawAddonTypes();
|
||||
}
|
||||
else if (cl_mode == CL_VIEWSERVER)
|
||||
{
|
||||
@@ -1478,20 +1411,18 @@ static void CL_DrawConnectionStatus(void)
|
||||
// Buttons
|
||||
V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239);
|
||||
V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80"));
|
||||
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sSPACE%s] = Load Addons", "\x82", "\x80"));
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80"));
|
||||
}
|
||||
else if (filedownload.current != -1)
|
||||
{
|
||||
UINT32 dldlength = 0;
|
||||
INT32 dldlength = 0;
|
||||
INT32 totalfileslength = 0;
|
||||
UINT32 totaldldsize = 0;
|
||||
UINT32 totalfileslength = 0;
|
||||
static char tempname[28];
|
||||
fileneeded_t *file = &fileneeded[filedownload.current];
|
||||
char *filename = file->filename;
|
||||
UINT32 currentsize = file->currentsize;
|
||||
UINT32 totalsize = file->totalsize;
|
||||
UINT32 currentsize = min(file->currentsize, totalsize);
|
||||
UINT32 fdtotalsize = filedownload.totalsize;
|
||||
|
||||
// Draw the bottom box.
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-58-8, 32, 1);
|
||||
@@ -1499,9 +1430,11 @@ static void CL_DrawConnectionStatus(void)
|
||||
|
||||
Net_GetNetStat();
|
||||
if (totalsize != 0)
|
||||
dldlength = (UINT32)((currentsize/(double)totalsize) * 256);
|
||||
dldlength = (INT32)((currentsize/(double)totalsize) * 256);
|
||||
if (dldlength > 256)
|
||||
dldlength = 256;
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-58, 256, 8, 175);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-58, (INT32)dldlength, 8, 160);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-58, dldlength, 8, 160);
|
||||
|
||||
memset(tempname, 0, sizeof(tempname));
|
||||
|
||||
@@ -1542,23 +1475,21 @@ static void CL_DrawConnectionStatus(void)
|
||||
totaldldsize = filedownload.completedsize;
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-14, V_YELLOWMAP|MENUCAPS, "Overall Download Progress");
|
||||
if (fdtotalsize != 0)
|
||||
totalfileslength = (UINT32)((totaldldsize/(double)fdtotalsize) * 256);
|
||||
if (filedownload.totalsize != 0)
|
||||
totalfileslength = (INT32)((totaldldsize/(double)filedownload.totalsize) * 256);
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, (INT32)totalfileslength, 8, 160);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
|
||||
if ((fdtotalsize>>20) >= 10) // display in MB if over 10MB
|
||||
if (filedownload.totalsize>>20 >= 10) // display in MB if over 10MB
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %4uM/%4uM", (INT32)(totaldldsize>>20), (INT32)(fdtotalsize>>20)));
|
||||
va(" %4uM/%4uM", totaldldsize>>20, filedownload.totalsize>>20));
|
||||
else
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %4uK/%4uK", (INT32)(totaldldsize>>10), (INT32)(fdtotalsize>>10)));
|
||||
va(" %4uK/%4uK", totaldldsize>>10, filedownload.totalsize>>10));
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va("%2u/%2u Files ", filedownload.completednum, filedownload.totalnum));
|
||||
|
||||
CL_DrawAddonTypes();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1575,8 +1506,6 @@ static void CL_DrawConnectionStatus(void)
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP|MENUCAPS,
|
||||
M_GetText("Waiting to download files..."));
|
||||
|
||||
CL_DrawAddonTypes();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2228,12 +2157,7 @@ static void CL_ReloadReceivedSavegame(void)
|
||||
static void SendAskInfo(INT32 node)
|
||||
{
|
||||
tic_t asktime;
|
||||
doomdata_t *netbuffer;
|
||||
|
||||
if (node == -1)
|
||||
return;
|
||||
|
||||
netbuffer = DOOMCOM_DATA(doomcom);
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
if (node != 0 && node != BROADCASTADDR &&
|
||||
@@ -2580,7 +2504,7 @@ static boolean CL_FinishedFileList(void)
|
||||
* \sa CL_ConnectToServer
|
||||
*
|
||||
*/
|
||||
static void CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
@@ -2598,7 +2522,7 @@ static void CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
{
|
||||
i = SL_SearchServer(servernode);
|
||||
if (i < 0)
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
joinnode = i;
|
||||
@@ -2626,11 +2550,10 @@ static void CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
{
|
||||
cl_mode = CL_ASKFULLFILELIST;
|
||||
cl_lastcheckedfilecount = 0;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
CL_CheckAddonTypes();
|
||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2638,7 +2561,7 @@ static void CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
*asksent = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ask the info to the server (askinfo packet)
|
||||
@@ -2648,17 +2571,7 @@ static void CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||
*asksent = I_GetTime() + NEWTICRATE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void FreeMapIcon(void)
|
||||
{
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon = NULL;
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
map_icon_request_count = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Called by CL_ConnectToServer
|
||||
@@ -2679,15 +2592,13 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
switch (cl_mode)
|
||||
{
|
||||
case CL_SEARCHING:
|
||||
CL_ServerConnectionSearchTicker(asksent);
|
||||
if (!CL_ServerConnectionSearchTicker(asksent))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case CL_ASKFULLFILELIST:
|
||||
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
|
||||
{
|
||||
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
CL_CheckAddonTypes();
|
||||
}
|
||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
|
||||
{
|
||||
if (CL_AskFileList(fileneedednum))
|
||||
@@ -2820,19 +2731,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
{
|
||||
// Gamestate is now handled within CL_LoadReceivedSavegame()
|
||||
CL_LoadReceivedSavegame(false);
|
||||
|
||||
if (cl_addonsonly)
|
||||
{
|
||||
// close connection after savegame load
|
||||
// we want the actual server state
|
||||
// in case theres some stuff like records to be synched
|
||||
cl_mode = CL_ABORTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl_mode = CL_CONNECTED;
|
||||
}
|
||||
|
||||
cl_mode = CL_CONNECTED;
|
||||
break;
|
||||
} // don't break case continue to CL_CONNECTED
|
||||
else
|
||||
@@ -2846,21 +2745,17 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
case CL_ABORTED:
|
||||
cl_mode = CL_SEARCHING;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
GetPackets();
|
||||
Net_AckTicker();
|
||||
|
||||
// Call it only once by tic
|
||||
if (*oldtic != I_GetTime())
|
||||
if (*oldtic != I_GetGlobalTime())
|
||||
{
|
||||
INT32 key;
|
||||
|
||||
if (I_Interrupted())
|
||||
{
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
I_OsPolling();
|
||||
|
||||
if (cl_mode == CL_CONFIRMCONNECT)
|
||||
@@ -2872,21 +2767,24 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
{
|
||||
if (key == KEY_ENTER || key == KEY_JOY1)
|
||||
{
|
||||
cl_addonsonly = false;
|
||||
cl_mode = CL_CHECKFILES;
|
||||
FreeMapIcon();
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon = NULL;
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
}
|
||||
else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
|
||||
{
|
||||
cl_mode = CL_ABORTED;
|
||||
cl_addonsonly = false;
|
||||
FreeMapIcon();
|
||||
}
|
||||
else if (key == KEY_SPACE || key == KEY_JOY1+2)
|
||||
{
|
||||
cl_addonsonly = true;
|
||||
cl_mode = CL_CHECKFILES;
|
||||
FreeMapIcon();
|
||||
if (map_icon != NULL)
|
||||
Patch_Free(map_icon);
|
||||
map_icon = NULL;
|
||||
if (map_icon_data != NULL)
|
||||
Z_Free(map_icon_data);
|
||||
map_icon_data = NULL;
|
||||
map_icon_request_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2895,11 +2793,11 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
{
|
||||
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
||||
CL_AbortConnection();
|
||||
cl_addonsonly = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
*oldtic = I_GetTime();
|
||||
|
||||
*oldtic = I_GetGlobalTime();
|
||||
|
||||
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
||||
{
|
||||
@@ -2921,7 +2819,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
else
|
||||
{
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
I_UpdateTime();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3392,21 +3290,9 @@ static void Command_connect(void)
|
||||
}
|
||||
else
|
||||
CONS_Alert(CONS_ERROR, M_GetText("There is no network driver\n"));
|
||||
|
||||
// invalid address
|
||||
if (servernode == -1)
|
||||
{
|
||||
D_QuitNetGame(); // this will also call D_CloseConnection for us
|
||||
CL_Reset();
|
||||
servernode = 0; // not sure if this is cool, but if this is -1 then bad things happen in alot of networking code
|
||||
D_StartTitle();
|
||||
M_StartMessage(M_GetText("Failed to connect to server\nMake sure you put in a valid Address!\n"), NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (I_GetNodeAddress)
|
||||
CV_Set(&cv_lastserver, I_GetNodeAddress(servernode));
|
||||
CV_Set(&cv_lastserver, I_GetNodeAddress(servernode));
|
||||
|
||||
if (splitscreen != cv_splitplayers.value-1)
|
||||
{
|
||||
@@ -3441,7 +3327,7 @@ void CL_ClearPlayer(INT32 playernum)
|
||||
if (players[playernum].mo)
|
||||
{
|
||||
// Don't leave a NiGHTS ghost!
|
||||
if (UNLIKELY((players[playernum].pflags & PF_NIGHTSMODE) && players[playernum].mo->tracer))
|
||||
if ((players[playernum].pflags & PF_NIGHTSMODE) && players[playernum].mo->tracer)
|
||||
P_RemoveMobj(players[playernum].mo->tracer);
|
||||
P_RemoveMobj(players[playernum].mo);
|
||||
}
|
||||
@@ -3587,7 +3473,6 @@ static void Command_GetPlayerNum(void)
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
{
|
||||
if (serverplayer == i)
|
||||
@@ -3595,7 +3480,6 @@ static void Command_GetPlayerNum(void)
|
||||
else
|
||||
CONS_Printf(M_GetText("\x82num:%2d node:%2d %s\n"), i, playernode[i], player_names[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SINT8 nametonum(const char *name)
|
||||
@@ -4238,7 +4122,7 @@ static void Command_ResendGamestate(void)
|
||||
}
|
||||
|
||||
playernum = nametonum(COM_Argv(1));
|
||||
if (playernum <= 0)
|
||||
if (playernum == -1 || playernum == 0)
|
||||
return;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
@@ -4301,8 +4185,6 @@ consvar_t cv_connectawaittime = {"connectawaittime", "5", CV_SAVE, connectawaitt
|
||||
|
||||
consvar_t cv_serverinfoscreen = {"serverinfoscreen", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_serveraddoninfo = {"serveraddoninfo", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void Got_AddPlayer(const UINT8 **p, INT32 playernum);
|
||||
static void Got_RemovePlayer(const UINT8 **p, INT32 playernum);
|
||||
|
||||
@@ -4375,7 +4257,7 @@ void D_ClientServerInit(void)
|
||||
playerinfo[i].node = 255;
|
||||
|
||||
gametic = 0;
|
||||
leveltime = 0;
|
||||
localgametic = 0;
|
||||
|
||||
// do not send anything before the real begin
|
||||
SV_StopServer();
|
||||
@@ -4710,7 +4592,7 @@ static boolean SV_AddWaitingPlayers(SINT8 node)
|
||||
|
||||
for (n = 0; n < MAXNETNODES; n++)
|
||||
{
|
||||
if (nodetoplayer[n] == newplayernum ||
|
||||
if (nodetoplayer[n] == newplayernum ||
|
||||
nodetoplayer2[n] == newplayernum ||
|
||||
nodetoplayer3[n] == newplayernum ||
|
||||
nodetoplayer4[n] == newplayernum)
|
||||
@@ -5002,6 +4884,10 @@ static const char *GetRefuseMessage(SINT8 node)
|
||||
{
|
||||
return va("Maximum players reached: %d", maxplayers);
|
||||
}
|
||||
else if (cc->localplayers != 1)
|
||||
{
|
||||
return "Wrong player count.";
|
||||
}
|
||||
else if (netgame && !cc->localplayers) // Stealth join?
|
||||
{
|
||||
return "No players from\nthis node.";
|
||||
@@ -5631,7 +5517,7 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
||||
realstart = ExpandTics(netbuffer->u.clientpak.client_tic, nettics[node]);
|
||||
realend = ExpandTics(netbuffer->u.clientpak.resendfrom, nettics[node]);
|
||||
|
||||
if ( netbuffer->packettype == PT_CLIENTMIS || netbuffer->packettype == PT_CLIENT2MIS
|
||||
if (netbuffer->packettype == PT_CLIENTMIS || netbuffer->packettype == PT_CLIENT2MIS
|
||||
|| netbuffer->packettype == PT_CLIENT3MIS || netbuffer->packettype == PT_CLIENT4MIS
|
||||
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS
|
||||
|| supposedtics[node] < realend)
|
||||
@@ -5674,10 +5560,10 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
||||
return;
|
||||
|
||||
// Splitscreen cmd
|
||||
if ((nodetoplayer2[node] >= 0) &&
|
||||
((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS)
|
||||
if (((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS)
|
||||
|| (netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|
||||
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)))
|
||||
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
|
||||
&& (nodetoplayer2[node] >= 0))
|
||||
{
|
||||
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer2[node]], &netbuffer->u.client2pak.cmd2, 1);
|
||||
|
||||
@@ -5685,9 +5571,9 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((nodetoplayer3[node] >= 0) &&
|
||||
((netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|
||||
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)))
|
||||
if (((netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|
||||
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
|
||||
&& (nodetoplayer3[node] >= 0))
|
||||
{
|
||||
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer3[node]], &netbuffer->u.client3pak.cmd3, 1);
|
||||
|
||||
@@ -5695,8 +5581,8 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((nodetoplayer4[node] >= 0) &&
|
||||
(netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
|
||||
if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)
|
||||
&& (nodetoplayer4[node] >= 0))
|
||||
{
|
||||
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer4[node]], &netbuffer->u.client4pak.cmd4, 1);
|
||||
|
||||
@@ -5992,11 +5878,13 @@ static void PT_ServerTics(SINT8 node)
|
||||
realend = gametic + CLIENTBACKUPTICS;
|
||||
cl_packetmissed = realstart > neededtic;
|
||||
|
||||
UINT8 *pak = (UINT8 *)&packet->cmds;
|
||||
UINT8 *txtpak = (UINT8 *)&packet->cmds[packet->numslots * packet->numtics];
|
||||
|
||||
if (realstart <= neededtic && realend > neededtic)
|
||||
{
|
||||
tic_t i, j;
|
||||
UINT8 *pak = (UINT8 *)&packet->cmds;
|
||||
UINT8 *txtpak = (UINT8 *)&packet->cmds[packet->numslots * packet->numtics];
|
||||
pak = (UINT8 *)&packet->cmds;
|
||||
|
||||
for (i = realstart; i < realend; i++)
|
||||
{
|
||||
@@ -6833,7 +6721,7 @@ boolean TryRunTics(tic_t realtics)
|
||||
{
|
||||
boolean update_stats = !(paused || P_AutoPause());
|
||||
|
||||
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, leveltime));
|
||||
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic));
|
||||
|
||||
if (update_stats)
|
||||
PS_START_TIMING(ps_tictime);
|
||||
|
||||
+2
-4
@@ -600,8 +600,6 @@ extern consvar_t cv_discordinvites;
|
||||
|
||||
extern consvar_t cv_serverinfoscreen;
|
||||
|
||||
extern consvar_t cv_serveraddoninfo;
|
||||
|
||||
// Used in d_net, the only dependence
|
||||
//tic_t ExpandTics(INT32 low, tic_t basetic);
|
||||
void D_ClientServerInit(void);
|
||||
@@ -656,9 +654,9 @@ void D_ResetTiccmds(void);
|
||||
|
||||
tic_t GetLag(INT32 node);
|
||||
|
||||
extern boolean hu_resynching;
|
||||
extern UINT8 hu_resynching;
|
||||
#ifdef SATURNPAK
|
||||
extern boolean hu_redownloadinggamestate;
|
||||
extern UINT8 hu_redownloadinggamestate;
|
||||
#endif
|
||||
extern boolean hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
||||
|
||||
|
||||
+89
-112
@@ -130,15 +130,14 @@ static size_t startuppwadcount = 0;
|
||||
// autoloading
|
||||
static char *autoloadwadfiles[MAX_WADFILES];
|
||||
static char *autoloadwadfilespost[MAX_WADFILES];
|
||||
static size_t autoloadwadcount = 0;
|
||||
static size_t postloadwadcount = 0;
|
||||
static size_t autoloadcount = 0;
|
||||
static size_t postloadcount = 0;
|
||||
//
|
||||
|
||||
boolean devparm = false; // started game with -devparm
|
||||
|
||||
boolean singletics = false; // timedemo
|
||||
boolean lastdraw = false;
|
||||
boolean intermissionbginit = false;
|
||||
|
||||
#ifdef MOTIONBLUR
|
||||
INT32 postimgparam[MAXSPLITSCREENPLAYERS];
|
||||
@@ -275,17 +274,21 @@ static void D_Renderview(void)
|
||||
|
||||
R_ApplyLevelInterpolators(R_GetTimeFrac(RTF_LEVEL));
|
||||
|
||||
if (rendermode == render_soft && cv_homremoval.value)
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (cv_homremoval.value == 1)
|
||||
// if this is display player 1
|
||||
if (cv_homremoval.value)
|
||||
{
|
||||
// Clear the software screen buffer to remove HOM
|
||||
memset(vid.screens[0], 31, vid.width * vid.height);
|
||||
}
|
||||
else if (cv_homremoval.value == 2)
|
||||
{
|
||||
//'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
|
||||
memset(vid.screens[0], 32+(timeinmap&15), vid.width * vid.height);
|
||||
if (cv_homremoval.value == 1)
|
||||
{
|
||||
// Clear the software screen buffer to remove HOM
|
||||
memset(vid.screens[0], 31, vid.width * vid.height);
|
||||
}
|
||||
else if (cv_homremoval.value == 2)
|
||||
{
|
||||
//'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
|
||||
memset(vid.screens[0], 32+(timeinmap&15), vid.width * vid.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +322,7 @@ static void D_Renderview(void)
|
||||
break;
|
||||
default: // Initialize for P1
|
||||
viewwindowy = viewwindowx = 0;
|
||||
objectsdrawn = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -329,17 +333,19 @@ static void D_Renderview(void)
|
||||
}
|
||||
else if (rendermode == render_soft)
|
||||
#endif
|
||||
{
|
||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||
}
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (i == 0)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
if (i == 0)
|
||||
R_ApplyViewMorph();
|
||||
#ifdef MOTIONBLUR
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
#else
|
||||
V_DoPostProcessor(i, 0);
|
||||
V_DoPostProcessor(i, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,33 +369,6 @@ static void D_Renderview(void)
|
||||
// added comment : there is a wipe eatch change of the gamestate
|
||||
gamestate_t wipegamestate = GS_LEVEL;
|
||||
|
||||
static void D_MakeIntermissionBG(void)
|
||||
{
|
||||
if (!lastdraw)
|
||||
return;
|
||||
|
||||
if (rendermode == render_none)
|
||||
{
|
||||
lastdraw = false;
|
||||
intermissionbginit = false;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
HWR_MakeScreenTexture();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.width);
|
||||
}
|
||||
|
||||
lastdraw = false;
|
||||
intermissionbginit = true;
|
||||
}
|
||||
|
||||
static boolean D_Display(void)
|
||||
{
|
||||
boolean ranwipe = false;
|
||||
@@ -555,8 +534,16 @@ static boolean D_Display(void)
|
||||
PS_START_TIMING(ps_rendercalltime);
|
||||
D_Renderview();
|
||||
PS_STOP_TIMING(ps_rendercalltime);
|
||||
}
|
||||
|
||||
D_MakeIntermissionBG();
|
||||
if (lastdraw)
|
||||
{
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
VID_BlitLinearScreen(vid.screens[0], vid.screens[1], vid.width, vid.height, vid.width, vid.width);
|
||||
}
|
||||
|
||||
lastdraw = false;
|
||||
}
|
||||
|
||||
PS_START_TIMING(ps_uitime);
|
||||
@@ -687,8 +674,6 @@ void D_SRB2Loop(void)
|
||||
server = true;
|
||||
|
||||
// Pushing of + parameters is now done back in D_SRB2Main, not here.
|
||||
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
oldentertics = I_GetTime();
|
||||
|
||||
// end of loading screen: CONS_Printf() will no more call FinishUpdate()
|
||||
@@ -722,15 +707,8 @@ void D_SRB2Loop(void)
|
||||
precise_t elapsed;
|
||||
precise_t enterprecise, finishprecise;
|
||||
|
||||
boolean ranwipe = false;
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
|
||||
if (I_Interrupted())
|
||||
{
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
memset(&g_dc, 0, sizeof(g_dc));
|
||||
Z_Frame_Reset();
|
||||
|
||||
@@ -738,7 +716,7 @@ void D_SRB2Loop(void)
|
||||
const UINT32 framecap = R_GetFramerateCap();
|
||||
capbudget = (framecap == 0) ? 0 : (precise_t)((double)precision / (double)framecap + 0.5); // + 0.5 instead of round
|
||||
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
boolean ranwipe = false;
|
||||
|
||||
if (lastwipetic)
|
||||
{
|
||||
@@ -801,6 +779,11 @@ void D_SRB2Loop(void)
|
||||
|
||||
doDisplay = true;
|
||||
}
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
G_DeviceLEDTick();
|
||||
}
|
||||
}
|
||||
|
||||
if (interp)
|
||||
@@ -809,12 +792,10 @@ void D_SRB2Loop(void)
|
||||
|
||||
// I looked at the possibility of putting in a float drawer for
|
||||
// perfstats and it's very complicated, so we'll just do this instead...
|
||||
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f);
|
||||
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(I_GetTimeFrac())) * 1000.0f);
|
||||
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0);
|
||||
|
||||
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
|
||||
|
||||
R_SetTimeFrac(lagging ? FRACUNIT : g_time.timefrac);
|
||||
R_SetTimeFrac(hu_stopped ? FRACUNIT : I_GetTimeFrac());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -842,13 +823,6 @@ void D_SRB2Loop(void)
|
||||
if (takescreenshot)
|
||||
M_DoScreenShot();
|
||||
|
||||
#ifndef DEDICATED
|
||||
if (!dedicated && renderisnewtic)
|
||||
{
|
||||
G_DeviceLEDTick();
|
||||
}
|
||||
#endif
|
||||
|
||||
// consoleplayer -> displayplayers (hear sounds from viewpoint)
|
||||
S_UpdateSounds(); // move positional sounds
|
||||
|
||||
@@ -1057,38 +1031,25 @@ static INT32 D_DetectFileType(const char* filename)
|
||||
}
|
||||
|
||||
// autoload that shit
|
||||
static void D_AutoloadFile(const char *file, char **filearray, size_t *index)
|
||||
static void D_AutoloadFile(const char *file, char **filearray, size_t index)
|
||||
{
|
||||
char *newfile;
|
||||
INT32 fileType = D_DetectFileType(file);
|
||||
|
||||
if (*index >= MAX_WADFILES)
|
||||
{
|
||||
CONS_Printf("D_AutoloadFile: Failed to add file %s! Too many autoloaded files\n", file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fileType)
|
||||
{
|
||||
CONS_Printf("D_AutoloadFile: File %s is unknown or invalid\n", file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileType == 1)
|
||||
{
|
||||
CONS_Printf("D_AutoloadFile: File %s is a directory\n", file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileType <= 6)
|
||||
{
|
||||
newfile = malloc(strlen(file) + 1);
|
||||
if (!newfile)
|
||||
I_Error("D_AutoloadFile: No more free memory to autoload file %s", file);
|
||||
I_Error("No more free memory to AutoloadFile %s",file);
|
||||
|
||||
strcpy(newfile, file);
|
||||
filearray[*index] = newfile;
|
||||
(*index)++;
|
||||
filearray[index] = newfile;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1131,7 +1092,7 @@ static void D_FindAddonsToAutoload(void)
|
||||
// If the file is found, run our shit
|
||||
if (!autoloadconfigfile) // nope outta here
|
||||
{
|
||||
autoloadwadcount = postloadwadcount = 0; // so D_AddAutoloadFiles can skip everything since nothings there to autoload
|
||||
autoloadcount = postloadcount = 0; // so D_AddAutoloadFiles can skip everything since nothings there to autoload
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1157,34 +1118,27 @@ static void D_FindAddonsToAutoload(void)
|
||||
if (newline)
|
||||
*newline = '\0';
|
||||
|
||||
// ok so theres still issues with players adding stuff to autoload by accident
|
||||
// sometimes this stuff contains maps
|
||||
// you can probably imagine how that goes in a netgame....
|
||||
if (W_CheckAutoLoadContainsMap(wadsToAutoload))
|
||||
{
|
||||
CONS_Printf("Autoload: file %s contains map data! skipping...", wadsToAutoload);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!postload && W_CheckPostLoadList(wadsToAutoload))
|
||||
{
|
||||
CONS_Printf("Autoload: forcing postload for file %s\n", wadsToAutoload);
|
||||
CONS_Printf("forcing postload for file %s\n", wadsToAutoload);
|
||||
postload = true;
|
||||
}
|
||||
|
||||
// LOAD IT
|
||||
if (!postload)
|
||||
{
|
||||
D_AutoloadFile(wadsToAutoload, autoloadwadfiles, &autoloadwadcount);
|
||||
D_AutoloadFile(wadsToAutoload, autoloadwadfiles, autoloadcount);
|
||||
autoloadcount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
D_AutoloadFile(wadsToAutoload, autoloadwadfilespost, &postloadwadcount);
|
||||
D_AutoloadFile(wadsToAutoload, autoloadwadfilespost, postloadcount);
|
||||
postloadcount++;
|
||||
}
|
||||
}
|
||||
|
||||
autoloadwadfiles[autoloadwadcount] = NULL;
|
||||
autoloadwadfilespost[postloadwadcount] = NULL;
|
||||
autoloadwadfiles[autoloadcount] = NULL;
|
||||
autoloadwadfilespost[postloadcount] = NULL;
|
||||
|
||||
// we dont want memory leaks around here do we?
|
||||
fclose(autoloadconfigfile);
|
||||
@@ -1193,7 +1147,7 @@ static void D_FindAddonsToAutoload(void)
|
||||
static void D_AddAutoloadFiles(void)
|
||||
{
|
||||
// nothing to autoload
|
||||
if (autoloadwadcount == 0)
|
||||
if (autoloadcount == 0)
|
||||
return;
|
||||
|
||||
CONS_Printf("D_AutoloadFile(): Loading autoloaded addons...\n");
|
||||
@@ -1201,15 +1155,15 @@ static void D_AddAutoloadFiles(void)
|
||||
if (W_AddAutoloadedLocalFiles(autoloadwadfiles) == 0)
|
||||
CONS_Printf("D_AutoloadFile(): Are you sure you put in valid files or what?\n");
|
||||
|
||||
D_CleanFile(autoloadwadfiles, autoloadwadcount);
|
||||
D_CleanFile(autoloadwadfiles, autoloadcount);
|
||||
|
||||
autoloadwadcount = 0;
|
||||
autoloadcount = 0;
|
||||
}
|
||||
|
||||
void D_AddPostloadFiles(void)
|
||||
{
|
||||
// nothing to postload
|
||||
if (postloadwadcount == 0 || !netgame)
|
||||
if (postloadcount == 0 || !netgame)
|
||||
return;
|
||||
|
||||
CONS_Printf("D_AddPostloadFiles(): Loading postloaded addons...\n");
|
||||
@@ -1217,9 +1171,9 @@ void D_AddPostloadFiles(void)
|
||||
if (W_AddAutoloadedLocalFiles(autoloadwadfilespost) == 0)
|
||||
CONS_Printf("D_AddPostloadFiles(): Are you sure you put in valid files or what?\n");
|
||||
|
||||
D_CleanFile(autoloadwadfilespost, postloadwadcount);
|
||||
D_CleanFile(autoloadwadfilespost, postloadcount);
|
||||
|
||||
postloadwadcount = 0;
|
||||
postloadcount = 0;
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -1228,7 +1182,7 @@ void D_AddPostloadFiles(void)
|
||||
|
||||
static boolean AddIWAD(const char * file, const char *dir)
|
||||
{
|
||||
char *path = va(pandf, dir, file);
|
||||
char * path = va(pandf, dir, file);
|
||||
|
||||
if (FIL_ReadFileOK(path))
|
||||
{
|
||||
@@ -1405,6 +1359,8 @@ static inline void D_MakeTitleString(char *s)
|
||||
// extra graphic patches for saturn specific thingies
|
||||
boolean xtra_speedo = false; // extra speedometer check
|
||||
boolean xtra_speedo_clr = false; // extra speedometer colour check
|
||||
boolean xtra_speedo3 = false; // 80x 11 extra speedometer check
|
||||
boolean xtra_speedo_clr3 = false; // 80x 11 extra speedometer colour check
|
||||
boolean achi_speedo = false; // achiiro speedometer check
|
||||
boolean achi_speedo_clr = false; // extra speedometer colour check
|
||||
boolean dial_speedo = false; // dial speedometer check
|
||||
@@ -1434,6 +1390,7 @@ static void D_CheckSaturnExtraFiles(void)
|
||||
CV_PossibleValue_t minimapdot_cons_temp[NUMMINIMAPDOTSTUFF] = {{0, "Off"}, {0, NULL}, {0, NULL}, {0, NULL}, {0, NULL}};
|
||||
|
||||
unsigned last_speedo_i = 0;
|
||||
unsigned last_driftgauge_i = 3;
|
||||
unsigned last_inputdisplay_i = 2;
|
||||
unsigned last_minimapdot_i = 0;
|
||||
#define PUSHCONS(cons, i, id, name) { ++i; cons[i].value = id; cons[i].strvalue = name; }
|
||||
@@ -1592,6 +1549,20 @@ static void D_CheckSaturnExtraFiles(void)
|
||||
if (found_extra3_kart)
|
||||
{
|
||||
mainwads++;
|
||||
|
||||
// 80x11 speedometer crap
|
||||
if (W_LumpExists("SP_SM3TC"))
|
||||
{
|
||||
xtra_speedo3 = true;
|
||||
PUSHCONS(speedo_cons_temp, last_speedo_i, 7, "Extra");
|
||||
PUSHCONS(driftgaugestyle_cons_temp, last_driftgauge_i, 5, "Extra");
|
||||
}
|
||||
|
||||
// 80x11 speedometer crap but colour
|
||||
if (W_LumpExists("SC_SM3TC"))
|
||||
{
|
||||
xtra_speedo_clr3 = true;
|
||||
}
|
||||
}
|
||||
|
||||
#undef PUSHCONS
|
||||
@@ -1666,6 +1637,12 @@ void D_SRB2Main(void)
|
||||
strcpy(srb2, "SRB2Kart");
|
||||
D_MakeTitleString(srb2);
|
||||
|
||||
#if defined (__OS2__) && !defined (HAVE_SDL)
|
||||
// set PM window title
|
||||
snprintf(pmData->title, sizeof (pmData->title), "SRB2Kart" VERSIONSTRING ": %s", title);
|
||||
pmData->title[sizeof (pmData->title) - 1] = '\0';
|
||||
#endif
|
||||
|
||||
if (devparm)
|
||||
CONS_Printf(M_GetText("Development mode ON.\n"));
|
||||
|
||||
@@ -1789,6 +1766,10 @@ void D_SRB2Main(void)
|
||||
// Setup default unlockable conditions
|
||||
M_SetupDefaultConditionSets();
|
||||
|
||||
// Setup character tables
|
||||
// Have to be done here before files are loaded
|
||||
M_InitCharacterTables();
|
||||
|
||||
// load wad, including the main wad file
|
||||
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
|
||||
|
||||
@@ -2042,13 +2023,9 @@ void D_SRB2Main(void)
|
||||
if (M_CheckProtoParam("replay"))
|
||||
{
|
||||
const char *replayurl = M_GetProtoParam();
|
||||
char *replayname = strrchr(replayurl, '/');
|
||||
|
||||
if (!replayurl)
|
||||
I_Error("REPLAY: Invalid URL.");
|
||||
|
||||
gconst char *replayname = strrchr(replayurl, '/');
|
||||
|
||||
if (!replayname)
|
||||
if (!replayname || !replayurl)
|
||||
I_Error("REPLAY: Invalid URL.");
|
||||
|
||||
#define REPLAYDIR "/DownloadedReplays/"
|
||||
@@ -2162,8 +2139,8 @@ void D_SRB2Main(void)
|
||||
|
||||
if (dedicated && server)
|
||||
{
|
||||
levelstarttic = gametic;
|
||||
G_SetGamestate(GS_LEVEL);
|
||||
|
||||
if (!P_SetupLevel(false, false))
|
||||
I_Quit(); // fail so reset game stuff
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ extern boolean found_extra3_kart; // for use in k_kart.c
|
||||
|
||||
extern boolean xtra_speedo; // extra speedometer check
|
||||
extern boolean xtra_speedo_clr; // extra speedometer colour check
|
||||
extern boolean xtra_speedo3; // 80x11 extra speedometer check
|
||||
extern boolean xtra_speedo_clr3; // 80x11 extra speedometer colour check
|
||||
extern boolean achi_speedo; // achiiro speedometer check
|
||||
extern boolean achi_speedo_clr; // extra speedometer colour check
|
||||
extern boolean dial_speedo; // dial speedometer check
|
||||
|
||||
+3
-3
@@ -596,12 +596,12 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
|
||||
HGetPacket();
|
||||
|
||||
while (timeout > I_GetTime() && !Net_AllAcksReceived())
|
||||
while (timeout > I_GetGlobalTime() && !Net_AllAcksReceived())
|
||||
{
|
||||
while (tictac == I_GetTime())
|
||||
while (tictac == I_GetGlobalTime())
|
||||
{
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
I_UpdateTime();
|
||||
}
|
||||
|
||||
tictac = I_GetTime();
|
||||
|
||||
@@ -27,6 +27,7 @@ extern "C" {
|
||||
// SINT8 is used for nodes sometimes >:(
|
||||
#define MAXNETNODES 127
|
||||
#define BROADCASTADDR MAXNETNODES
|
||||
#define NETSPLITSCREEN // Kart's splitscreen netgame feature
|
||||
|
||||
#define STATLENGTH (TICRATE*2)
|
||||
|
||||
|
||||
+28
-64
@@ -900,7 +900,6 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_mindelay);
|
||||
CV_RegisterVar(&cv_gentlemens);
|
||||
CV_RegisterVar(&cv_serverinfoscreen);
|
||||
CV_RegisterVar(&cv_serveraddoninfo);
|
||||
|
||||
#ifdef NETGAME_DEVMODE
|
||||
CV_RegisterVar(&cv_fishcake);
|
||||
@@ -1010,10 +1009,6 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_gamepadled[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_gamepadifunfocused);
|
||||
CV_RegisterVar(&cv_gamepadledifunfocused);
|
||||
CV_RegisterVar(&cv_rumbleifunfocused);
|
||||
|
||||
CV_RegisterVar(&cv_usemouse);
|
||||
CV_RegisterVar(&cv_invertmouse);
|
||||
CV_RegisterVar(&cv_mousexsens);
|
||||
@@ -1214,22 +1209,13 @@ static boolean EnsurePlayerNameIsGood(char *name, INT32 playernum)
|
||||
|
||||
if (len == 0 || len > MAXPLAYERNAME)
|
||||
return false; // Empty or too long.
|
||||
if (name[0] == ' ')
|
||||
return false; // Starts with a space.
|
||||
if (name[0] == ' ' || name[len-1] == ' ')
|
||||
return false; // Starts or ends with a space.
|
||||
if (isdigit(name[0]))
|
||||
return false; // Starts with a digit.
|
||||
if (name[0] == '@' || name[0] == '~')
|
||||
return false; // Starts with an admin symbol.
|
||||
|
||||
// Clean up trailing whitespace.
|
||||
while (len && name[len-1] == ' ')
|
||||
{
|
||||
name[len-1] = '\0';
|
||||
len--;
|
||||
}
|
||||
if (len == 0)
|
||||
return false;
|
||||
|
||||
// Check if it contains a non-printing character.
|
||||
// Note: ANSI C isprint() considers space a printing character.
|
||||
// Also don't allow semicolons, since they are used as
|
||||
@@ -1282,8 +1268,7 @@ static boolean EnsurePlayerNameIsGood(char *name, INT32 playernum)
|
||||
* is restored to what it was before.
|
||||
*
|
||||
* We assume that if playernum is ::consoleplayer or ::secondarydisplayplayer
|
||||
* (unless clientjoin is true, a necessary evil)
|
||||
* the console variable ::cv_playername to ::cv_playername4 respectively is
|
||||
* the console variable ::cv_playername or ::cv_playername2 respectively is
|
||||
* already set to newname. However, the player name table is assumed to
|
||||
* contain the old name.
|
||||
*
|
||||
@@ -1303,10 +1288,6 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||
char *tmpname = NULL;
|
||||
INT32 i;
|
||||
boolean namefailed = true;
|
||||
boolean clientjoin = !!(playernum >= MAXPLAYERS);
|
||||
|
||||
if (clientjoin)
|
||||
playernum -= MAXPLAYERS;
|
||||
|
||||
buf = Z_StrDup(newname);
|
||||
|
||||
@@ -1363,21 +1344,18 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||
}
|
||||
|
||||
// no stealing another player's name
|
||||
if (!clientjoin)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (i != playernum && playeringame[i]
|
||||
&& fasticmp(tmpname, player_names[i]))
|
||||
{
|
||||
if (i != playernum && playeringame[i]
|
||||
&& fasticmp(tmpname, player_names[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < MAXPLAYERS)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < MAXPLAYERS)
|
||||
break;
|
||||
|
||||
// name is okay then
|
||||
namefailed = false;
|
||||
} while (0);
|
||||
@@ -1387,23 +1365,15 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||
|
||||
// set consvars whether namefailed or not, because even if it succeeded,
|
||||
// spaces may have been removed
|
||||
if (clientjoin)
|
||||
{
|
||||
consvar_t *namevars[] = {&cv_playername, &cv_playername2, &cv_playername3, &cv_playername4};
|
||||
CV_StealthSet(namevars[playernum], tmpname);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playernum == consoleplayer)
|
||||
CV_StealthSet(&cv_playername, tmpname);
|
||||
else if (playernum == displayplayers[1] || (!netgame && playernum == 1))
|
||||
CV_StealthSet(&cv_playername2, tmpname);
|
||||
else if (playernum == displayplayers[2] || (!netgame && playernum == 2))
|
||||
CV_StealthSet(&cv_playername3, tmpname);
|
||||
else if (playernum == displayplayers[3] || (!netgame && playernum == 3))
|
||||
CV_StealthSet(&cv_playername4, tmpname);
|
||||
else I_Assert(((void)"CleanupPlayerName used on non-local player", 0));
|
||||
}
|
||||
if (playernum == consoleplayer)
|
||||
CV_StealthSet(&cv_playername, tmpname);
|
||||
else if (playernum == displayplayers[1] || (!netgame && playernum == 1))
|
||||
CV_StealthSet(&cv_playername2, tmpname);
|
||||
else if (playernum == displayplayers[2] || (!netgame && playernum == 2))
|
||||
CV_StealthSet(&cv_playername3, tmpname);
|
||||
else if (playernum == displayplayers[3] || (!netgame && playernum == 3))
|
||||
CV_StealthSet(&cv_playername4, tmpname);
|
||||
else I_Assert(((void)"CleanupPlayerName used on non-local player", 0));
|
||||
|
||||
Z_Free(buf);
|
||||
}
|
||||
@@ -1521,9 +1491,7 @@ static void ForceAllSkins(INT32 forcedskin)
|
||||
}
|
||||
|
||||
static INT32 chmappending;
|
||||
#ifdef PARANOIA
|
||||
static INT32 snacpending[MAXSPLITSCREENPLAYERS];
|
||||
#endif
|
||||
|
||||
// wonky compat, idk if anything uses this....
|
||||
#define playerisbot (splitplayer == 1 && botingame)
|
||||
@@ -1623,9 +1591,7 @@ static void SendNameAndColor(UINT8 splitplayer)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef PARANOIA
|
||||
snacpending[splitplayer]++;
|
||||
#endif
|
||||
|
||||
// Don't change name if muted
|
||||
if (player_name_changes[pnum] >= MAXNAMECHANGES)
|
||||
@@ -1661,8 +1627,8 @@ static void SendNameAndColor(UINT8 splitplayer)
|
||||
|
||||
static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
player_t *player;
|
||||
char name[MAXPLAYERNAME+1] = {};
|
||||
player_t *player = &players[playernum];
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 color, skin;
|
||||
|
||||
#ifdef PARANOIA
|
||||
@@ -1670,18 +1636,14 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
I_Error("There is no player %d!", playernum);
|
||||
#endif
|
||||
|
||||
player = &players[playernum];
|
||||
|
||||
#ifdef PARANOIA
|
||||
if (P_IsLocalPlayer(player))
|
||||
{
|
||||
const INT32 localpnum = P_GetLocalPlayerNumForPlayer(player);
|
||||
snacpending[localpnum]--;
|
||||
|
||||
if (snacpending[localpnum] < 0)
|
||||
I_Error("snacpending negative for player %d!", localpnum);
|
||||
}
|
||||
snacpending[playernum]--;
|
||||
#ifdef PARANOIA
|
||||
if (snacpending[playernum] < 0)
|
||||
I_Error("snacpending negative!");
|
||||
#endif
|
||||
}
|
||||
|
||||
READSTRINGN(*cp, name, MAXPLAYERNAME);
|
||||
color = READUINT8(*cp);
|
||||
@@ -2222,6 +2184,7 @@ void D_SetupVote(void)
|
||||
WRITEUINT8(p, secondgt);
|
||||
secondgt &= ~0x80;
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
UINT16 m;
|
||||
@@ -5848,6 +5811,7 @@ static void BaseNumLaps_OnChange(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void KartFrantic_OnChange(void)
|
||||
{
|
||||
if ((boolean)cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL && leveltime > starttime)
|
||||
|
||||
+5
-1
@@ -93,6 +93,11 @@ extern consvar_t cv_pause;
|
||||
extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_ingamecap, cv_respawntime;
|
||||
extern consvar_t cv_spectatorreentry, cv_antigrief;
|
||||
|
||||
/*extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility;
|
||||
extern consvar_t cv_jumpshield, cv_watershield, cv_ringshield, cv_forceshield, cv_bombshield;
|
||||
extern consvar_t cv_1up, cv_eggmanbox;
|
||||
extern consvar_t cv_recycler;*/
|
||||
|
||||
// SRB2kart items
|
||||
extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana;
|
||||
extern consvar_t cv_eggmanmonitor, cv_orbinaut, cv_jawz, cv_mine;
|
||||
@@ -150,7 +155,6 @@ extern consvar_t cv_pingstyle;
|
||||
|
||||
//extern consvar_t cv_smallpos;
|
||||
extern consvar_t cv_showminimapnames;
|
||||
extern consvar_t cv_showminimapfinished;
|
||||
extern consvar_t cv_minihead;
|
||||
extern consvar_t cv_showminimapangle;
|
||||
|
||||
|
||||
+1
-50
@@ -116,8 +116,6 @@ static I_mutex downloadmutex;
|
||||
#endif
|
||||
char downloaddir[512] = "DOWNLOAD";
|
||||
|
||||
INT32 addontypes[NUMADDONTYPES] = {0};
|
||||
|
||||
file_download_t filedownload = {};
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
@@ -137,8 +135,6 @@ HTTP_login *curl_logins = NULL;
|
||||
static void CURLGetFile(void);
|
||||
#endif
|
||||
|
||||
static addontype_t GetAddonType(const char *name);
|
||||
|
||||
/** Fills a serverinfo packet with information about wad files loaded.
|
||||
*
|
||||
* \todo Give this function a better name since it is in global scope.
|
||||
@@ -229,11 +225,8 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
fileneeded[i].willsend = (UINT8)(filestatus >> 4);
|
||||
fileneeded[i].totalsize = READUINT32(p); // The four next bytes are the file size
|
||||
fileneeded[i].file = NULL; // The file isn't open yet
|
||||
READSTRINGL(p, fileneeded[i].filename, MAX_WADPATH); // The next bytes are the file name
|
||||
READSTRINGN(p, fileneeded[i].filename, MAX_WADPATH); // The next bytes are the file name
|
||||
READMEM(p, fileneeded[i].md5sum, 16); // The last 16 bytes are the file checksum
|
||||
|
||||
// Should be good place to calculate that?
|
||||
fileneeded[i].type = GetAddonType(fileneeded[i].filename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,48 +575,6 @@ INT32 CL_CheckFiles(void)
|
||||
return 1; //everything is FS_OPEN or FS_FOUND, proceed to loading
|
||||
}
|
||||
|
||||
static addontype_t GetAddonType(const char *name)
|
||||
{
|
||||
const char *prefix = strchr(name, '_');
|
||||
|
||||
// Doesn't have prefix (no '_' character or it is too far and is probably not for prefix but for something like version)
|
||||
// KRBCL_ is longest prefix i can think of so this should be enough
|
||||
if (prefix == NULL || prefix - name > 5)
|
||||
return ADDON_MISC;
|
||||
|
||||
// Skip 'K'
|
||||
if (*name == 'K')
|
||||
++name;
|
||||
|
||||
switch (*name)
|
||||
{
|
||||
case 'L':
|
||||
return ADDON_SCRIPT;
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
case 'B':
|
||||
return ADDON_MAP;
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
return ADDON_CHARACTER;
|
||||
break;
|
||||
}
|
||||
|
||||
return ADDON_MISC;
|
||||
}
|
||||
|
||||
void CL_CheckAddonTypes(void)
|
||||
{
|
||||
memset(&addontypes, 0, sizeof(addontypes));
|
||||
|
||||
for (INT32 i = 0; i < fileneedednum; i++)
|
||||
{
|
||||
addontypes[fileneeded[i].type]++;
|
||||
}
|
||||
}
|
||||
|
||||
// Load it now
|
||||
boolean CL_LoadServerFiles(void)
|
||||
{
|
||||
|
||||
@@ -40,15 +40,6 @@ typedef enum
|
||||
FS_FALLBACK, // HTTP failed
|
||||
} filestatus_t;
|
||||
|
||||
typedef enum addontype_e
|
||||
{
|
||||
ADDON_SCRIPT,
|
||||
ADDON_MAP,
|
||||
ADDON_CHARACTER,
|
||||
ADDON_MISC,
|
||||
NUMADDONTYPES,
|
||||
} addontype_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 willsend; // Is the server willing to send it?
|
||||
@@ -60,13 +51,11 @@ typedef struct
|
||||
UINT32 totalsize;
|
||||
filestatus_t status; // The value returned by recsearch
|
||||
boolean justdownloaded; // To prevent late fragments from causing an I_Error
|
||||
addontype_t type;
|
||||
} fileneeded_t;
|
||||
|
||||
extern INT32 fileneedednum;
|
||||
extern fileneeded_t fileneeded[MAX_WADFILES];
|
||||
extern char downloaddir[512];
|
||||
extern INT32 addontypes[NUMADDONTYPES];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -102,7 +91,6 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||
void CL_PrepareDownloadSaveGame(const char *tmpsave);
|
||||
|
||||
INT32 CL_CheckFiles(void);
|
||||
void CL_CheckAddonTypes(void);
|
||||
boolean CL_LoadServerFiles(void);
|
||||
void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod,
|
||||
UINT8 fileid);
|
||||
|
||||
+18
-58
@@ -735,22 +735,6 @@ const char *I_GetJoyName(INT32 joyindex)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_SetJoystickFocus(void)
|
||||
{
|
||||
}
|
||||
|
||||
boolean I_GamepadHasLED(INT32 playernum)
|
||||
{
|
||||
(void)playernum;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_GamepadHasRumble(INT32 playernum)
|
||||
{
|
||||
(void)playernum;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration)
|
||||
{
|
||||
(void)playernum;
|
||||
@@ -1000,7 +984,7 @@ void I_SleepDuration(precise_t duration)
|
||||
#endif
|
||||
}
|
||||
|
||||
static volatile sig_atomic_t g_in_exiting_signal_handler = false;
|
||||
boolean g_in_exiting_signal_handler = false;
|
||||
|
||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg)
|
||||
{
|
||||
@@ -1023,13 +1007,8 @@ static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_ms
|
||||
sigmsg = ("SIGSEGV - SRB2Kart-Saturn has attempted to access a memory location that it shouldn't and needs to close.");
|
||||
break;
|
||||
#ifdef SIGTERM
|
||||
case SIGTERM: // Software termination signal from terminate
|
||||
sigmsg = ("SIGTERM - SRB2Kart-Saturn was terminated by a terminate signal.");
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGKILL
|
||||
case SIGKILL: // Software termination signal from kill
|
||||
sigmsg = ("SIGKILL - SRB2Kart-Saturn was terminated by a kill signal.");
|
||||
case SIGTERM: // Software termination signal from kill
|
||||
sigmsg = ("SIGTERM - SRB2Kart-Saturn was terminated by a kill signal.");
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGBREAK
|
||||
@@ -1069,11 +1048,6 @@ static void I_ReportSignal(int num, int coredumped)
|
||||
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
|
||||
}
|
||||
|
||||
boolean I_In_Exiting_Signal_Handler(void)
|
||||
{
|
||||
return g_in_exiting_signal_handler;
|
||||
}
|
||||
|
||||
#ifndef NEWSIGNALHANDLER
|
||||
FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
||||
{
|
||||
@@ -1093,17 +1067,11 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
||||
}
|
||||
#endif
|
||||
|
||||
static volatile sig_atomic_t interrupted = 0;
|
||||
|
||||
boolean I_Interrupted(void)
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
{
|
||||
return interrupted;
|
||||
}
|
||||
|
||||
static void quit_handler(int num)
|
||||
{
|
||||
(void)num;
|
||||
interrupted = 1;
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBBACKTRACE
|
||||
@@ -1362,28 +1330,18 @@ static void I_Fork(void)
|
||||
I_RegisterChildSignals();
|
||||
break;
|
||||
default:
|
||||
// ignore those, those are handled by child process
|
||||
// otherwise parent might exit before it
|
||||
// and the below stuff wont run and your terminal will be left in an awkward state
|
||||
#ifdef SIGINT
|
||||
signal(SIGINT, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGBREAK
|
||||
signal(SIGBREAK, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
#endif
|
||||
if (logstream)
|
||||
fclose(logstream);/* the child has this */
|
||||
|
||||
c = wait(&status);
|
||||
|
||||
#ifdef LOGMESSAGES
|
||||
/* By the way, exit closes files. */
|
||||
logstream = fopen(logfilename, "at");
|
||||
#else
|
||||
logstream = 0;
|
||||
#endif
|
||||
|
||||
if (c == -1)
|
||||
{
|
||||
kill(child, SIGKILL);
|
||||
@@ -1443,8 +1401,8 @@ void I_Quit(void)
|
||||
/* prevent recursive I_Quit() */
|
||||
if (quiting)
|
||||
goto death;
|
||||
|
||||
quiting = false;
|
||||
I_ShutdownConsole();
|
||||
M_SaveConfig(NULL); //save game config, cvars..
|
||||
D_SaveBan(); // save the ban list
|
||||
G_SaveGameData(false); // Tails 12-08-2002
|
||||
@@ -1460,18 +1418,16 @@ void I_Quit(void)
|
||||
// use this for 1.28 19990220 by Kin
|
||||
I_ShutdownGraphics();
|
||||
I_ShutdownSystem();
|
||||
|
||||
/* if option -noendtxt is set, don't print the text */
|
||||
if (!M_CheckParm("-noendtxt") && W_CheckNumForName("ENDOOM") != LUMPERROR)
|
||||
{
|
||||
printf("\r");
|
||||
ShowEndTxt();
|
||||
}
|
||||
|
||||
if (myargmalloc)
|
||||
free(myargv); // Deallocate allocated memory
|
||||
|
||||
death:
|
||||
W_Shutdown();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -1517,6 +1473,7 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
|
||||
I_OutputMsg("SRB2Kart %s Recursive Error", buffer);
|
||||
|
||||
W_Shutdown();
|
||||
exit(-1); // recursive errors detected
|
||||
}
|
||||
}
|
||||
@@ -1534,6 +1491,8 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
#endif
|
||||
// ---
|
||||
|
||||
I_ShutdownConsole();
|
||||
|
||||
M_SaveConfig(NULL); // save game config, cvars..
|
||||
D_SaveBan(); // save the ban list
|
||||
G_SaveGameData(false); // Tails 12-08-2002
|
||||
@@ -1549,6 +1508,8 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
I_ShutdownGraphics();
|
||||
I_ShutdownSystem();
|
||||
|
||||
W_Shutdown();
|
||||
|
||||
#if defined (PARANOIA) && defined (__CYGWIN__)
|
||||
*(INT32 *)2 = 4; //Alam: Debug!
|
||||
#endif
|
||||
@@ -1654,10 +1615,9 @@ void I_ShutdownSystem(void)
|
||||
{
|
||||
INT32 c;
|
||||
|
||||
#ifdef NEWSIGNALHANDLER
|
||||
if (M_CheckParm("-nofork"))
|
||||
#ifndef NEWSIGNALHANDLER
|
||||
I_ShutdownConsole();
|
||||
#endif
|
||||
I_ShutdownConsole();
|
||||
|
||||
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
|
||||
if (quit_funcs[c])
|
||||
|
||||
@@ -115,6 +115,10 @@ INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void VID_RefreshModeList(void)
|
||||
{
|
||||
}
|
||||
|
||||
void VID_PrepareModeList(void)
|
||||
{
|
||||
}
|
||||
@@ -125,6 +129,13 @@ INT32 VID_SetMode(INT32 modeNum)
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean I_CheckAboveDesktopRes(INT32 width, INT32 height)
|
||||
{
|
||||
(void)width;
|
||||
(void)height;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_StartupGraphics(void)
|
||||
{
|
||||
}
|
||||
|
||||
+287
-209
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -61,7 +61,7 @@ enum
|
||||
typedef struct
|
||||
{
|
||||
INT16 x, y;
|
||||
} ATTRPACK mapvertex_t;
|
||||
}ATTRPACK mapvertex_t;
|
||||
|
||||
// A SideDef, defining the visual appearance of a wall,
|
||||
// by setting textures and offsets.
|
||||
|
||||
+18
-9
@@ -130,8 +130,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v9.3"
|
||||
#define VERSIONSTRINGW L"Saturn v9.3"
|
||||
#define VERSIONSTRING "Saturn v9.x - Testing"
|
||||
#define VERSIONSTRINGW L"Saturn v9.x - Testing "
|
||||
|
||||
#define SATURN_TESTING // comment out for saturn release builds!
|
||||
|
||||
@@ -516,6 +516,22 @@ extern boolean capslock;
|
||||
// i_system.c, replace getchar() once the keyboard has been appropriated
|
||||
INT32 I_GetKey(void);
|
||||
|
||||
/* http://www.cse.yorku.ca/~oz/hash.html */
|
||||
static inline
|
||||
UINT32 quickncasehash (const char *p, size_t n)
|
||||
{
|
||||
size_t i = 0;
|
||||
UINT32 x = 5381;
|
||||
|
||||
while (i < n && p[i])
|
||||
{
|
||||
x = (x * 33) ^ tolower(p[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
#ifndef __cplusplus
|
||||
#ifndef min // Double-Check with WATTCP-32's cdefs.h
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
@@ -573,13 +589,6 @@ INT32 I_GetKey(void);
|
||||
// NOTE: you WILL have nasal troubles if the variable is not initialized
|
||||
#define CLEANUP(f) __attribute__((__cleanup__(f)))
|
||||
|
||||
// the GNU constructor and destructor attributes
|
||||
// The constructor attribute causes the function to be called automatically before execution enters main ().
|
||||
// Similarly, the destructor attribute causes the function to be called automatically after main () has completed or exit () has been called.
|
||||
// Functions with these attributes are useful for initializing data that will be used implicitly during the execution of the program.
|
||||
#define CONSTRUCTOR __attribute__((constructor, used))
|
||||
#define DESTRUCTOR __attribute__((destructor, used))
|
||||
|
||||
// An assert-type mechanism.
|
||||
#ifdef PARANOIA
|
||||
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))
|
||||
|
||||
+46
-4
@@ -54,6 +54,7 @@ extern INT16 maptol;
|
||||
extern UINT8 globalweather;
|
||||
extern INT32 curWeather;
|
||||
extern INT32 cursaveslot;
|
||||
extern INT16 lastmapsaved;
|
||||
extern boolean gamecomplete;
|
||||
|
||||
#define PRECIP_NONE 0
|
||||
@@ -77,6 +78,7 @@ extern boolean imcontinuing; // Temporary flag while continuing
|
||||
extern UINT8 modeattacking;
|
||||
|
||||
// menu demo things
|
||||
extern UINT8 numDemos;
|
||||
extern UINT32 demoDelayTime;
|
||||
extern UINT32 demoIdleTime;
|
||||
|
||||
@@ -112,8 +114,8 @@ extern UINT8 paused; // Game paused?
|
||||
extern UINT8 window_notinfocus; // are we in focus? (backend independant -- handles auto pausing and display of "focus lost" message)
|
||||
|
||||
extern boolean nodrawers;
|
||||
extern boolean noblit;
|
||||
extern boolean lastdraw;
|
||||
extern boolean intermissionbginit;
|
||||
|
||||
#ifdef MOTIONBLUR
|
||||
extern INT32 postimgparam[MAXSPLITSCREENPLAYERS];
|
||||
@@ -203,6 +205,12 @@ extern struct quake
|
||||
fixed_t radius, intensity;
|
||||
} quake;
|
||||
|
||||
// NiGHTS grades
|
||||
typedef struct
|
||||
{
|
||||
UINT32 grade[6]; // D, C, B, A, S, X (F: failed to reach any of these)
|
||||
} nightsgrades_t;
|
||||
|
||||
// Custom Lua values
|
||||
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
|
||||
typedef struct
|
||||
@@ -253,16 +261,28 @@ typedef struct
|
||||
UINT8 numlaps; ///< Number of laps in circuit mode, unless overridden.
|
||||
SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no.
|
||||
UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in?
|
||||
SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.)
|
||||
SINT8 saveoverride; ///< Set how the game is allowed to save (1 for always, -1 for never, 0 is 2.1 default)
|
||||
|
||||
UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below
|
||||
UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus
|
||||
|
||||
// NiGHTS stuff.
|
||||
UINT8 numGradedMares; ///< Internal. For grade support.
|
||||
nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful.
|
||||
|
||||
// SRB2kart
|
||||
//boolean automap; ///< Displays a level's white map outline in modified games
|
||||
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
|
||||
|
||||
mapheader_lighting_t lighting; ///< Wall and sprite lighting
|
||||
mapheader_lighting_t lighting_encore; ///< Alternative lighting for Encore mode
|
||||
boolean use_encore_lighting; ///< Whether to use separate Encore lighting
|
||||
|
||||
// Music stuff.
|
||||
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
||||
char musintername[7]; ///< Intermission screen music.
|
||||
|
||||
// Lua stuff.
|
||||
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
|
||||
UINT8 numCustomOptions; ///< Internal. For Lua custom value support.
|
||||
@@ -359,6 +379,8 @@ typedef struct
|
||||
{
|
||||
tic_t time; ///< Time in which the level was finished.
|
||||
tic_t lap; ///< Best lap time for this level.
|
||||
//UINT32 score; ///< Score when the level was finished.
|
||||
//UINT16 rings; ///< Rings when the level was finished.
|
||||
} recorddata_t;
|
||||
|
||||
/** Setup for one NiGHTS map.
|
||||
@@ -372,19 +394,34 @@ typedef struct
|
||||
#define GRADE_A 5
|
||||
#define GRADE_S 6
|
||||
|
||||
/*typedef struct
|
||||
{
|
||||
// 8 mares, 1 overall (0)
|
||||
UINT8 nummares;
|
||||
UINT32 score[9];
|
||||
UINT8 grade[9];
|
||||
tic_t time[9];
|
||||
} nightsdata_t;*/
|
||||
|
||||
//extern nightsdata_t *nightsrecords[NUMMAPS];
|
||||
extern recorddata_t *mainrecords[NUMMAPS];
|
||||
|
||||
// mapvisited is now a set of flags that says what we've done in the map.
|
||||
#define MV_VISITED 1
|
||||
#define MV_BEATEN 2
|
||||
#define MV_ALLEMERALDS 4
|
||||
//#define MV_ULTIMATE 8
|
||||
//#define MV_PERFECT 16
|
||||
#define MV_MAX 7 // used in gamedata check
|
||||
extern UINT8 mapvisited[NUMMAPS];
|
||||
|
||||
extern UINT32 token; ///< Number of tokens collected in a level
|
||||
// Temporary holding place for nights data for the current map
|
||||
//nightsdata_t ntemprecords;
|
||||
|
||||
extern UINT32 token; ///< Number of tokens collected in a level
|
||||
extern UINT32 tokenlist; ///< List of tokens collected
|
||||
extern INT32 tokenbits; ///< Used for setting token bits
|
||||
extern INT32 sstimer; ///< Time allotted in the special stage
|
||||
extern INT32 tokenbits; ///< Used for setting token bits
|
||||
extern INT32 sstimer; ///< Time allotted in the special stage
|
||||
extern UINT32 bluescore; ///< Blue Team Scores
|
||||
extern UINT32 redscore; ///< Red Team Scores
|
||||
|
||||
@@ -400,6 +437,9 @@ extern boolean CheckForReverseGravity;
|
||||
extern UINT16 invulntics;
|
||||
extern UINT16 sneakertics;
|
||||
extern UINT16 flashingtics;
|
||||
extern UINT16 tailsflytics;
|
||||
extern UINT16 underwatertics;
|
||||
extern UINT16 spacetimetics;
|
||||
extern UINT16 extralifetics;
|
||||
|
||||
// SRB2kart
|
||||
@@ -421,6 +461,7 @@ extern UINT8 introtoplay;
|
||||
extern UINT8 creditscutscene;
|
||||
|
||||
extern UINT8 use1upSound;
|
||||
extern UINT8 maxXtraLife; // Max extra lives from rings
|
||||
|
||||
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
|
||||
|
||||
@@ -485,6 +526,7 @@ extern UINT32 timesBeatenWithEmeralds;
|
||||
// WAD, partly set at startup time.
|
||||
|
||||
extern tic_t gametic;
|
||||
#define localgametic leveltime
|
||||
|
||||
// Player spawn spots.
|
||||
extern mapthing_t *playerstarts[MAXPLAYERS]; // Cooperative
|
||||
|
||||
+5
-16
@@ -68,21 +68,8 @@ extern "C" {
|
||||
#define strnicmp(x,y,n) strncasecmp(x,y,n)
|
||||
#endif
|
||||
|
||||
// glibc 2.43 made alot of standard lib functions propagate the constness of its input pointers
|
||||
// to not cause warnings or compile issues on older glibc versions we do this silly thing
|
||||
// to not have a gazillion glibc version checks
|
||||
#if defined(__GLIBC_PREREQ)
|
||||
#if __GLIBC_PREREQ(2, 43)
|
||||
#define gconst const
|
||||
#else
|
||||
#define gconst
|
||||
#endif
|
||||
#else
|
||||
#define gconst
|
||||
#endif
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
char *nongnu_strcasestr(const char *in, const char *what);
|
||||
#ifndef _GNU_SOURCE
|
||||
#define strcasestr nongnu_strcasestr
|
||||
#endif
|
||||
|
||||
@@ -140,9 +127,9 @@ size_t strlcpy(char *dst, const char *src, size_t dsize);
|
||||
#define STRBUFCPY(dst,src) strlcpy(dst, src, sizeof dst)
|
||||
|
||||
/* Boolean type definition */
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <stdbool.h>
|
||||
// dont use stdbools _BOOL type
|
||||
// its smaller (1 byte) than the old interger bool (4 bytes)
|
||||
// which results in packed struct sizes being mismatched between vanilla and this
|
||||
@@ -150,7 +137,9 @@ size_t strlcpy(char *dst, const char *src, size_t dsize);
|
||||
// which we cant use as enumeration constants
|
||||
typedef int32_t boolean;
|
||||
#else
|
||||
#define boolean int32_t
|
||||
#define false FALSE
|
||||
#define true TRUE
|
||||
#define boolean BOOL
|
||||
#endif
|
||||
|
||||
/* 7.18.2.1 Limits of exact-width integer types */
|
||||
|
||||
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user