Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3113d96de6 | ||
|
|
ebdb590018 | ||
|
|
d828613b6a | ||
|
|
bb4baafd1e | ||
|
|
ea21b25711 | ||
|
|
8038c5aff4 | ||
|
|
7dbb08315c | ||
|
|
b1ff1bb531 | ||
|
|
8eaf4a73f4 | ||
|
|
5f19ff2c6a | ||
|
|
39436339ad | ||
|
|
d4a494d7ae | ||
|
|
2af0140300 | ||
|
|
31f81a4a53 | ||
|
|
420424bbb6 | ||
|
|
0adaceaf3b | ||
|
|
7487cc1752 | ||
|
|
4e22d3e61a | ||
|
|
bf1aa47854 | ||
|
|
ec5bff710d | ||
|
|
6f5115f6cb | ||
|
|
be423b2910 | ||
|
|
3bf3bdf641 | ||
|
|
e923777eb6 | ||
|
|
cf6eb0010e | ||
|
|
5184115216 | ||
|
|
ec9ff014c8 | ||
|
|
b9f9462f92 | ||
|
|
39a46e8f79 | ||
|
|
c1dda61094 | ||
|
|
7d64ec103d | ||
|
|
d9712cf85e | ||
|
|
9ccd62b5cb | ||
|
|
2077315f24 | ||
|
|
6af1c41e73 | ||
|
|
c7dd38ed9f | ||
|
|
9bea6eddbd | ||
|
|
f4e5f7249c | ||
|
|
e1f0b97926 | ||
|
|
0691e2d9e2 | ||
|
|
132fc98211 | ||
|
|
2e52a7c7cb | ||
|
|
80ffa12848 | ||
|
|
98c8e965e5 | ||
|
|
8e67e0bace | ||
|
|
08864e27b2 | ||
|
|
4a3c9ccfbb | ||
|
|
cedd789a27 | ||
|
|
cc3ced8cd2 | ||
|
|
6fec71196b | ||
|
|
05a8f1822e | ||
|
|
6209f4fc1b | ||
|
|
cb27730622 | ||
|
|
decaa79d20 | ||
|
|
aeb06a26ee | ||
|
|
fd2c208612 | ||
|
|
8f91707164 | ||
|
|
37eba186f5 | ||
|
|
8f3b7158e3 | ||
|
|
536b141935 | ||
|
|
cfe90cce7d | ||
|
|
ea1075d330 | ||
|
|
b76ce836a0 | ||
|
|
fd1e415731 | ||
|
|
41c887f2bf | ||
|
|
8091d825d5 | ||
|
|
699113fb25 | ||
|
|
3996abef36 | ||
|
|
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 | ||
|
|
7eb2ad1e35 | ||
|
|
f49e57a38c | ||
|
|
265f4a50ef | ||
|
|
e83e2659a7 | ||
|
|
c680dd3222 | ||
|
|
96aaaf5261 | ||
|
|
efb29e6be5 | ||
|
|
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.
+1
-1
@@ -54,7 +54,7 @@ set(SRB2_CORE_SOURCES
|
||||
string.c
|
||||
tables.c
|
||||
v_video.c
|
||||
w_wad.c
|
||||
w_wad.cpp
|
||||
y_inter.c
|
||||
z_zone.cpp
|
||||
)
|
||||
|
||||
@@ -290,6 +290,13 @@ 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)
|
||||
|
||||
|
||||
+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
|
||||
|
||||
+41
-17
@@ -519,6 +519,23 @@ LUA_API int lua_pushthread (lua_State *L) {
|
||||
** get functions (Lua -> stack)
|
||||
*/
|
||||
|
||||
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, L->top, L->top, slot);
|
||||
api_incr_top(L);
|
||||
}
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_gettable (lua_State *L, int idx) {
|
||||
StkId t;
|
||||
@@ -531,15 +548,8 @@ LUA_API void lua_gettable (lua_State *L, int idx) {
|
||||
|
||||
|
||||
LUA_API void lua_getfield (lua_State *L, int idx, const char *k) {
|
||||
StkId t;
|
||||
TValue key;
|
||||
lua_lock(L);
|
||||
t = index2adr(L, idx);
|
||||
api_checkvalidindex(L, t);
|
||||
setsvalue(L, &key, luaS_new(L, k));
|
||||
luaV_gettable(L, t, &key, L->top);
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
auxgetstr(L, index2adr(L, idx), k);
|
||||
}
|
||||
|
||||
|
||||
@@ -630,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;
|
||||
@@ -642,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+14
-2
@@ -20,6 +20,7 @@
|
||||
#define lauxlib_c
|
||||
#define LUA_LIB
|
||||
|
||||
#include "ldebug.h"
|
||||
#include "lua.h"
|
||||
|
||||
#include "lauxlib.h"
|
||||
@@ -468,8 +469,19 @@ LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) {
|
||||
|
||||
|
||||
LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) {
|
||||
while (l--)
|
||||
luaL_addchar(B, *s++);
|
||||
while (l) {
|
||||
size_t space = bufffree(B);
|
||||
if (space == 0) {
|
||||
luaL_prepbuffer(B);
|
||||
lua_assert(bufffree(B) == LUAL_BUFFERSIZE);
|
||||
space = LUAL_BUFFERSIZE;
|
||||
}
|
||||
if (space > l) space = l;
|
||||
memcpy(B->p, s, space);
|
||||
B->p += space;
|
||||
s += space;
|
||||
l -= space;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+25
-12
@@ -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;
|
||||
}
|
||||
@@ -790,18 +802,19 @@ void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
|
||||
case OPR_BXOR: codearith(fs, OP_BXOR, e1, e2); break;
|
||||
case OPR_BSHL: codearith(fs, OP_BSHL, e1, e2); break;
|
||||
case OPR_BSHR: codearith(fs, OP_BSHR, e1, e2); break;
|
||||
case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break;
|
||||
case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break;
|
||||
case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break;
|
||||
case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break;
|
||||
case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break;
|
||||
case OPR_POW: codearith(fs, OP_POW, e1, e2); break;
|
||||
case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break;
|
||||
case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break;
|
||||
case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break;
|
||||
case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break;
|
||||
case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break;
|
||||
case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break;
|
||||
case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV:
|
||||
case OPR_MOD: case OPR_POW: {
|
||||
codearith(fs, op - OPR_ADD + OP_ADD, e1, e2);
|
||||
break;
|
||||
}
|
||||
case OPR_EQ: case OPR_LT: case OPR_LE: {
|
||||
codecomp(fs, op - OPR_EQ + OP_EQ, 1, e1, e2);
|
||||
break;
|
||||
}
|
||||
case OPR_NE: case OPR_GT: case OPR_GE: {
|
||||
codecomp(fs, op - OPR_NE + OP_EQ, 0, e1, e2);
|
||||
break;
|
||||
}
|
||||
default: lua_assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -21,13 +21,13 @@
|
||||
|
||||
|
||||
/*
|
||||
** grep "ORDER OPR" if you change these enums
|
||||
** grep "ORDER OPR" if you change these enums (ORDER OP)
|
||||
*/
|
||||
typedef enum BinOpr {
|
||||
OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
|
||||
OPR_CONCAT,
|
||||
OPR_NE, OPR_EQ,
|
||||
OPR_LT, OPR_LE, OPR_GT, OPR_GE,
|
||||
OPR_EQ, OPR_LT, OPR_LE,
|
||||
OPR_NE, OPR_GT, OPR_GE,
|
||||
OPR_AND, OPR_OR,
|
||||
OPR_BAND, OPR_BOR, OPR_BXOR,
|
||||
OPR_BSHL, OPR_BSHR,
|
||||
|
||||
+28
-5
@@ -542,16 +542,39 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
|
||||
|
||||
|
||||
static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
|
||||
TMS tm = 0;
|
||||
Instruction i;
|
||||
if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1))
|
||||
return NULL; /* calling function is not Lua (or is unknown) */
|
||||
ci--; /* calling function */
|
||||
i = ci_func(ci)->l.p->code[currentpc(L, ci)];
|
||||
if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL ||
|
||||
GET_OPCODE(i) == OP_TFORLOOP)
|
||||
return getobjname(L, ci, GETARG_A(i), name);
|
||||
else
|
||||
return NULL; /* no useful name can be found */
|
||||
switch (GET_OPCODE(i)) {
|
||||
case OP_CALL:
|
||||
case OP_TAILCALL:
|
||||
case OP_TFORLOOP:
|
||||
return getobjname(L, ci, GETARG_A(i), name);
|
||||
case OP_GETGLOBAL:
|
||||
case OP_SELF:
|
||||
case OP_GETTABLE: tm = TM_INDEX; break;
|
||||
case OP_SETGLOBAL:
|
||||
case OP_SETTABLE: tm = TM_NEWINDEX; break;
|
||||
case OP_EQ: tm = TM_EQ; break;
|
||||
case OP_ADD: tm = TM_ADD; break;
|
||||
case OP_SUB: tm = TM_SUB; break;
|
||||
case OP_MUL: tm = TM_MUL; break;
|
||||
case OP_DIV: tm = TM_DIV; break;
|
||||
case OP_MOD: tm = TM_MOD; break;
|
||||
case OP_POW: tm = TM_POW; break;
|
||||
case OP_UNM: tm = TM_UNM; break;
|
||||
case OP_LEN: tm = TM_LEN; break;
|
||||
case OP_LT: tm = TM_LT; break;
|
||||
case OP_LE: tm = TM_LE; break;
|
||||
case OP_CONCAT: tm = TM_CONCAT; break;
|
||||
default:
|
||||
return NULL; /* else no useful name can be found */
|
||||
}
|
||||
*name = getstr(G(L)->tmname[tm]);
|
||||
return "metamethod";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-9
@@ -356,20 +356,21 @@ static int read_line (lua_State *L, FILE *f) {
|
||||
|
||||
|
||||
static int read_chars (lua_State *L, FILE *f, size_t n) {
|
||||
size_t rlen; /* how much to read */
|
||||
size_t nr; /* number of chars actually read */
|
||||
size_t tbr = n; /* number of chars to be read */
|
||||
size_t rlen; /* how much to read in each cycle */
|
||||
size_t nr; /* number of chars actually read in each cycle */
|
||||
luaL_Buffer b;
|
||||
luaL_buffinit(L, &b);
|
||||
rlen = LUAL_BUFFERSIZE; /* try to read that much each time */
|
||||
do {
|
||||
char *p = luaL_prepbuffer(&b);
|
||||
if (rlen > n) rlen = n; /* cannot read more than asked */
|
||||
if (rlen > tbr) rlen = tbr; /* cannot read more than asked */
|
||||
nr = fread(p, sizeof(char), rlen, f);
|
||||
luaL_addsize(&b, nr);
|
||||
n -= nr; /* still have to read `n' chars */
|
||||
} while (n > 0 && nr == rlen); /* until end of count or eof */
|
||||
tbr -= nr; /* still have to read 'tbr' chars */
|
||||
} while (tbr > 0 && nr == rlen); /* until end of count or eof */
|
||||
luaL_pushresult(&b); /* close buffer */
|
||||
return (n == 0 || lua_objlen(L, -1) > 0);
|
||||
return (tbr == 0 || tbr < n); /* true iff read something */
|
||||
}
|
||||
|
||||
|
||||
@@ -432,13 +433,13 @@ static int f_read (lua_State *L) {
|
||||
|
||||
static int io_readline (lua_State *L) {
|
||||
FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1));
|
||||
int sucess;
|
||||
int success;
|
||||
if (f == NULL) /* file is already closed? */
|
||||
luaL_error(L, "file is already closed");
|
||||
sucess = read_line(L, f);
|
||||
success = read_line(L, f);
|
||||
if (ferror(f))
|
||||
return luaL_error(L, "%s", strerror(errno));
|
||||
if (sucess) return 1;
|
||||
if (success) return 1;
|
||||
else { /* EOF */
|
||||
if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */
|
||||
lua_settop(L, 0);
|
||||
|
||||
@@ -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).
|
||||
|
||||
|
||||
+4
-4
@@ -881,10 +881,10 @@ static const struct {
|
||||
lu_byte right; /* right priority */
|
||||
} priority[] = { /* ORDER OPR */
|
||||
{6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */
|
||||
{10, 9}, {5, 4}, /* power and concat (right associative) */
|
||||
{3, 3}, {3, 3}, /* equality and inequality */
|
||||
{3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */
|
||||
{2, 2}, {1, 1} /* logical (and/or) */
|
||||
{10, 9}, {5, 4}, /* ^, .. (right associative) */
|
||||
{3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */
|
||||
{3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */
|
||||
{2, 2}, {1, 1} /* and, or */
|
||||
,{6, 6}, {6, 6}, {6, 6}, /* bit-wise (band/bor/bxor) */
|
||||
{7, 7}, {7, 7} /* shl/shr */
|
||||
};
|
||||
|
||||
+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
|
||||
+103
-40
@@ -105,61 +105,94 @@ static void callTM (lua_State *L, const TValue *f, const TValue *p1,
|
||||
}
|
||||
|
||||
|
||||
void luaV_gettable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
||||
int loop;
|
||||
/*
|
||||
** Finish the table access 'val = t[key]'.
|
||||
** 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, const TValue *t, TValue *key, StkId val,
|
||||
const TValue *slot) {
|
||||
int loop; /* counter to avoid infinite loops */
|
||||
const TValue *tm; /* metamethod */
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
TValue *tm;
|
||||
if (ttistable(t)) { /* `t' is a table? */
|
||||
Table *h = hvalue(t);
|
||||
const TValue *res = luaH_get(h, key); /* do a primitive get */
|
||||
if (!ttisnil(res) || /* result is no nil? */
|
||||
(tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */
|
||||
setobj2s(L, val, res);
|
||||
if (slot == NULL) { /* 't' is not a table? */
|
||||
lua_assert(!ttistable(t));
|
||||
tm = luaT_gettmbyobj(L, t, TM_INDEX);
|
||||
if (l_unlikely(ttisnil(tm)))
|
||||
luaG_typeerror(L, t, "index"); /* no metamethod */
|
||||
/* else will try the metamethod */
|
||||
}
|
||||
else { /* 't' is a table */
|
||||
lua_assert(ttisnil(slot));
|
||||
tm = fasttm(L, hvalue(t)->metatable, TM_INDEX); /* table's metamethod */
|
||||
if (tm == NULL) { /* no metamethod? */
|
||||
setnilvalue(val); /* result is nil */
|
||||
return;
|
||||
}
|
||||
/* else will try the tag method */
|
||||
/* else will try the metamethod */
|
||||
}
|
||||
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))))
|
||||
luaG_typeerror(L, t, "index");
|
||||
if (ttisfunction(tm)) {
|
||||
callTMres(L, val, tm, t, key);
|
||||
if (ttisfunction(tm)) { /* is metamethod a function? */
|
||||
callTMres(L, val, tm, t, key); /* call it */
|
||||
return;
|
||||
}
|
||||
t = tm; /* else repeat with `tm' */
|
||||
t = tm; /* else try to access 'tm[key]' */
|
||||
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)) != NULL)) ||
|
||||
((!ttisnil(oldval)) && ((tm = fasttm(L, h->metatable, TM_USEDINDEX)) != NULL)))) {
|
||||
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))
|
||||
@@ -184,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;
|
||||
@@ -377,6 +410,24 @@ 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) { 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;
|
||||
@@ -386,9 +437,9 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
reentry: /* entry point */
|
||||
lua_assert(isLua(L->ci));
|
||||
pc = L->savedpc;
|
||||
cl = &clvalue(L->ci->func)->l;
|
||||
base = L->base;
|
||||
k = cl->p->k;
|
||||
cl = &clvalue(L->ci->func)->l; /* local reference to function's closure */
|
||||
k = cl->p->k; /* local reference to function's constant table */
|
||||
base = L->base; /* local copy of function's base */
|
||||
/* main loop of interpreter */
|
||||
for (;;) {
|
||||
const Instruction i = *pc++;
|
||||
@@ -442,7 +493,9 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_GETTABLE: {
|
||||
Protect(luaV_gettable(L, RB(i), RKC(i), ra));
|
||||
StkId rb = RB(i);
|
||||
TValue *rc = RKC(i);
|
||||
gettableProtected(L, rb, rc, ra);
|
||||
continue;
|
||||
}
|
||||
case OP_SETGLOBAL: {
|
||||
@@ -459,7 +512,9 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_SETTABLE: {
|
||||
Protect(luaV_settable(L, ra, RKB(i), RKC(i)));
|
||||
TValue *rb = RKB(i);
|
||||
TValue *rc = RKC(i);
|
||||
settableProtected(L, ra, rb, rc);
|
||||
continue;
|
||||
}
|
||||
case OP_NEWTABLE: {
|
||||
@@ -470,9 +525,15 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
continue;
|
||||
}
|
||||
case OP_SELF: {
|
||||
const TValue *slot;
|
||||
StkId rb = RB(i);
|
||||
setobjs2s(L, ra+1, rb);
|
||||
Protect(luaV_gettable(L, rb, RKC(i), ra));
|
||||
TValue *rc = RKC(i);
|
||||
TString *key = rawtsvalue(rc); /* key must be a string */
|
||||
setobjs2s(L, ra + 1, rb);
|
||||
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: {
|
||||
@@ -822,3 +883,5 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
+51
-4
@@ -22,14 +22,61 @@
|
||||
(ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
|
||||
|
||||
|
||||
/*
|
||||
** fast track for 'gettable': if 't' is a table and 't[k]' is not nil,
|
||||
** return 1 with 'slot' pointing to 't[k]' (final result). Otherwise,
|
||||
** return 0 (meaning it will have to check metamethod) with 'slot'
|
||||
** pointing to a nil 't[k]' (if 't' is a table) or NULL (otherwise).
|
||||
** 'f' is the raw get function to use.
|
||||
*/
|
||||
#define luaV_fastget(L,t,k,slot,f) \
|
||||
(!ttistable(t) \
|
||||
? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \
|
||||
: (slot = f(hvalue(t), k), /* else, do raw access */ \
|
||||
!ttisnil(slot))) /* result not nil? */
|
||||
|
||||
/*
|
||||
** standard implementation for 'gettable'
|
||||
*/
|
||||
#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_gettable (lua_State *L, TValue *t, TValue *key,
|
||||
StkId val);
|
||||
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);
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
#ifndef __CONSOLE__
|
||||
#define __CONSOLE__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "d_event.h"
|
||||
#include "command.h"
|
||||
#include "i_threads.h"
|
||||
@@ -63,4 +67,8 @@ boolean CON_Ready(void);
|
||||
|
||||
void CON_LogMessage(const char *msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+349
-316
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -660,9 +660,11 @@ 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
|
||||
|
||||
#define SAVEGAMESIZE (768*1024)
|
||||
|
||||
typedef struct rewind_s
|
||||
{
|
||||
UINT8 savebuffer[(768*1024)];
|
||||
UINT8 savebuffer[SAVEGAMESIZE];
|
||||
tic_t leveltime;
|
||||
size_t demopos;
|
||||
|
||||
|
||||
+2
-8
@@ -674,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()
|
||||
@@ -720,8 +718,6 @@ void D_SRB2Loop(void)
|
||||
|
||||
boolean ranwipe = false;
|
||||
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
|
||||
if (lastwipetic)
|
||||
{
|
||||
oldentertics = lastwipetic;
|
||||
@@ -796,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
|
||||
{
|
||||
|
||||
+4
-8
@@ -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();
|
||||
@@ -612,12 +612,8 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||
|
||||
static void InitNode(node_t *node)
|
||||
{
|
||||
node->acktosend_head = node->acktosend_tail = 0;
|
||||
memset(node->acktosend, 0, sizeof(node->acktosend));
|
||||
node->firstacktosend = 0;
|
||||
memset(node, 0, sizeof(node_t));
|
||||
node->nextacknum = 1;
|
||||
node->remotefirstack = 0;
|
||||
node->flags = 0;
|
||||
}
|
||||
|
||||
static void InitAck(void)
|
||||
|
||||
+144
-482
@@ -1205,11 +1205,11 @@ static boolean AllowedPlayerNameChar(char ch)
|
||||
|
||||
static boolean EnsurePlayerNameIsGood(char *name, INT32 playernum)
|
||||
{
|
||||
INT32 ix;
|
||||
size_t ix, len = strlen(name);
|
||||
|
||||
if (strlen(name) == 0 || strlen(name) > MAXPLAYERNAME)
|
||||
if (len == 0 || len > MAXPLAYERNAME)
|
||||
return false; // Empty or too long.
|
||||
if (name[0] == ' ' || name[strlen(name)-1] == ' ')
|
||||
if (name[0] == ' ' || name[len-1] == ' ')
|
||||
return false; // Starts or ends with a space.
|
||||
if (isdigit(name[0]))
|
||||
return false; // Starts with a digit.
|
||||
@@ -1223,20 +1223,19 @@ static boolean EnsurePlayerNameIsGood(char *name, INT32 playernum)
|
||||
|
||||
// Also, anything over 0x80 is disallowed too, since compilers love to
|
||||
// differ on whether they're printable characters or not.
|
||||
for (ix = 0; name[ix] != '\0'; ix++)
|
||||
for (ix = 0; ix < len; ix++)
|
||||
if (!AllowedPlayerNameChar(name[ix]))
|
||||
return false;
|
||||
|
||||
// Check if a player is currently using the name, case-insensitively.
|
||||
for (ix = 0; ix < MAXPLAYERS; ix++)
|
||||
{
|
||||
if (ix != playernum && playeringame[ix]
|
||||
if (ix != (size_t)playernum && playeringame[ix]
|
||||
&& fasticmp(name, player_names[ix]))
|
||||
{
|
||||
// We shouldn't kick people out just because
|
||||
// they joined the game with the same name
|
||||
// as someone else -- modify the name instead.
|
||||
size_t len = strlen(name);
|
||||
|
||||
// Recursion!
|
||||
// Slowly strip characters off the end of the
|
||||
@@ -1455,7 +1454,9 @@ UINT8 CanChangeSkin(INT32 playernum)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (players[playernum].spectator || players[playernum].playerstate == PST_DEAD || players[playernum].playerstate == PST_REBORN)
|
||||
if (players[playernum].spectator ||
|
||||
players[playernum].playerstate == PST_DEAD ||
|
||||
players[playernum].playerstate == PST_REBORN)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1489,445 +1490,144 @@ static void ForceAllSkins(INT32 forcedskin)
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 snacpending = 0, snac2pending = 0, snac3pending = 0, snac4pending = 0, chmappending = 0;
|
||||
static INT32 chmappending;
|
||||
static INT32 snacpending[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
// wonky compat, idk if anything uses this....
|
||||
#define playerisbot (splitplayer == 1 && botingame)
|
||||
|
||||
// name, color, or skin has changed
|
||||
//
|
||||
static void SendNameAndColor(void)
|
||||
static void SendNameAndColor(UINT8 splitplayer)
|
||||
{
|
||||
char buf[MAXPLAYERNAME+2];
|
||||
char *p;
|
||||
|
||||
p = buf;
|
||||
|
||||
// splitscreen
|
||||
if (splitscreen < splitplayer && !playerisbot)
|
||||
return;
|
||||
|
||||
const INT32 pnum = P_GetLocalPlayerNumForNum(splitplayer);
|
||||
|
||||
player_t *player = &players[pnum];
|
||||
|
||||
// TODO: make those cvars arrays
|
||||
consvar_t *playercolor, *playername, *playerskin;
|
||||
consvar_t *colorvars[] = {&cv_playercolor, &cv_playercolor2, &cv_playercolor3, &cv_playercolor4};
|
||||
consvar_t *namevars[] = {&cv_playername, &cv_playername2, &cv_playername3, &cv_playername4};
|
||||
consvar_t *skinvars[] = {&cv_skin, &cv_skin2, &cv_skin3, &cv_skin4};
|
||||
|
||||
playercolor = colorvars[splitplayer];
|
||||
playername = namevars[splitplayer];
|
||||
playerskin = skinvars[splitplayer];
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[consoleplayer].ctfteam == 1 && cv_playercolor.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor, skincolor_redteam);
|
||||
else if (players[consoleplayer].ctfteam == 2 && cv_playercolor.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor, skincolor_blueteam);
|
||||
if (player->ctfteam == 1 && playercolor->value != skincolor_redteam)
|
||||
CV_StealthSetValue(playercolor, skincolor_redteam);
|
||||
else if (player->ctfteam == 2 && playercolor->value != skincolor_blueteam)
|
||||
CV_StealthSetValue(playercolor, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor.value)
|
||||
if (!playercolor->value)
|
||||
{
|
||||
if (players[consoleplayer].skincolor)
|
||||
CV_StealthSetValue(&cv_playercolor, players[consoleplayer].skincolor);
|
||||
else if (skins[players[consoleplayer].skin].prefcolor)
|
||||
CV_StealthSetValue(&cv_playercolor, skins[players[consoleplayer].skin].prefcolor);
|
||||
if (player->skincolor)
|
||||
CV_StealthSetValue(playercolor, player->skincolor);
|
||||
else if (skins[player->skin].prefcolor)
|
||||
CV_StealthSetValue(playercolor, skins[player->skin].prefcolor);
|
||||
else
|
||||
CV_StealthSet(&cv_playercolor, cv_playercolor.defaultvalue);
|
||||
CV_StealthSet(playercolor, playercolor->defaultvalue);
|
||||
}
|
||||
|
||||
if (fastcmp(cv_playername.string, player_names[consoleplayer])
|
||||
&& cv_playercolor.value == players[consoleplayer].skincolor
|
||||
&& fastcmp(cv_skin.string, skins[players[consoleplayer].skin].name))
|
||||
return;
|
||||
|
||||
// We'll handle it later if we're not playing.
|
||||
if (!Playing())
|
||||
return;
|
||||
|
||||
if (fastcmp(playername->string, player_names[pnum])
|
||||
&& playercolor->value == player->skincolor
|
||||
&& fastcmp(playerskin->string, skins[player->skin].name))
|
||||
return;
|
||||
|
||||
if (playerisbot)
|
||||
{
|
||||
players[pnum].skincolor = botcolor;
|
||||
if (players[pnum].mo)
|
||||
players[pnum].mo->color = players[pnum].skincolor;
|
||||
SetPlayerSkinByNum(pnum, botskin-1);
|
||||
return;
|
||||
}
|
||||
|
||||
// If you're not in a netgame, merely update the skin, color, and name.
|
||||
if (!netgame)
|
||||
{
|
||||
INT32 foundskin;
|
||||
|
||||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
strcpy(player_names[consoleplayer], cv_playername.zstring);
|
||||
CleanupPlayerName(pnum, playername->zstring);
|
||||
strcpy(player_names[pnum], playername->zstring);
|
||||
|
||||
players[consoleplayer].skincolor = cv_playercolor.value;
|
||||
player->skincolor = playercolor->value;
|
||||
|
||||
if (players[consoleplayer].mo)
|
||||
players[consoleplayer].mo->color = players[consoleplayer].skincolor;
|
||||
if (player->mo)
|
||||
player->mo->color = player->skincolor;
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
|
||||
if ((foundskin = R_SkinAvailable(playerskin->string)) != -1)
|
||||
{
|
||||
cv_skin.value = foundskin;
|
||||
SetPlayerSkin(consoleplayer, cv_skin.string);
|
||||
CV_StealthSet(&cv_skin, skins[cv_skin.value].name);
|
||||
playerskin->value = foundskin;
|
||||
SetPlayerSkin(pnum, playerskin->string);
|
||||
CV_StealthSet(playerskin, skins[playerskin->value].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv_skin.value = players[consoleplayer].skin;
|
||||
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
||||
playerskin->value = player->skin;
|
||||
CV_StealthSet(playerskin, skins[player->skin].name);
|
||||
// will always be same as current
|
||||
SetPlayerSkin(consoleplayer, cv_skin.string);
|
||||
SetPlayerSkin(pnum, playerskin->string);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
snacpending++;
|
||||
snacpending[splitplayer]++;
|
||||
|
||||
// Don't change name if muted
|
||||
if (player_name_changes[consoleplayer] >= MAXNAMECHANGES)
|
||||
if (player_name_changes[pnum] >= MAXNAMECHANGES)
|
||||
{
|
||||
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
|
||||
CV_StealthSet(playername, player_names[pnum]);
|
||||
HU_AddChatText("\x85*You must wait to change your name again", false);
|
||||
}
|
||||
else if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
|
||||
else if (cv_mute.value && !(server || IsPlayerAdmin(pnum)))
|
||||
CV_StealthSet(playername, player_names[pnum]);
|
||||
else // Cleanup name if changing it
|
||||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
CleanupPlayerName(pnum, playername->zstring);
|
||||
|
||||
// Don't change skin if the server doesn't want you to.
|
||||
if (!CanChangeSkin(consoleplayer))
|
||||
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
||||
if (!CanChangeSkin(pnum))
|
||||
CV_StealthSet(playerskin, skins[player->skin].name);
|
||||
|
||||
// check if player has the skin loaded (cv_skin may have
|
||||
// the name of a skin that was available in the previous game)
|
||||
cv_skin.value = R_SkinAvailable(cv_skin.string);
|
||||
if (cv_skin.value < 0)
|
||||
playerskin->value = R_SkinAvailable(playerskin->string);
|
||||
if (playerskin->value < 0)
|
||||
{
|
||||
INT32 skinnum = players[consoleplayer].skin;
|
||||
CV_StealthSet(&cv_skin, skins[skinnum].name);
|
||||
cv_skin.value = skinnum;
|
||||
INT32 skinnum = player->skin;
|
||||
CV_StealthSet(playerskin, skins[skinnum].name);
|
||||
playerskin->value = skinnum;
|
||||
}
|
||||
|
||||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin.value);
|
||||
SendNetXCmdForPlayer(0, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
// splitscreen
|
||||
static void SendNameAndColor2(void)
|
||||
{
|
||||
INT32 secondplaya = -1;
|
||||
char buf[MAXPLAYERNAME+2];
|
||||
char *p;
|
||||
|
||||
if (splitscreen < 1 && !botingame)
|
||||
return; // can happen if skin2/color2/name2 changed
|
||||
|
||||
if (displayplayers[1] != consoleplayer)
|
||||
secondplaya = displayplayers[1];
|
||||
else if (!netgame) // HACK
|
||||
secondplaya = 1;
|
||||
|
||||
if (secondplaya == -1)
|
||||
return;
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[secondplaya].ctfteam == 1 && cv_playercolor2.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor2, skincolor_redteam);
|
||||
else if (players[secondplaya].ctfteam == 2 && cv_playercolor2.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor2, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor2.value)
|
||||
{
|
||||
if (players[secondplaya].skincolor)
|
||||
CV_StealthSetValue(&cv_playercolor2, players[secondplaya].skincolor);
|
||||
else if (skins[players[secondplaya].skin].prefcolor)
|
||||
CV_StealthSetValue(&cv_playercolor2, skins[players[secondplaya].skin].prefcolor);
|
||||
else
|
||||
CV_StealthSet(&cv_playercolor2, cv_playercolor2.defaultvalue);
|
||||
}
|
||||
|
||||
// We'll handle it later if we're not playing.
|
||||
if (!Playing())
|
||||
return;
|
||||
|
||||
// If you're not in a netgame, merely update the skin, color, and name.
|
||||
if (botingame)
|
||||
{
|
||||
players[secondplaya].skincolor = botcolor;
|
||||
if (players[secondplaya].mo)
|
||||
players[secondplaya].mo->color = players[secondplaya].skincolor;
|
||||
SetPlayerSkinByNum(secondplaya, botskin-1);
|
||||
return;
|
||||
}
|
||||
else if (!netgame)
|
||||
{
|
||||
INT32 foundskin;
|
||||
|
||||
CleanupPlayerName(secondplaya, cv_playername2.zstring);
|
||||
strcpy(player_names[secondplaya], cv_playername2.zstring);
|
||||
|
||||
// don't use displayplayers[1]: the second player must be 1
|
||||
players[secondplaya].skincolor = cv_playercolor2.value;
|
||||
if (players[secondplaya].mo)
|
||||
players[secondplaya].mo->color = players[secondplaya].skincolor;
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin2.string)) != -1)
|
||||
{
|
||||
cv_skin2.value = foundskin;
|
||||
SetPlayerSkin(secondplaya, cv_skin2.string);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv_skin2.value = players[secondplaya].skin;
|
||||
CV_StealthSet(&cv_skin2, skins[players[secondplaya].skin].name);
|
||||
// will always be same as current
|
||||
SetPlayerSkin(secondplaya, cv_skin2.string);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
snac2pending++;
|
||||
|
||||
// Don't change name if muted
|
||||
if (player_name_changes[displayplayers[1]] >= MAXNAMECHANGES)
|
||||
{
|
||||
CV_StealthSet(&cv_playername2, player_names[displayplayers[1]]);
|
||||
HU_AddChatText("\x85*You must wait to change your name again", false);
|
||||
}
|
||||
else if (cv_mute.value && !(server || IsPlayerAdmin(displayplayers[1])))
|
||||
CV_StealthSet(&cv_playername2, player_names[displayplayers[1]]);
|
||||
else // Cleanup name if changing it
|
||||
CleanupPlayerName(displayplayers[1], cv_playername2.zstring);
|
||||
|
||||
// Don't change skin if the server doesn't want you to.
|
||||
if (!CanChangeSkin(displayplayers[1]))
|
||||
CV_StealthSet(&cv_skin2, skins[players[displayplayers[1]].skin].name);
|
||||
|
||||
// check if player has the skin loaded (cv_skin2 may have
|
||||
// the name of a skin that was available in the previous game)
|
||||
cv_skin2.value = R_SkinAvailable(cv_skin2.string);
|
||||
if (cv_skin2.value < 0)
|
||||
{
|
||||
INT32 skinnum = players[displayplayers[1]].skin;
|
||||
CV_StealthSet(&cv_skin2, skins[skinnum].name);
|
||||
cv_skin2.value = skinnum;
|
||||
}
|
||||
|
||||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername2.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor2.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin2.value);
|
||||
SendNetXCmdForPlayer(1, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
static void SendNameAndColor3(void)
|
||||
{
|
||||
INT32 thirdplaya = -1;
|
||||
char buf[MAXPLAYERNAME+2];
|
||||
char *p;
|
||||
|
||||
if (splitscreen < 2)
|
||||
return; // can happen if skin3/color3/name3 changed
|
||||
|
||||
if (displayplayers[2] != consoleplayer)
|
||||
thirdplaya = displayplayers[2];
|
||||
else if (!netgame) // HACK
|
||||
thirdplaya = 2;
|
||||
|
||||
if (thirdplaya == -1)
|
||||
return;
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[thirdplaya].ctfteam == 1 && cv_playercolor3.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor3, skincolor_redteam);
|
||||
else if (players[thirdplaya].ctfteam == 2 && cv_playercolor3.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor3, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor3.value)
|
||||
{
|
||||
if (players[thirdplaya].skincolor)
|
||||
CV_StealthSetValue(&cv_playercolor3, players[thirdplaya].skincolor);
|
||||
else if (skins[players[thirdplaya].skin].prefcolor)
|
||||
CV_StealthSetValue(&cv_playercolor3, skins[players[thirdplaya].skin].prefcolor);
|
||||
else
|
||||
CV_StealthSet(&cv_playercolor3, cv_playercolor3.defaultvalue);
|
||||
}
|
||||
|
||||
// We'll handle it later if we're not playing.
|
||||
if (!Playing())
|
||||
return;
|
||||
|
||||
// If you're not in a netgame, merely update the skin, color, and name.
|
||||
if (!netgame)
|
||||
{
|
||||
INT32 foundskin;
|
||||
|
||||
CleanupPlayerName(thirdplaya, cv_playername3.zstring);
|
||||
strcpy(player_names[thirdplaya], cv_playername3.zstring);
|
||||
|
||||
// don't use displayplayers[2]: the third player must be 2
|
||||
players[thirdplaya].skincolor = cv_playercolor3.value;
|
||||
if (players[thirdplaya].mo)
|
||||
players[thirdplaya].mo->color = players[thirdplaya].skincolor;
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin3.string)) != -1)
|
||||
{
|
||||
cv_skin3.value = foundskin;
|
||||
SetPlayerSkin(thirdplaya, cv_skin3.string);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv_skin3.value = players[thirdplaya].skin;
|
||||
CV_StealthSet(&cv_skin3, skins[players[thirdplaya].skin].name);
|
||||
// will always be same as current
|
||||
SetPlayerSkin(thirdplaya, cv_skin3.string);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
snac3pending++;
|
||||
|
||||
// Don't change name if muted
|
||||
if (player_name_changes[displayplayers[2]] >= MAXNAMECHANGES)
|
||||
{
|
||||
CV_StealthSet(&cv_playername3, player_names[displayplayers[2]]);
|
||||
HU_AddChatText("\x85*You must wait to change your name again", false);
|
||||
}
|
||||
else if (cv_mute.value && !(server || IsPlayerAdmin(displayplayers[2])))
|
||||
CV_StealthSet(&cv_playername3, player_names[displayplayers[2]]);
|
||||
else // Cleanup name if changing it
|
||||
CleanupPlayerName(displayplayers[2], cv_playername3.zstring);
|
||||
|
||||
// Don't change skin if the server doesn't want you to.
|
||||
if (!CanChangeSkin(displayplayers[2]))
|
||||
CV_StealthSet(&cv_skin3, skins[players[displayplayers[2]].skin].name);
|
||||
|
||||
// check if player has the skin loaded (cv_skin3 may have
|
||||
// the name of a skin that was available in the previous game)
|
||||
cv_skin3.value = R_SkinAvailable(cv_skin3.string);
|
||||
if (cv_skin3.value < 0)
|
||||
{
|
||||
INT32 skinnum = players[displayplayers[2]].skin;
|
||||
CV_StealthSet(&cv_skin3, skins[skinnum].name);
|
||||
cv_skin3.value = skinnum;
|
||||
}
|
||||
|
||||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername3.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor3.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin3.value);
|
||||
SendNetXCmdForPlayer(2, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
static void SendNameAndColor4(void)
|
||||
{
|
||||
INT32 fourthplaya = -1;
|
||||
char buf[MAXPLAYERNAME+2];
|
||||
char *p;
|
||||
|
||||
if (splitscreen < 3)
|
||||
return; // can happen if skin4/color4/name4 changed
|
||||
|
||||
if (displayplayers[3] != consoleplayer)
|
||||
fourthplaya = displayplayers[3];
|
||||
else if (!netgame) // HACK
|
||||
fourthplaya = 3;
|
||||
|
||||
if (fourthplaya == -1)
|
||||
return;
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[fourthplaya].ctfteam == 1 && cv_playercolor4.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor4, skincolor_redteam);
|
||||
else if (players[fourthplaya].ctfteam == 2 && cv_playercolor4.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor4, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor4.value)
|
||||
{
|
||||
if (players[fourthplaya].skincolor)
|
||||
CV_StealthSetValue(&cv_playercolor4, players[fourthplaya].skincolor);
|
||||
else if (skins[players[fourthplaya].skin].prefcolor)
|
||||
CV_StealthSetValue(&cv_playercolor4, skins[players[fourthplaya].skin].prefcolor);
|
||||
else
|
||||
CV_StealthSet(&cv_playercolor4, cv_playercolor4.defaultvalue);
|
||||
}
|
||||
|
||||
// We'll handle it later if we're not playing.
|
||||
if (!Playing())
|
||||
return;
|
||||
|
||||
// If you're not in a netgame, merely update the skin, color, and name.
|
||||
if (botingame)
|
||||
{
|
||||
players[fourthplaya].skincolor = botcolor;
|
||||
if (players[fourthplaya].mo)
|
||||
players[fourthplaya].mo->color = players[fourthplaya].skincolor;
|
||||
SetPlayerSkinByNum(fourthplaya, botskin-1);
|
||||
return;
|
||||
}
|
||||
else if (!netgame)
|
||||
{
|
||||
INT32 foundskin;
|
||||
|
||||
CleanupPlayerName(fourthplaya, cv_playername4.zstring);
|
||||
strcpy(player_names[fourthplaya], cv_playername4.zstring);
|
||||
|
||||
// don't use displayplayers[3]: the second player must be 4
|
||||
players[fourthplaya].skincolor = cv_playercolor4.value;
|
||||
if (players[fourthplaya].mo)
|
||||
players[fourthplaya].mo->color = players[fourthplaya].skincolor;
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin4.string)) != -1)
|
||||
{
|
||||
cv_skin4.value = foundskin;
|
||||
SetPlayerSkin(fourthplaya, cv_skin4.string);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv_skin4.value = players[fourthplaya].skin;
|
||||
CV_StealthSet(&cv_skin4, skins[players[fourthplaya].skin].name);
|
||||
// will always be same as current
|
||||
SetPlayerSkin(fourthplaya, cv_skin4.string);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
snac4pending++;
|
||||
|
||||
// Don't change name if muted
|
||||
if (player_name_changes[displayplayers[3]] >= MAXNAMECHANGES)
|
||||
{
|
||||
CV_StealthSet(&cv_playername4, player_names[displayplayers[3]]);
|
||||
HU_AddChatText("\x85*You must wait to change your name again", false);
|
||||
}
|
||||
else if (cv_mute.value && !(server || IsPlayerAdmin(displayplayers[3])))
|
||||
CV_StealthSet(&cv_playername4, player_names[displayplayers[3]]);
|
||||
else // Cleanup name if changing it
|
||||
CleanupPlayerName(displayplayers[3], cv_playername4.zstring);
|
||||
|
||||
// Don't change skin if the server doesn't want you to.
|
||||
if (!CanChangeSkin(displayplayers[3]))
|
||||
CV_StealthSet(&cv_skin4, skins[players[displayplayers[3]].skin].name);
|
||||
|
||||
// check if player has the skin loaded (cv_skin4 may have
|
||||
// the name of a skin that was available in the previous game)
|
||||
cv_skin4.value = R_SkinAvailable(cv_skin4.string);
|
||||
if (cv_skin4.value < 0)
|
||||
{
|
||||
INT32 skinnum = players[displayplayers[3]].skin;
|
||||
CV_StealthSet(&cv_skin4, skins[skinnum].name);
|
||||
cv_skin4.value = skinnum;
|
||||
}
|
||||
|
||||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername4.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor4.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin4.value);
|
||||
SendNetXCmdForPlayer(3, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
WRITESTRINGN(p, playername->zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)playercolor->value);
|
||||
WRITEUINT8(p, (UINT8)playerskin->value);
|
||||
SendNetXCmdForPlayer(splitplayer, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
player_t *p = &players[playernum];
|
||||
player_t *player = &players[playernum];
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 color, skin;
|
||||
|
||||
@@ -1936,19 +1636,14 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
I_Error("There is no player %d!", playernum);
|
||||
#endif
|
||||
|
||||
if (playernum == consoleplayer)
|
||||
snacpending--; // TODO: make snacpending an array instead of 4 separate vars?
|
||||
else if (playernum == displayplayers[1])
|
||||
snac2pending--;
|
||||
else if (playernum == displayplayers[2])
|
||||
snac3pending--;
|
||||
else if (playernum == displayplayers[3])
|
||||
snac4pending--;
|
||||
|
||||
if (P_IsLocalPlayer(player))
|
||||
{
|
||||
snacpending[playernum]--;
|
||||
#ifdef PARANOIA
|
||||
if (snacpending < 0 || snac2pending < 0 || snac3pending < 0 || snac4pending < 0)
|
||||
I_Error("snacpending negative!");
|
||||
if (snacpending[playernum] < 0)
|
||||
I_Error("snacpending negative!");
|
||||
#endif
|
||||
}
|
||||
|
||||
READSTRINGN(*cp, name, MAXPLAYERNAME);
|
||||
color = READUINT8(*cp);
|
||||
@@ -1962,33 +1657,32 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
}
|
||||
|
||||
// set color
|
||||
p->skincolor = color % MAXSKINCOLORS;
|
||||
if (p->mo)
|
||||
p->mo->color = (UINT8)p->skincolor;
|
||||
player->skincolor = color % MAXSKINCOLORS;
|
||||
if (player->mo)
|
||||
player->mo->color = (UINT8)player->skincolor;
|
||||
demo_extradata[playernum] |= DXD_COLOR;
|
||||
|
||||
// normal player colors
|
||||
if (server && (p != &players[consoleplayer] && p != &players[displayplayers[1]]
|
||||
&& p != &players[displayplayers[2]] && p != &players[displayplayers[3]]))
|
||||
if (server && !P_IsLocalPlayer(player))
|
||||
{
|
||||
boolean kick = false;
|
||||
|
||||
// team colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
|
||||
if (player->ctfteam == 1 && player->skincolor != skincolor_redteam)
|
||||
kick = true;
|
||||
else if (p->ctfteam == 2 && p->skincolor != skincolor_blueteam)
|
||||
else if (player->ctfteam == 2 && player->skincolor != skincolor_blueteam)
|
||||
kick = true;
|
||||
}
|
||||
|
||||
// don't allow color "none"
|
||||
if (!p->skincolor)
|
||||
if (!player->skincolor)
|
||||
kick = true;
|
||||
|
||||
if (kick)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], player->ctfteam, player->skincolor);
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
return;
|
||||
}
|
||||
@@ -2000,6 +1694,7 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
const INT32 forcedskin = cv_forceskin.value;
|
||||
SetPlayerSkinByNum(playernum, forcedskin);
|
||||
|
||||
// TODO: make cv_skin an array
|
||||
if (playernum == consoleplayer)
|
||||
CV_StealthSet(&cv_skin, skins[forcedskin].name);
|
||||
else if (playernum == displayplayers[1])
|
||||
@@ -2013,44 +1708,16 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
SetPlayerSkinByNum(playernum, skin);
|
||||
}
|
||||
|
||||
void SendWeaponPref(void)
|
||||
void SendWeaponPref(UINT8 splitplayer)
|
||||
{
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam[0].value)
|
||||
|
||||
if (cv_flipcam[splitplayer].value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmdForPlayer(0, XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
void SendWeaponPref2(void)
|
||||
{
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam[1].value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmdForPlayer(1, XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
void SendWeaponPref3(void)
|
||||
{
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam[2].value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmdForPlayer(2, XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
void SendWeaponPref4(void)
|
||||
{
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam[3].value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmdForPlayer(3, XD_WEAPONPREF, buf, 1);
|
||||
SendNetXCmdForPlayer(splitplayer, XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
static void Got_WeaponPref(const UINT8 **cp, INT32 playernum)
|
||||
@@ -2066,23 +1733,10 @@ static void Got_WeaponPref(const UINT8 **cp, INT32 playernum)
|
||||
player->pflags |= PF_ANALOGMODE;
|
||||
}
|
||||
|
||||
void D_SendPlayerConfig(void)
|
||||
void D_SendPlayerConfig(UINT8 splitplayer)
|
||||
{
|
||||
SendNameAndColor();
|
||||
if (splitscreen || botingame)
|
||||
SendNameAndColor2();
|
||||
if (splitscreen > 1)
|
||||
SendNameAndColor3();
|
||||
if (splitscreen > 2)
|
||||
SendNameAndColor4();
|
||||
|
||||
SendWeaponPref();
|
||||
if (splitscreen)
|
||||
SendWeaponPref2();
|
||||
if (splitscreen > 1)
|
||||
SendWeaponPref3();
|
||||
if (splitscreen > 2)
|
||||
SendWeaponPref4();
|
||||
SendNameAndColor(splitplayer);
|
||||
SendWeaponPref(splitplayer);
|
||||
}
|
||||
|
||||
// Only works for displayplayer, sorry!
|
||||
@@ -2105,10 +1759,12 @@ INT32 D_LookupPlayer(const char *s)
|
||||
return playernum;
|
||||
}
|
||||
|
||||
const size_t len = strlen(s);
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; ++playernum)
|
||||
{
|
||||
/* Match name case-insensitively: fully, or partially the start. */
|
||||
if (playeringame[playernum] && (strnicmp(player_names[playernum], s, strlen(s)) == 0))
|
||||
if (playeringame[playernum] && (strnicmp(player_names[playernum], s, len) == 0))
|
||||
{
|
||||
return playernum;
|
||||
}
|
||||
@@ -2148,13 +1804,15 @@ static void GetViewablePlayerPlaceRange(INT32 *first, INT32 *last)
|
||||
(*last) = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
if (G_CouldView(i))
|
||||
{
|
||||
place = players[i].kartstuff[k_position];
|
||||
if (place < (*first))
|
||||
(*first) = place;
|
||||
if (place > (*last))
|
||||
(*last) = place;
|
||||
if (G_CouldView(i))
|
||||
{
|
||||
place = players[i].kartstuff[k_position];
|
||||
if (place < (*first))
|
||||
(*first) = place;
|
||||
if (place > (*last))
|
||||
(*last) = place;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2488,7 +2146,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
|
||||
displayplayers[1] = 1;
|
||||
playeringame[1] = true;
|
||||
players[1].bot = 1;
|
||||
SendNameAndColor2();
|
||||
SendNameAndColor(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5765,50 +5423,54 @@ static void ForceSkin_OnChange(void)
|
||||
}
|
||||
}
|
||||
|
||||
//Allows the player's name to be changed if cv_mute is off.
|
||||
// Allows the player's name to be changed if cv_mute is off.
|
||||
static void Name_OnChange(void)
|
||||
{
|
||||
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
|
||||
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
SendNameAndColor();
|
||||
|
||||
SendNameAndColor(0);
|
||||
|
||||
}
|
||||
|
||||
static void Name2_OnChange(void)
|
||||
{
|
||||
if (cv_mute.value) //Secondary player can't be admin.
|
||||
if (cv_mute.value) // Secondary player can't be admin.
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
|
||||
CV_StealthSet(&cv_playername2, player_names[displayplayers[1]]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
SendNameAndColor2();
|
||||
|
||||
SendNameAndColor(1);
|
||||
}
|
||||
|
||||
static void Name3_OnChange(void)
|
||||
{
|
||||
if (cv_mute.value) //Third player can't be admin.
|
||||
if (cv_mute.value) // Third player can't be admin.
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
|
||||
CV_StealthSet(&cv_playername3, player_names[displayplayers[2]]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
SendNameAndColor3();
|
||||
|
||||
SendNameAndColor(2);
|
||||
}
|
||||
|
||||
static void Name4_OnChange(void)
|
||||
{
|
||||
if (cv_mute.value) //Secondary player can't be admin.
|
||||
if (cv_mute.value) // Secondary player can't be admin.
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n"));
|
||||
CV_StealthSet(&cv_playername4, player_names[displayplayers[3]]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
SendNameAndColor4();
|
||||
|
||||
SendNameAndColor(3);
|
||||
}
|
||||
|
||||
/** Sends a skin change for the console player, unless that player is moving.
|
||||
@@ -5830,7 +5492,7 @@ static void Skin_OnChange(void)
|
||||
}
|
||||
|
||||
if (CanChangeSkin(consoleplayer) && !P_PlayerMoving(consoleplayer))
|
||||
SendNameAndColor();
|
||||
SendNameAndColor(0);
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n"));
|
||||
@@ -5851,7 +5513,7 @@ static void Skin2_OnChange(void)
|
||||
return; // do whatever you want
|
||||
|
||||
if (CanChangeSkin(displayplayers[1]) && !P_PlayerMoving(displayplayers[1]))
|
||||
SendNameAndColor2();
|
||||
SendNameAndColor(1);
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n"));
|
||||
@@ -5867,7 +5529,7 @@ static void Skin3_OnChange(void)
|
||||
return; // do whatever you want
|
||||
|
||||
if (CanChangeSkin(displayplayers[2]) && !P_PlayerMoving(displayplayers[2]))
|
||||
SendNameAndColor3();
|
||||
SendNameAndColor(2);
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n"));
|
||||
@@ -5883,7 +5545,7 @@ static void Skin4_OnChange(void)
|
||||
return; // do whatever you want
|
||||
|
||||
if (CanChangeSkin(displayplayers[3]) && !P_PlayerMoving(displayplayers[3]))
|
||||
SendNameAndColor4();
|
||||
SendNameAndColor(3);
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n"));
|
||||
@@ -5996,7 +5658,7 @@ static void Color_OnChange(void)
|
||||
if (!P_PlayerMoving(consoleplayer))
|
||||
{
|
||||
// Color change menu scrolling fix is no longer necessary
|
||||
SendNameAndColor();
|
||||
SendNameAndColor(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6018,7 +5680,7 @@ static void Color2_OnChange(void)
|
||||
if (!P_PlayerMoving(displayplayers[1]))
|
||||
{
|
||||
// Color change menu scrolling fix is no longer necessary
|
||||
SendNameAndColor2();
|
||||
SendNameAndColor(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6035,7 +5697,7 @@ static void Color3_OnChange(void)
|
||||
if (!P_PlayerMoving(displayplayers[2]))
|
||||
{
|
||||
// Color change menu scrolling fix is no longer necessary
|
||||
SendNameAndColor3();
|
||||
SendNameAndColor(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6052,7 +5714,7 @@ static void Color4_OnChange(void)
|
||||
if (!P_PlayerMoving(displayplayers[3]))
|
||||
{
|
||||
// Color change menu scrolling fix is no longer necessary
|
||||
SendNameAndColor4();
|
||||
SendNameAndColor(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+2
-5
@@ -21,10 +21,7 @@ extern "C" {
|
||||
|
||||
#include "command.h"
|
||||
|
||||
void SendWeaponPref(void);
|
||||
void SendWeaponPref2(void);
|
||||
void SendWeaponPref3(void);
|
||||
void SendWeaponPref4(void);
|
||||
void SendWeaponPref(UINT8 splitplayer);
|
||||
|
||||
// console vars
|
||||
extern consvar_t cv_playername;
|
||||
@@ -295,7 +292,7 @@ typedef union {
|
||||
// add game commands, needs cleanup
|
||||
void D_RegisterServerCommands(void);
|
||||
void D_RegisterClientCommands(void);
|
||||
void D_SendPlayerConfig(void);
|
||||
void D_SendPlayerConfig(UINT8 splitplayer);
|
||||
void Command_ExitGame_f(void);
|
||||
void Command_Retry_f(void);
|
||||
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
|
||||
|
||||
+16
-16
@@ -960,7 +960,7 @@ void Got_Filetxpak(void)
|
||||
|| fastcmp(filename, "music.kart")
|
||||
|| fastcmp(filename, "patch.kart")
|
||||
))
|
||||
I_Error("Tried to download \"%s\"", filename);
|
||||
I_Error("Tried to download base-game file: \"%s\"", filename);
|
||||
|
||||
if (filenum >= fileneedednum)
|
||||
{
|
||||
@@ -1019,21 +1019,21 @@ void Got_Filetxpak(void)
|
||||
|
||||
switch(file->status)
|
||||
{
|
||||
case FS_NOTFOUND:
|
||||
s = "FS_NOTFOUND";
|
||||
break;
|
||||
case FS_FOUND:
|
||||
s = "FS_FOUND";
|
||||
break;
|
||||
case FS_OPEN:
|
||||
s = "FS_OPEN";
|
||||
break;
|
||||
case FS_MD5SUMBAD:
|
||||
s = "FS_MD5SUMBAD";
|
||||
break;
|
||||
default:
|
||||
s = "unknown";
|
||||
break;
|
||||
case FS_NOTFOUND:
|
||||
s = "FS_NOTFOUND";
|
||||
break;
|
||||
case FS_FOUND:
|
||||
s = "FS_FOUND";
|
||||
break;
|
||||
case FS_OPEN:
|
||||
s = "FS_OPEN";
|
||||
break;
|
||||
case FS_MD5SUMBAD:
|
||||
s = "FS_MD5SUMBAD";
|
||||
break;
|
||||
default:
|
||||
s = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
#ifndef __DEHACKED_H__
|
||||
#define __DEHACKED_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "m_fixed.h" // for get_number
|
||||
#include "info.h"
|
||||
|
||||
@@ -71,4 +75,9 @@ typedef struct
|
||||
} MYFILE;
|
||||
#define myfeof(a) (a->data + a->size <= a->curpos)
|
||||
char *myfgets(char *buf, size_t bufsize, MYFILE *f);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -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.2"
|
||||
#define VERSIONSTRINGW L"Saturn v9.2"
|
||||
#define VERSIONSTRING "Saturn v9.x - Testing"
|
||||
#define VERSIONSTRINGW L"Saturn v9.x - Testing "
|
||||
|
||||
#define SATURN_TESTING // comment out for saturn release builds!
|
||||
|
||||
|
||||
+4
-3
@@ -305,11 +305,12 @@ void F_IntroTicker(void)
|
||||
// Stay on black for a bit. =)
|
||||
{
|
||||
tic_t quittime;
|
||||
quittime = I_GetTime() + NEWTICRATE*2; // Shortened the quit time, used to be 2 seconds
|
||||
while (quittime > I_GetTime())
|
||||
quittime = I_GetGlobalTime() + NEWTICRATE*2; // Shortened the quit time, used to be 2 seconds
|
||||
|
||||
while (quittime > I_GetGlobalTime())
|
||||
{
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
I_UpdateTime();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -368,10 +368,10 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
||||
break;
|
||||
|
||||
// wait loop
|
||||
while (!((nowtime = I_GetTime()) - lastwipetic))
|
||||
while (!((nowtime = I_GetGlobalTime()) - lastwipetic))
|
||||
{
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
I_UpdateTime();
|
||||
}
|
||||
lastwipetic = nowtime;
|
||||
|
||||
|
||||
+1
-4
@@ -69,9 +69,6 @@ UINT8 botcolor = 0;
|
||||
|
||||
JoyType_t Joystick[MAXSPLITSCREENPLAYERS] = {};
|
||||
|
||||
// 1024 bytes is plenty for a savegame
|
||||
#define SAVEGAMESIZE (1024)
|
||||
|
||||
// SRB2kart
|
||||
char gamedatafilename[64] = "kartdata.dat";
|
||||
char timeattackfolder[64] = "kart";
|
||||
@@ -3905,7 +3902,7 @@ void G_SaveGame(UINT32 savegameslot)
|
||||
char name[VERSIONSIZE];
|
||||
size_t length;
|
||||
|
||||
save.p = save.buffer = (UINT8 *)Z_Malloc(SAVEGAMESIZE, PU_STATIC, NULL);
|
||||
save.p = save.buffer = (UINT8 *)Z_Malloc(1024, PU_STATIC, NULL); // 1024 bytes is plenty for a savegame
|
||||
if (!save.p)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("No more free memory for saving game data\n"));
|
||||
|
||||
@@ -2,7 +2,7 @@ hw_bsp.c
|
||||
hw_draw.c
|
||||
hw_main.cpp
|
||||
hw_clip.c
|
||||
hw_md2.c
|
||||
hw_md2.cpp
|
||||
hw_cache.c
|
||||
hw_md2load.c
|
||||
hw_md3load.c
|
||||
|
||||
+45
-31
@@ -16,6 +16,7 @@
|
||||
#ifdef HWRENDER
|
||||
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "hw_main.h"
|
||||
#include "hw_glob.h"
|
||||
@@ -35,6 +36,10 @@
|
||||
#include "../p_spec.h" // anim_t
|
||||
#include "../r_sky.h"
|
||||
|
||||
struct ColorMipMap {
|
||||
std::unordered_map<const UINT8*, GLMipmap_t*> map;
|
||||
};
|
||||
|
||||
INT32 patchformat = GL_TEXFMT_AP_88; // use alpha for holes
|
||||
INT32 textureformat = GL_TEXFMT_P_8; // use chromakey for hole
|
||||
|
||||
@@ -448,7 +453,7 @@ typedef struct
|
||||
} GLMapTextureSet_t; // idk i suck at naming things
|
||||
|
||||
static size_t gl_numtextures = 0; // Texture count
|
||||
static GLMapTextureSet_t *gl_textures; // For all textures
|
||||
static GLMapTextureSet_t *gl_textures = NULL; // For all textures
|
||||
|
||||
static void HWR_FreeTextureData(patch_t *patch)
|
||||
{
|
||||
@@ -504,34 +509,31 @@ static void HWR_FreeTextureColormaps(patch_t *patch)
|
||||
return;
|
||||
|
||||
// The mipmap must be valid, obviously
|
||||
while (pat->mipmap)
|
||||
if (!pat->mipmap)
|
||||
return;
|
||||
|
||||
if (pat->mipmap->nextcolormap)
|
||||
{
|
||||
// Confusing at first, but pat->mipmap->nextcolormap
|
||||
// at the beginning of the loop is the first colormap
|
||||
// from the linked list of colormaps.
|
||||
GLMipmap_t *next = NULL;
|
||||
for (auto& pair : pat->mipmap->nextcolormap->map)
|
||||
{
|
||||
GLMipmap_t *glMipmap = pair.second;
|
||||
|
||||
// No mipmap in this patch, break out of the loop.
|
||||
if (!pat->mipmap)
|
||||
break;
|
||||
if (glMipmap)
|
||||
{
|
||||
// Free image data from memory.
|
||||
Z_Free(glMipmap->data);
|
||||
Z_Free(glMipmap->colormap);
|
||||
glMipmap->data = NULL;
|
||||
glMipmap->colormap = NULL;
|
||||
GL_DeleteTexture(glMipmap);
|
||||
|
||||
// No colormap mipmaps either.
|
||||
if (!pat->mipmap->nextcolormap)
|
||||
break;
|
||||
// Free the colormap mipmap from memory.
|
||||
free(glMipmap);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the first colormap to the one that comes after it.
|
||||
next = pat->mipmap->nextcolormap;
|
||||
pat->mipmap->nextcolormap = next->nextcolormap;
|
||||
|
||||
// Free image data from memory.
|
||||
Z_Free(next->data);
|
||||
Z_Free(next->colormap);
|
||||
next->data = NULL;
|
||||
next->colormap = NULL;
|
||||
GL_DeleteTexture(next);
|
||||
|
||||
// Free the old colormap mipmap from memory.
|
||||
free(next);
|
||||
delete pat->mipmap->nextcolormap;
|
||||
pat->mipmap->nextcolormap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1085,7 +1087,7 @@ void HWR_GetPatch(patch_t *patch)
|
||||
void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
||||
{
|
||||
GLPatch_t *glPatch;
|
||||
GLMipmap_t *glMipmap, *newMipmap;
|
||||
GLMipmap_t *newMipmap;
|
||||
|
||||
if (!patch->hardware)
|
||||
Patch_CreateGL(patch);
|
||||
@@ -1099,11 +1101,19 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap;)
|
||||
// gotta make our map if theres none
|
||||
if (!glPatch->mipmap->nextcolormap)
|
||||
{
|
||||
glMipmap = glMipmap->nextcolormap;
|
||||
glPatch->mipmap->nextcolormap = new ColorMipMap();
|
||||
}
|
||||
|
||||
// search for the mipmap
|
||||
auto& map = glPatch->mipmap->nextcolormap->map;
|
||||
auto it = map.find(colormap);
|
||||
|
||||
if (it != map.end())
|
||||
{
|
||||
GLMipmap_t *glMipmap = it->second;
|
||||
|
||||
if (glMipmap->colormap && glMipmap->colormap->source == colormap)
|
||||
{
|
||||
@@ -1113,7 +1123,9 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
||||
HWR_UpdatePatchMipmap(patch, glMipmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_LoadPatchMipmap(patch, glMipmap);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1128,7 +1140,9 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
||||
newMipmap = static_cast<GLMipmap_t *>(calloc(1, sizeof (*newMipmap)));
|
||||
if (newMipmap == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetMappedPatch");
|
||||
glMipmap->nextcolormap = newMipmap;
|
||||
|
||||
// add to nextcolormap map
|
||||
map[colormap] = newMipmap;
|
||||
|
||||
newMipmap->colormap = static_cast<GLColormap_t *>(Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL));
|
||||
newMipmap->colormap->source = colormap;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
typedef enum GLTextureFormat_e
|
||||
{
|
||||
GL_TEXFMT_NULL = 0x00,
|
||||
GL_TEXFMT_P_8 = 0x01, /* 8-bit palette */
|
||||
GL_TEXFMT_AP_88 = 0x02, /* 8-bit alpha, 8-bit palette */
|
||||
|
||||
@@ -54,7 +55,7 @@ struct GLMipmap_s
|
||||
UINT16 width, height;
|
||||
UINT32 downloaded; // The GPU has this texture.
|
||||
|
||||
struct GLMipmap_s *nextcolormap;
|
||||
struct ColorMipMap *nextcolormap;
|
||||
struct GLColormap_s *colormap;
|
||||
};
|
||||
typedef struct GLMipmap_s GLMipmap_t;
|
||||
|
||||
@@ -5517,6 +5517,7 @@ void HWR_SetTransform(float fpov)
|
||||
void HWR_ClearClipper(void)
|
||||
{
|
||||
const angle_t a1 = gld_FrustumAngle(gl_aimingangle);
|
||||
|
||||
gld_clipper_Clear();
|
||||
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
@@ -5601,7 +5602,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
||||
{
|
||||
if (allow_portals && rootportal)
|
||||
{
|
||||
HWR_PortalFrame(rootportal);// for portalclipsector, it could have gone null from search
|
||||
HWR_PortalFrame(rootportal); // for portalclipsector, it could have gone null from search
|
||||
HWR_PortalClipping(rootportal);
|
||||
}
|
||||
}
|
||||
@@ -5677,6 +5678,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
||||
PS_START_TIMING(ps_hw_spritesorttime);
|
||||
HWR_SortVisSprites();
|
||||
PS_STOP_TIMING(ps_hw_spritesorttime);
|
||||
|
||||
PS_START_TIMING(ps_hw_spritedrawtime);
|
||||
if (UNLIKELY(cv_glmdls.value))
|
||||
HWR_DrawSprites<DrawSpritesType::kModels>();
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
/// Inspired from md2.c by Mete Ciragan (mete@swissquake.ch)
|
||||
|
||||
|
||||
#include "hw_data.h"
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -72,6 +73,12 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
struct ColorMipMap {
|
||||
std::unordered_map<const UINT8*, GLMipmap_t*> map;
|
||||
};
|
||||
|
||||
md2_t md2_models[NUMSPRITES] = {};
|
||||
md2_t md2_playermodels[MAXSKINS] = {};
|
||||
md2_t md2_localplayermodels[MAXLOCALSKINS] = {};
|
||||
@@ -93,10 +100,10 @@ static void md2_freeModel (model_t *model)
|
||||
static model_t *md2_readModel(const char *filename)
|
||||
{
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
if (FIL_FileExists(va("%s"PATHSEP"%s", srb2home, filename)))
|
||||
return LoadModel(va("%s"PATHSEP"%s", srb2home, filename), PU_STATIC);
|
||||
else if (FIL_FileExists(va("%s"PATHSEP"%s", srb2path, filename)))
|
||||
return LoadModel(va("%s"PATHSEP"%s", srb2path, filename), PU_STATIC);
|
||||
if (FIL_FileExists(va("%s" PATHSEP "%s", srb2home, filename)))
|
||||
return LoadModel(va("%s" PATHSEP "%s", srb2home, filename), PU_STATIC);
|
||||
else if (FIL_FileExists(va("%s" PATHSEP "%s", srb2path, filename)))
|
||||
return LoadModel(va("%s" PATHSEP "%s", srb2path, filename), PU_STATIC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -159,18 +166,18 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
#endif
|
||||
volatile png_FILE_p png_FILE;
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
char *pngfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2home, filename);
|
||||
char *pngfilename = va("%s" PATHSEP "mdls" PATHSEP "%s", srb2home, filename);
|
||||
|
||||
FIL_ForceExtension(pngfilename, ".png");
|
||||
png_FILE = fopen(pngfilename, "rb");
|
||||
if (!png_FILE)
|
||||
{
|
||||
pngfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2path, filename);
|
||||
pngfilename = va("%s" PATHSEP "mdls" PATHSEP "%s", srb2path, filename);
|
||||
FIL_ForceExtension(pngfilename, ".png");
|
||||
png_FILE = fopen(pngfilename, "rb");
|
||||
//CONS_Debug(DBG_RENDER, "M_SavePNG: Error on opening %s for loading\n", filename);
|
||||
if (!png_FILE)
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
|
||||
@@ -179,7 +186,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "PNG_Load: Error on initialize libpng\n");
|
||||
fclose(png_FILE);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
png_info_ptr = png_create_info_struct(png_ptr);
|
||||
@@ -188,7 +195,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
CONS_Debug(DBG_RENDER, "PNG_Load: Error on allocate for libpng\n");
|
||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||
fclose(png_FILE);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@@ -201,7 +208,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
png_destroy_read_struct(&png_ptr, &png_info_ptr, NULL);
|
||||
fclose(png_FILE);
|
||||
Z_Free(glpatch->mipmap->data);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
png_memcpy(png_jmpbuf(png_ptr), jmpbuf, sizeof jmp_buf);
|
||||
@@ -241,8 +248,8 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||
|
||||
{
|
||||
png_uint_32 i, pitch = png_get_rowbytes(png_ptr, png_info_ptr);
|
||||
png_bytep PNG_image = Z_Malloc(pitch*height, PU_HWRMODELTEXTURE, &glpatch->mipmap->data);
|
||||
png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof (png_bytep));
|
||||
png_bytep PNG_image = static_cast<png_bytep>(Z_Malloc(pitch*height, PU_HWRMODELTEXTURE, &glpatch->mipmap->data));
|
||||
png_bytepp row_pointers = static_cast<png_bytepp>(png_malloc(png_ptr, height * sizeof (png_bytep)));
|
||||
for (i = 0; i < height; i++)
|
||||
row_pointers[i] = PNG_image + i*pitch;
|
||||
png_read_image(png_ptr, row_pointers);
|
||||
@@ -292,42 +299,42 @@ static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||
INT32 ch, rep;
|
||||
FILE *file;
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
char *pcxfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2home, filename);
|
||||
char *pcxfilename = va("%s" PATHSEP "mdls" PATHSEP "%s", srb2home, filename);
|
||||
|
||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||
file = fopen(pcxfilename, "rb");
|
||||
if (!file)
|
||||
{
|
||||
pcxfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2path, filename);
|
||||
pcxfilename = va("%s" PATHSEP "mdls" PATHSEP "%s", srb2path, filename);
|
||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||
file = fopen(pcxfilename, "rb");
|
||||
if (!file)
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
if (fread(&header, sizeof (PcxHeader), 1, file) != 1)
|
||||
{
|
||||
fclose(file);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
if (header.bitsPerPixel != 8)
|
||||
{
|
||||
fclose(file);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
|
||||
fseek(file, -PALSIZE, SEEK_END);
|
||||
|
||||
pw = *w = header.xmax - header.xmin + 1;
|
||||
ph = *h = header.ymax - header.ymin + 1;
|
||||
image = Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &glpatch->mipmap->data);
|
||||
image = static_cast<RGBA_t *>(Z_Malloc(pw*ph*4, PU_HWRMODELTEXTURE, &glpatch->mipmap->data));
|
||||
|
||||
if (fread(palette, sizeof (UINT8), PALSIZE, file) != PALSIZE)
|
||||
{
|
||||
Z_Free(image);
|
||||
fclose(file);
|
||||
return 0;
|
||||
return GL_TEXFMT_NULL;
|
||||
}
|
||||
fseek(file, sizeof (PcxHeader), SEEK_SET);
|
||||
|
||||
@@ -369,8 +376,8 @@ static void md2_loadTexture(md2_t *model)
|
||||
|
||||
if (model->glpatch)
|
||||
{
|
||||
patch = model->glpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
patch = static_cast<patch_t *>(model->glpatch);
|
||||
glPatch = static_cast<GLPatch_t *>(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
@@ -381,7 +388,7 @@ static void md2_loadTexture(md2_t *model)
|
||||
Patch_AllocateHardwarePatch(patch);
|
||||
|
||||
if (glPatch == NULL)
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
glPatch = static_cast<GLPatch_t *>(patch->hardware);
|
||||
|
||||
if (!glPatch->mipmap->downloaded && !glPatch->mipmap->data)
|
||||
{
|
||||
@@ -389,10 +396,10 @@ static void md2_loadTexture(md2_t *model)
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
if (glPatch->mipmap->format == GL_TEXFMT_NULL)
|
||||
#endif
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
if (glPatch->mipmap->format == GL_TEXFMT_NULL)
|
||||
{
|
||||
model->notexturefile = true; // mark it so its not searched for again repeatedly
|
||||
return;
|
||||
@@ -412,7 +419,7 @@ static void md2_loadTexture(md2_t *model)
|
||||
UINT32 size;
|
||||
RGBA_t *image;
|
||||
// Lactozilla: Apply colour cube
|
||||
image = glPatch->mipmap->data;
|
||||
image = static_cast<RGBA_t *>(glPatch->mipmap->data);
|
||||
size = w*h;
|
||||
while (size--)
|
||||
{
|
||||
@@ -433,7 +440,7 @@ static void md2_loadBlendTexture(md2_t *model)
|
||||
patch_t *patch;
|
||||
GLPatch_t *glPatch = NULL;
|
||||
|
||||
char *filename = Z_Malloc(strlen(model->filename)+7, PU_STATIC, NULL);
|
||||
char *filename = static_cast<char *>(Z_Malloc(strlen(model->filename)+7, PU_STATIC, NULL));
|
||||
|
||||
strcpy(filename, model->filename);
|
||||
|
||||
@@ -441,8 +448,8 @@ static void md2_loadBlendTexture(md2_t *model)
|
||||
|
||||
if (model->blendglpatch)
|
||||
{
|
||||
patch = model->blendglpatch;
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
patch = static_cast<patch_t *>(model->blendglpatch);
|
||||
glPatch = static_cast<GLPatch_t *>(patch->hardware);
|
||||
if (glPatch)
|
||||
Z_Free(glPatch->mipmap->data);
|
||||
}
|
||||
@@ -453,17 +460,17 @@ static void md2_loadBlendTexture(md2_t *model)
|
||||
Patch_AllocateHardwarePatch(patch);
|
||||
|
||||
if (glPatch == NULL)
|
||||
glPatch = (GLPatch_t *)(patch->hardware);
|
||||
glPatch = static_cast<GLPatch_t *>(patch->hardware);
|
||||
|
||||
if (!glPatch->mipmap->downloaded && !glPatch->mipmap->data)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
#ifdef HAVE_PNG
|
||||
glPatch->mipmap->format = PNG_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
if (glPatch->mipmap->format == GL_TEXFMT_NULL)
|
||||
#endif
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
if (glPatch->mipmap->format == GL_TEXFMT_NULL)
|
||||
{
|
||||
model->noblendfile = true; // mark it so its not searched for again repeatedly
|
||||
Z_Free(filename);
|
||||
@@ -532,11 +539,11 @@ void HWR_InitMD2(void)
|
||||
|
||||
// read the mdls.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2path, "mdls.dat"), "rt");
|
||||
if (!f)
|
||||
{
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||
@@ -593,11 +600,11 @@ void HWR_AddPlayerMD2(int skin, boolean local) // For MD2's that were added afte
|
||||
|
||||
// read the mdls.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2path, "mdls.dat"), "rt");
|
||||
if (!f)
|
||||
{
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||
@@ -645,11 +652,11 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
||||
|
||||
// Read the md2.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
f = fopen(va("%s" PATHSEP "%s", srb2path, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
@@ -689,8 +696,8 @@ spritemd2found:
|
||||
|
||||
static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMipmap_t *glMipmap, INT32 skinnum, skincolors_t color)
|
||||
{
|
||||
GLPatch_t *hwrPatch = gpatch->hardware;
|
||||
GLPatch_t *hwrBlendPatch = blendgpatch->hardware;
|
||||
GLPatch_t *hwrPatch = static_cast<GLPatch_t *>(gpatch->hardware);
|
||||
GLPatch_t *hwrBlendPatch = static_cast<GLPatch_t *>(blendgpatch->hardware);
|
||||
UINT16 w = gpatch->width, h = gpatch->height;
|
||||
UINT32 size = w*h;
|
||||
RGBA_t *image, *blendimage, *cur, blendcolor;
|
||||
@@ -722,11 +729,11 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
|
||||
glMipmap->data = NULL;
|
||||
}
|
||||
|
||||
cur = Z_Malloc(size*4, PU_HWRMODELTEXTURE, &glMipmap->data);
|
||||
cur = static_cast<RGBA_t *>(Z_Malloc(size*4, PU_HWRMODELTEXTURE, &glMipmap->data));
|
||||
memset(cur, 0x00, size*4);
|
||||
|
||||
image = hwrPatch->mipmap->data;
|
||||
blendimage = hwrBlendPatch->mipmap->data;
|
||||
image = static_cast<RGBA_t *>(hwrPatch->mipmap->data);
|
||||
blendimage = static_cast<RGBA_t *>(hwrBlendPatch->mipmap->data);
|
||||
|
||||
// TC_METALSONIC includes an actual skincolor translation, on top of its flashing.
|
||||
if (skinnum == TC_METALSONIC)
|
||||
@@ -972,15 +979,15 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
|
||||
colorbright = 1; // no dividing by 0 please
|
||||
|
||||
tempcolor = (brightness * blendcolor.s.red) / colorbright;
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.red = (UINT8)tempcolor;
|
||||
|
||||
tempcolor = (brightness * blendcolor.s.green) / colorbright;
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.green = (UINT8)tempcolor;
|
||||
|
||||
tempcolor = (brightness * blendcolor.s.blue) / colorbright;
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.blue = (UINT8)tempcolor;
|
||||
cur->s.alpha = image->s.alpha;
|
||||
}
|
||||
@@ -990,15 +997,15 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
|
||||
INT32 tempcolor;
|
||||
|
||||
tempcolor = ((image->s.red * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.red * blendimage->s.alpha) / 255);
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.red = (UINT8)tempcolor;
|
||||
|
||||
tempcolor = ((image->s.green * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.green * blendimage->s.alpha) / 255);
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.green = (UINT8)tempcolor;
|
||||
|
||||
tempcolor = ((image->s.blue * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.blue * blendimage->s.alpha) / 255);
|
||||
tempcolor = min(255, tempcolor);
|
||||
tempcolor = std::min<UINT32>(255, tempcolor);
|
||||
cur->s.blue = (UINT8)tempcolor;
|
||||
cur->s.alpha = image->s.alpha;
|
||||
}
|
||||
@@ -1034,22 +1041,30 @@ skippixel:
|
||||
static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendgpatch, INT32 skinnum, const UINT8 *colormap, skincolors_t color)
|
||||
{
|
||||
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
|
||||
GLPatch_t *glPatch = patch->hardware;
|
||||
GLMipmap_t *glMipmap, *newMipmap;
|
||||
GLPatch_t *glPatch = static_cast<GLPatch_t *>(patch->hardware);
|
||||
GLMipmap_t *newMipmap;
|
||||
|
||||
|
||||
if (blendgpatch == NULL || colormap == colormaps || colormap == NULL)
|
||||
if (blendgpatch == NULL || colormap == colormaps
|
||||
|| colormap == NULL || colormap == (const UINT8*)(COLORMAP_REMAPOFFSET))
|
||||
{
|
||||
// Don't do any blending
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the Mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap; )
|
||||
// gotta make our map if theres none
|
||||
if (!glPatch->mipmap->nextcolormap)
|
||||
{
|
||||
glMipmap = glMipmap->nextcolormap;
|
||||
glPatch->mipmap->nextcolormap = new ColorMipMap();
|
||||
}
|
||||
|
||||
// search for the Mipmap
|
||||
auto& map = glPatch->mipmap->nextcolormap->map;
|
||||
auto it = map.find(colormap);
|
||||
|
||||
if (it != map.end())
|
||||
{
|
||||
GLMipmap_t *glMipmap = it->second;
|
||||
|
||||
if (glMipmap->colormap && glMipmap->colormap->source == colormap)
|
||||
{
|
||||
@@ -1077,12 +1092,14 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendgpatch, INT32 sk
|
||||
// (it have a liste of mipmap)
|
||||
// this malloc is cleared in HWR_FreeTextureCache
|
||||
// (...) unfortunately z_malloc fragment alot the memory :(so malloc is better
|
||||
newMipmap = calloc(1, sizeof (*newMipmap));
|
||||
newMipmap = static_cast<GLMipmap_t *>(calloc(1, sizeof(*newMipmap)));
|
||||
if (newMipmap == NULL)
|
||||
I_Error("%s: Out of memory", "HWR_GetBlendedTexture");
|
||||
glMipmap->nextcolormap = newMipmap;
|
||||
|
||||
newMipmap->colormap = Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
// add to nextcolormap map
|
||||
map[colormap] = newMipmap;
|
||||
|
||||
newMipmap->colormap = static_cast<GLColormap_t *>(Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL));
|
||||
newMipmap->colormap->source = colormap;
|
||||
memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
|
||||
@@ -1179,7 +1196,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
else
|
||||
blendmode = spr->mobj->blendmode;
|
||||
|
||||
blendmode = min(AST_MODULATE, blendmode);
|
||||
blendmode = std::min<INT32>(AST_MODULATE, blendmode);
|
||||
|
||||
if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
@@ -1268,7 +1285,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
}
|
||||
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->glpatch;
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
@@ -1277,12 +1294,12 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
md2_loadTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into gpatch after md2_loadtexture...
|
||||
gpatch = md2->glpatch;
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
// Load blend texture
|
||||
blendgpatch = md2->blendglpatch;
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
@@ -1292,7 +1309,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture...
|
||||
blendgpatch = md2->blendglpatch;
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
@@ -1508,7 +1525,7 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
else
|
||||
frame = 0;
|
||||
|
||||
gpatch = (patch_t *)(md2->glpatch);
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
@@ -1516,11 +1533,11 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
((!hwrPatch->mipmap->format || !hwrPatch->mipmap->downloaded) && !md2->notexturefile))
|
||||
md2_loadTexture(md2);
|
||||
|
||||
gpatch = (patch_t*)(md2->glpatch);
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
blendgpatch = (patch_t*)(md2->blendglpatch);
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
@@ -1529,7 +1546,7 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
blendgpatch = (patch_t*)(md2->blendglpatch);
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
+9
-7
@@ -496,8 +496,10 @@ static void cleanupnodes(void)
|
||||
|
||||
// Why can't I start at zero?
|
||||
for (j = 1; j < MAXNETNODES; j++)
|
||||
{
|
||||
if (!(nodeingame[j] || SV_SendingFile(j)))
|
||||
nodeconnected[j] = false;
|
||||
}
|
||||
}
|
||||
|
||||
static SINT8 getfreenode(void)
|
||||
@@ -507,11 +509,13 @@ static SINT8 getfreenode(void)
|
||||
cleanupnodes();
|
||||
|
||||
for (j = 0; j < MAXNETNODES; j++)
|
||||
{
|
||||
if (!nodeconnected[j])
|
||||
{
|
||||
nodeconnected[j] = true;
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
/** \warning No free node? Just in case a node might not have been freed properly,
|
||||
* look if there are connected nodes that aren't in game, and forget them.
|
||||
@@ -812,7 +816,7 @@ static void SOCK_Send(void)
|
||||
static void SOCK_FreeNodenum(INT32 numnode)
|
||||
{
|
||||
// can't disconnect from self :)
|
||||
if (!numnode || numnode > MAXNETNODES)
|
||||
if (numnode <= 0 || numnode > MAXNETNODES)
|
||||
return;
|
||||
|
||||
DEBFILE(va("Free node %d (%s)\n", numnode, SOCK_GetNodeAddress(numnode)));
|
||||
@@ -1432,14 +1436,12 @@ static void SOCK_RegisterHolePunch(void)
|
||||
|
||||
static boolean SOCK_OpenSocket(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
memset(clientaddress, 0, sizeof (clientaddress));
|
||||
memset(clientaddress, 0, sizeof(clientaddress));
|
||||
|
||||
memset(nodeconnected, false, sizeof(nodeconnected));
|
||||
nodeconnected[0] = true; // always connected to self
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
nodeconnected[i] = false;
|
||||
nodeconnected[BROADCASTADDR] = true;
|
||||
|
||||
I_NetSend = SOCK_Send;
|
||||
I_NetGet = SOCK_Get;
|
||||
I_NetCloseSocket = SOCK_CloseSocket;
|
||||
@@ -1479,7 +1481,7 @@ static boolean SOCK_Ban(INT32 node)
|
||||
{
|
||||
INT32 ban;
|
||||
|
||||
if (node > MAXNETNODES)
|
||||
if (node < 0 || node > MAXNETNODES)
|
||||
return false;
|
||||
|
||||
ban = numbans;
|
||||
|
||||
+67
-37
@@ -17,22 +17,65 @@
|
||||
|
||||
#include "command.h"
|
||||
#include "doomtype.h"
|
||||
#include "d_netcmd.h"
|
||||
#include "m_fixed.h"
|
||||
#include "i_system.h"
|
||||
|
||||
timestate_t g_time = {};
|
||||
|
||||
static CV_PossibleValue_t timescale_cons_t[] = {{FRACUNIT/20, "MIN"}, {20*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_timescale = {"timescale", "1.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, timescale_cons_t, NULL, FRACUNIT, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static precise_t enterprecise, oldenterprecise;
|
||||
static fixed_t entertic, oldentertics;
|
||||
static double tictimer;
|
||||
static precise_t baseprecise;
|
||||
static precise_t oldenterprecise;
|
||||
|
||||
static tic_t g_time;
|
||||
|
||||
static fixed_t I_GetTimeScale(void)
|
||||
{
|
||||
return cv_timescale.value;
|
||||
}
|
||||
|
||||
// get the current time that has passed since gamestart
|
||||
tic_t I_GetTime(void)
|
||||
{
|
||||
return g_time.time;
|
||||
const double ticratescaled = (double)TICRATE * FixedToDouble(I_GetTimeScale());
|
||||
|
||||
// stoopid gcc
|
||||
const precise_t elapsed = I_GetPreciseTime() - baseprecise;
|
||||
const UINT64 precision = I_GetPrecisePrecision();
|
||||
|
||||
// explictily do this in double precision
|
||||
const double totaltime = (double)elapsed / (double)precision;
|
||||
const double timeinticks = totaltime * ticratescaled;
|
||||
|
||||
return (tic_t)(timeinticks);
|
||||
}
|
||||
|
||||
tic_t I_GetGlobalTime(void)
|
||||
{
|
||||
return g_time;
|
||||
}
|
||||
|
||||
fixed_t I_GetTimeFrac(void)
|
||||
{
|
||||
const double ticratescaled = (double)TICRATE * FixedToDouble(I_GetTimeScale());
|
||||
|
||||
// stoopid gcc
|
||||
const precise_t elapsed = I_GetPreciseTime() - baseprecise;
|
||||
const UINT64 precision = I_GetPrecisePrecision();
|
||||
|
||||
// explictily do this in double precision
|
||||
const double totaltime = (double)elapsed / (double)precision;
|
||||
const double timeinticks = totaltime * ticratescaled;
|
||||
|
||||
double integral;
|
||||
const double fractional = modf(timeinticks, &integral);
|
||||
|
||||
fixed_t outfrac = DoubleToFixed(fractional);
|
||||
outfrac = CLAMP(outfrac, 0, FRACUNIT);
|
||||
|
||||
if (outfrac > FRACUNIT)
|
||||
outfrac = FRACUNIT;
|
||||
|
||||
return outfrac;
|
||||
}
|
||||
|
||||
void I_InitializeTime(void)
|
||||
@@ -43,45 +86,32 @@ void I_InitializeTime(void)
|
||||
// timing information for I_GetPreciseTime and sleeping
|
||||
I_StartupTimer();
|
||||
|
||||
g_time.time = 0;
|
||||
g_time.timefrac = 0;
|
||||
g_time = 0;
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
oldenterprecise = enterprecise;
|
||||
entertic = 0;
|
||||
oldentertics = 0;
|
||||
tictimer = 0.0;
|
||||
baseprecise = I_GetPreciseTime();
|
||||
oldenterprecise = baseprecise;
|
||||
}
|
||||
|
||||
void I_UpdateTime(fixed_t timescale)
|
||||
|
||||
// Used to track the time between two calls
|
||||
// uhhh pretty much just for wipes and things like that
|
||||
// probably would be better to not use a time global
|
||||
// but i dont think it really matters too much in those cases
|
||||
void I_UpdateTime(void)
|
||||
{
|
||||
double ticratescaled;
|
||||
double elapsedseconds;
|
||||
tic_t realtics;
|
||||
static tic_t oldentertics = 0;
|
||||
|
||||
// get real tics
|
||||
ticratescaled = (double)((float)TICRATE * FixedToFloat(timescale));
|
||||
const double ticratescaled = (double)TICRATE * FixedToDouble(I_GetTimeScale());
|
||||
|
||||
enterprecise = I_GetPreciseTime();
|
||||
const precise_t elapsed = enterprecise - oldenterprecise;
|
||||
const precise_t elapsed = I_GetPreciseTime() - baseprecise;
|
||||
const UINT64 precision = I_GetPrecisePrecision();
|
||||
// explictily do this in double precision
|
||||
elapsedseconds = (double)elapsed / (double)precision;
|
||||
tictimer += elapsedseconds;
|
||||
while (tictimer > 1.0/ticratescaled)
|
||||
{
|
||||
entertic += 1;
|
||||
tictimer -= 1.0/ticratescaled;
|
||||
}
|
||||
realtics = entertic - oldentertics;
|
||||
const double totaltime = (double)elapsed / (double)precision;
|
||||
const tic_t entertic = (tic_t)(totaltime * ticratescaled);
|
||||
|
||||
const tic_t realtics = entertic - oldentertics;
|
||||
oldentertics = entertic;
|
||||
oldenterprecise = enterprecise;
|
||||
|
||||
// Update global time state
|
||||
g_time.time += realtics;
|
||||
{
|
||||
double fractional, integral;
|
||||
fractional = modf(tictimer * ticratescaled, &integral);
|
||||
g_time.timefrac = DoubleToFixed(fractional);
|
||||
}
|
||||
g_time += realtics;
|
||||
}
|
||||
+5
-7
@@ -22,23 +22,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct timestate_s {
|
||||
tic_t time;
|
||||
fixed_t timefrac;
|
||||
} timestate_t;
|
||||
|
||||
extern timestate_t g_time;
|
||||
extern consvar_t cv_timescale;
|
||||
|
||||
/** \brief Called by D_SRB2Loop, returns current time in game tics.
|
||||
*/
|
||||
tic_t I_GetTime(void);
|
||||
|
||||
tic_t I_GetGlobalTime(void);
|
||||
|
||||
fixed_t I_GetTimeFrac(void);
|
||||
|
||||
/** \brief Initializes timing system.
|
||||
*/
|
||||
void I_InitializeTime(void);
|
||||
|
||||
void I_UpdateTime(fixed_t timescale);
|
||||
void I_UpdateTime(void);
|
||||
|
||||
/** \brief Block for at minimum the duration specified. This function makes a
|
||||
best effort not to oversleep, and will spinloop if sleeping would
|
||||
|
||||
@@ -95,6 +95,7 @@ INT32 VID_SetMode(INT32 modenum);
|
||||
*/
|
||||
const char *VID_GetModeName(INT32 modenum);
|
||||
|
||||
void VID_RefreshModeList(void);
|
||||
void VID_PrepareModeList(void);
|
||||
|
||||
/** \brief can video system do fullscreen
|
||||
@@ -121,10 +122,13 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale);
|
||||
|
||||
UINT32 I_GetRefreshRate(void);
|
||||
|
||||
boolean I_CheckAboveDesktopRes(INT32 width, INT32 height);
|
||||
boolean I_CheckNativeRes(void);
|
||||
|
||||
void I_SetBorderlessWindow(void);
|
||||
|
||||
void I_HandleControllerHatRepeat(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
#define LZF_H
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
**
|
||||
** lzf -- an extremely fast/free compression/decompression-method
|
||||
@@ -71,5 +75,9 @@ size_t
|
||||
lzf_decompress (const void *const in_data, size_t in_len,
|
||||
void *out_data, size_t out_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+50
-55
@@ -308,7 +308,6 @@ static void M_SetupMultiHandler(INT32 choice);
|
||||
|
||||
// Options
|
||||
// Split into multiple parts due to size
|
||||
static void M_VideoModeMenu(INT32 choice);
|
||||
static void M_Setup1PControlsMenu(void);
|
||||
static void M_Setup2PControlsMenu(void);
|
||||
static void M_Setup3PControlsMenu(void);
|
||||
@@ -9737,14 +9736,11 @@ static void M_ResetControls(INT32 choice)
|
||||
// ===============
|
||||
|
||||
//added : 30-01-98:
|
||||
#define MAXCOLUMNMODES 12 //max modes displayed in one column
|
||||
#define MAXMODEDESCS (MAXCOLUMNMODES*3)
|
||||
|
||||
static modedesc_t modedescs[MAXMODEDESCS];
|
||||
|
||||
static void M_VideoModeMenu(INT32 choice)
|
||||
void M_VideoModeMenu(INT32 choice)
|
||||
{
|
||||
INT32 i, j, vdup, nummodes, width, height;
|
||||
INT32 i, nummodes, width, height;
|
||||
const char *desc;
|
||||
|
||||
(void)choice;
|
||||
@@ -9758,54 +9754,30 @@ static void M_VideoModeMenu(INT32 choice)
|
||||
nummodes = VID_NumModes();
|
||||
|
||||
// DOS does not skip mode 0, because mode 0 is ALWAYS present
|
||||
i = 0;
|
||||
for (; i < nummodes && vidm_nummodes < MAXMODEDESCS; i++)
|
||||
for (i = 0; i < nummodes && vidm_nummodes < MAXMODEDESCS; i++)
|
||||
{
|
||||
desc = VID_GetModeName(i);
|
||||
if (desc)
|
||||
{
|
||||
vdup = 0;
|
||||
|
||||
// when a resolution exists both under VGA and VESA, keep the
|
||||
// VESA mode, which is always a higher modenum
|
||||
for (j = 0; j < vidm_nummodes; j++)
|
||||
{
|
||||
if (fastcmp(modedescs[j].desc, desc))
|
||||
{
|
||||
// mode(0): 320x200 is always standard VGA, not vesa
|
||||
if (modedescs[j].modenum)
|
||||
{
|
||||
modedescs[j].modenum = i;
|
||||
vdup = 1;
|
||||
if (!desc)
|
||||
continue;
|
||||
|
||||
if (i == vid.modenum)
|
||||
vidm_selected = j;
|
||||
}
|
||||
else
|
||||
vdup = 1;
|
||||
modedescs[vidm_nummodes].modenum = i;
|
||||
modedescs[vidm_nummodes].desc = desc;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == vid.modenum)
|
||||
vidm_selected = vidm_nummodes;
|
||||
|
||||
if (!vdup)
|
||||
{
|
||||
modedescs[vidm_nummodes].modenum = i;
|
||||
modedescs[vidm_nummodes].desc = desc;
|
||||
// Pull out the width and height
|
||||
sscanf(desc, "%u%*c%u", &width, &height);
|
||||
|
||||
if (i == vid.modenum)
|
||||
vidm_selected = vidm_nummodes;
|
||||
// Show resolutions above desktop res as red.
|
||||
if (I_CheckAboveDesktopRes(width, height))
|
||||
modedescs[vidm_nummodes].goodratio = 2;
|
||||
// Show multiples of 320x200 as green.
|
||||
else if (SCR_IsAspectCorrect(width, height))
|
||||
modedescs[vidm_nummodes].goodratio = 1;
|
||||
|
||||
// Pull out the width and height
|
||||
sscanf(desc, "%u%*c%u", &width, &height);
|
||||
|
||||
// Show multiples of 320x200 as green.
|
||||
if (SCR_IsAspectCorrect(width, height))
|
||||
modedescs[vidm_nummodes].goodratio = 1;
|
||||
|
||||
vidm_nummodes++;
|
||||
}
|
||||
}
|
||||
vidm_nummodes++;
|
||||
}
|
||||
|
||||
vidm_column_size = (vidm_nummodes+2) / 3;
|
||||
@@ -10022,7 +9994,11 @@ static void M_DrawVideoMode(void)
|
||||
V_DrawString(row, col, highlightflags|MENUCAPS, modedescs[i].desc);
|
||||
// Show multiples of 320x200 as green.
|
||||
else
|
||||
V_DrawString(row, col, ((modedescs[i].goodratio) ? recommendedflags : 0)|MENUCAPS, modedescs[i].desc);
|
||||
{
|
||||
const UINT8 goodratio = modedescs[i].goodratio;
|
||||
const INT32 goodflag = ((goodratio == 2) ? warningflags : (goodratio == 1) ? recommendedflags : 0);
|
||||
V_DrawString(row, col, goodflag|MENUCAPS, modedescs[i].desc);
|
||||
}
|
||||
|
||||
col += 8;
|
||||
if ((i % vidm_column_size) == (vidm_column_size-1))
|
||||
@@ -10046,7 +10022,6 @@ static void M_DrawVideoMode(void)
|
||||
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
|
||||
M_CentreText(OP_VideoModeDef.y + 158,
|
||||
"or press ESC to return");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -10062,9 +10037,26 @@ static void M_DrawVideoMode(void)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 138,
|
||||
recommendedflags|MENUCAPS, "Marked modes are recommended.");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 146,
|
||||
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 158,
|
||||
highlightflags|MENUCAPS, "Larger modes may have performance issues.");
|
||||
warningflags|MENUCAPS, "Marked modes are above Desktop resolution");
|
||||
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
#ifdef USE_FBO_OGL
|
||||
if (!cv_glframebuffer.value)
|
||||
#endif
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 154,
|
||||
warningflags|MENUCAPS, "and will have visual errors in OpenGL mode.");
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 166,
|
||||
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 154,
|
||||
highlightflags|MENUCAPS, "Other modes may have visual errors.");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 166,
|
||||
highlightflags|MENUCAPS, "Larger modes may have performance issues.");
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the cursor for the VidMode menu
|
||||
@@ -10609,17 +10601,20 @@ void M_QuitResponse(INT32 ch)
|
||||
if (!(netgame || cv_debug))
|
||||
{
|
||||
mrand = M_RandomKey(sizeof(quitsounds)/sizeof(INT32));
|
||||
if (quitsounds[mrand]) S_StartSound(NULL, quitsounds[mrand]);
|
||||
|
||||
if (quitsounds[mrand])
|
||||
S_StartSound(NULL, quitsounds[mrand]);
|
||||
|
||||
//added : 12-02-98: do that instead of I_WaitVbl which does not work
|
||||
ptime = I_GetTime() + NEWTICRATE*2; // Shortened the quit time, used to be 2 seconds Tails 03-26-2001
|
||||
while (ptime > I_GetTime())
|
||||
ptime = I_GetGlobalTime() + NEWTICRATE*2; // Shortened the quit time, used to be 2 seconds Tails 03-26-2001
|
||||
|
||||
while (ptime > I_GetGlobalTime())
|
||||
{
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
V_DrawSmallScaledPatch(0, 0, 0, (patch_t *)W_CachePatchName("GAMEQUIT", PU_PATCH)); // Demo 3 Quit Screen Tails 06-16-2001
|
||||
I_FinishUpdate(); // Update the screen with the image Tails 06-19-2001
|
||||
I_Sleep(cv_sleep.value);
|
||||
I_UpdateTime(cv_timescale.value);
|
||||
I_UpdateTime();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -223,6 +223,11 @@ extern menu_t *currentMenu;
|
||||
extern menu_t MainDef;
|
||||
extern menu_t SP_LoadDef;
|
||||
|
||||
#define MAXCOLUMNMODES 12 //max modes displayed in one column
|
||||
#define MAXMODEDESCS (MAXCOLUMNMODES*3)
|
||||
extern menu_t OP_VideoModeDef;
|
||||
void M_VideoModeMenu(INT32 choice);
|
||||
|
||||
// Call upon joystick hotplug
|
||||
void M_SetupJoystickMenu(INT32 choice);
|
||||
extern menu_t OP_JoystickSetDef;
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#ifndef _MD5_H
|
||||
#define _MD5_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined (HAVE_LIMITS_H) || (defined (_LIBC) && _LIBC) || defined (_WIN32)
|
||||
@@ -52,4 +56,8 @@ int md5_stream(FILE *stream, void *resblock) THROWFUNC;
|
||||
digest. */
|
||||
extern void *md5_buffer(const char *buffer, size_t len, void *resblock) THROWFUNC;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* md5.h */
|
||||
Loaded 100 of 109 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user