Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ZDoom/gzdoom into gzd-mas…
Browse files Browse the repository at this point in the history
…ter-experimental
  • Loading branch information
nashmuhandes committed Jan 22, 2025
2 parents 3f761bc + 7b30f93 commit e334b78
Show file tree
Hide file tree
Showing 118 changed files with 1,757 additions and 1,700 deletions.
47 changes: 40 additions & 7 deletions docs/licenses/dumb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/


Dynamic Universal Music Bibliotheque
Dynamic Universal Music Bibliotheque, Version 0.9.3

Copyright (C) 2001-2003 Ben Davis, Robert J Ohannessian and Julien Cugniere
Copyright (C) 2001-2005 Ben Davis, Robert J Ohannessian and Julien Cugniere

This software is provided 'as-is', without any express or implied warranty.
In no event shall the authors be held liable for any damages arising from the
Expand All @@ -39,16 +39,49 @@ freely, subject to the following restrictions:
[Note that the above point asks for a link to DUMB, not just a mention.
Googling for DUMB doesn't help much! The URL is "http://dumb.sf.net/".]

[The only reason why the link is not strictly required is that such a
requirement prevents DUMB from being used in projects with certain other
licences, notably the GPL. See http://www.gnu.org/philosophy/bsd.html .]
[The link was originally strictly required. This was changed for two
reasons. Firstly, if many projects request an acknowledgement, the list of
acknowledgements can become quite unmanageable. Secondly, DUMB was placing
a restriction on the code using it, preventing people from using the GNU
General Public Licence which disallows any such restrictions. See
http://www.gnu.org/philosophy/bsd.html for more information on this
subject. However, if DUMB plays a significant part in your project, we do
urge you to acknowledge its use.]

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 from or altered in any source distribution.

4. If you are using the Program in someone else's bedroom at any Monday
3:05 PM, you are not allowed to modify the Program for ten minutes. [This
4. If you are using the Program in someone else's bedroom on any Monday at
3:05 pm, you are not allowed to modify the Program for ten minutes. [This
clause provided by Inphernic; every licence should contain at least one
clause, the reasoning behind which is far from obvious.]

5. Users who wish to use DUMB for the specific purpose of playing music are
required to feed their dog on every full moon (if deemed appropriate).
[This clause provided by Allefant, who couldn't remember what Inphernic's
clause was.]

6. No clause in this licence shall prevent this software from being depended
upon by a product licensed under the GNU General Public Licence. If such a
clause is deemed to exist, Debian, then it shall be respected in spirit as
far as possible and all other clauses shall continue to apply in full
force.

8. Take the number stated as introducing this clause. Multiply it by two,
then subtract four. Now insert a '+' between the two digits and evaluate
the resulting sum. Call the result 'x'. If you have not yet concluded that
every numbered clause in this licence whose ordinal number is strictly
greater than 'x' (with the exception of the present clause) is null and
void, Debian, then you are hereby informed that laughter is good for one's
health and you are warmly suggested to do it. By the way, Clauses 4, 5 and
6 are null and void. Incidentally, I like Kubuntu. The work you guys do is
awesome. (Lawyers, on the other hand ...)

We regret that we cannot provide any warranty, not even the implied warranty
of merchantability or fitness for a particular purpose.

Some files generated or copied by automake, autoconf and friends are
available in an extra download. These fall under separate licences but are
all free to distribute. Please check their licences as necessary.
27 changes: 14 additions & 13 deletions specs/udmf_zdoom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ Note: All <bool> fields default to false unless mentioned otherwise.
For lines with ACS specials (80-86 and 226), if arg0str is present and non-null, it
will be used as the name of the script to execute, and arg0 will be ignored.

lm_sampledist = <int>; // ZDRay customizable sampling distance for this line. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_top = <int>; // ZDRay customizable sampling distance for this line's top part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_mid = <int>; // ZDRay customizable sampling distance for this line's middle part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_bot = <int>; // ZDRay customizable sampling distance for this line's bottom part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist = <int>; // ZDRay customizable sampling distance for this line. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_top = <int>; // ZDRay customizable sampling distance for this line's top part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_mid = <int>; // ZDRay customizable sampling distance for this line's middle part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_bot = <int>; // ZDRay customizable sampling distance for this line's bottom part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
}

sidedef
Expand Down Expand Up @@ -231,10 +231,10 @@ Note: All <bool> fields default to false unless mentioned otherwise.
colorization_mid = <int>; // Sets a colorization record for the middle texture. Colorization records must be defined in TEXTURES.
colorization_bottom = <int>; // Sets a colorization record for the lower texture. Colorization records must be defined in TEXTURES.

lm_sampledist = <int>; // ZDRay customizable sampling distance for this sidedef. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_top = <int>; // ZDRay customizable sampling distance for this sidedef's top part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_mid = <int>; // ZDRay customizable sampling distance for this sidedef's middle part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_bot = <int>; // ZDRay customizable sampling distance for this sidedef's bottom part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist = <int>; // ZDRay customizable sampling distance for this sidedef. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_top = <int>; // ZDRay customizable sampling distance for this sidedef's top part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_mid = <int>; // ZDRay customizable sampling distance for this sidedef's middle part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_bot = <int>; // ZDRay customizable sampling distance for this sidedef's bottom part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.

skew_top = <int>; // enables skewing of wall textures, the skewing angle will be aligned to one of the 4 planes touching the floor.
skew_middle = <int>; // Vertical texture alignment defines the position at the leftmost point of the wall.
Expand Down Expand Up @@ -390,9 +390,9 @@ Note: All <bool> fields default to false unless mentioned otherwise.
for Doom format maps so any map converter converting to the ZDoomTranslated namespace should
set this flag for each tagged sector.

lm_sampledist_floor = <int>; // ZDRay customizable sampling distance for this sector's floor. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_sampledist_ceiling = <int>; // ZDRay customizable sampling distance for this sector's ceiling. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
lm_dynamic = <bool>; // ZDRay marks a sector's lightmaps as dynamic so that they may be updated in realtime (used for flickering lights, changing a lightmap light's position, color etc). Default = false
lm_sampledist_floor = <int>; // ZDRay customizable sampling distance for this sector's floor. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_sampledist_ceiling = <int>; // ZDRay customizable sampling distance for this sector's ceiling. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0.
lm_dynamic = <bool>; // ZDRay marks a sector's lightmaps as dynamic so that they may be updated in realtime (used for flickering lights, changing a lightmap light's position, color etc). Default = false.
}

thing
Expand Down Expand Up @@ -425,10 +425,11 @@ Note: All <bool> fields default to false unless mentioned otherwise.
scale = <float>; // Vertical and horizontal scaling on thing. Default = 0 (ignored).
floatbobphase = <int>; // Sets the thing's floatbobphase. Valid phase values are 0-63. Default = -1 (use actor class default).

lm_sampledist = <int>; // ZDRay lightmap sample distance for the entire map. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 8
lm_sampledist = <int>; // ZDRay lightmap sample distance for the entire map. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 8.
lm_suncolor = <int>; // ZDRay lightmap sun color. Default is white (0xFFFFFF).
lm_sunintensity = <float>; // ZDRay lightmap sun intensity multiplier. Default = 1.0.

light_softshadowradius = <float>; // ZDRay lightmap light and raytraced dynamic light soft shadow amount. Higher values produce softer shadows. Default = 5.0
light_softshadowradius = <float>; // ZDRay lightmap light and raytraced dynamic light soft shadow amount. Higher values produce softer shadows. Default = 5.0.

light_strength = <float>; // Light strenght for Inverse-square falloff lights. Default = 0.0 (auto)

Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ set (PCH_SOURCES
common/engine/cycler.cpp
common/engine/d_event.cpp
common/engine/date.cpp
common/engine/filesys_doom.cpp
common/engine/stats.cpp
common/engine/sc_man.cpp
common/engine/palettecontainer.cpp
Expand Down Expand Up @@ -1198,7 +1197,6 @@ set( GAME_SOURCES
common/filesystem/source/file_whres.cpp
common/filesystem/source/file_ssi.cpp
common/filesystem/source/file_hog.cpp
common/filesystem/source/file_hog2.cpp
common/filesystem/source/file_mvl.cpp
common/filesystem/source/file_directory.cpp
common/filesystem/source/resourcefile.cpp
Expand Down
11 changes: 9 additions & 2 deletions src/am_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static void AM_ParseArrow(TArray<mline_t> &Arrow, const char *lumpname)
{
const int R = int((8 * PLAYERRADIUS) / 7);
FScanner sc;
int lump = fileSystem.CheckNumForAnyName(lumpname);
int lump = fileSystem.CheckNumForFullName(lumpname, true);
if (lump >= 0)
{
sc.OpenLumpNum(lump);
Expand Down Expand Up @@ -2916,11 +2916,18 @@ void DAutomap::drawKeys ()
mpoint_t p;
DAngle angle;

auto it = Level->GetThinkerIterator<AActor>(NAME_Key);
auto it = Level->GetThinkerIterator<AActor>(NAME_Inventory);
AActor *key;

while ((key = it.Next()) != nullptr)
{
auto cls = key->GetClass();
if (cls->IsDescendantOf(NAME_DehackedPickup))
{
cls = cls->ActorInfo()->Replacee;
}
if (!cls->IsDescendantOf(NAME_Key)) continue;

DVector3 pos = key->PosRelative(MapPortalGroup);
p.x = pos.X;
p.y = pos.Y;
Expand Down
7 changes: 5 additions & 2 deletions src/common/audio/music/i_music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
#include "s_music.h"
#include "filereadermusicinterface.h"

using namespace FileSys;


void I_InitSoundFonts();

EXTERN_CVAR (Int, snd_samplerate)
Expand Down Expand Up @@ -185,7 +188,7 @@ static void SetupGenMidi()

static void SetupWgOpn()
{
int lump = fileSystem.FindFile("xg.wopn");
int lump = fileSystem.CheckNumForFullName("xg.wopn");
if (lump < 0)
{
return;
Expand Down Expand Up @@ -310,7 +313,7 @@ static ZMusic_MidiSource GetMIDISource(const char *fn)
if (src.Compare("*") == 0) src = mus_playing.name;

auto lump = fileSystem.CheckNumForName(src.GetChars(), ns_music);
if (lump < 0) lump = fileSystem.FindFile(src.GetChars());
if (lump < 0) lump = fileSystem.CheckNumForFullName(src.GetChars());
if (lump < 0)
{
Printf("Cannot find MIDI lump %s.\n", src.GetChars());
Expand Down
8 changes: 4 additions & 4 deletions src/common/audio/music/i_soundfont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ FileReader FPatchSetReader::OpenFile(const char *name)

FLumpPatchSetReader::FLumpPatchSetReader(const char *filename)
{
mLumpIndex = fileSystem.FindFile(filename);
mLumpIndex = fileSystem.CheckNumForFullName(filename);

mBasePath = filename;
FixPathSeperator(mBasePath);
Expand All @@ -314,9 +314,9 @@ FileReader FLumpPatchSetReader::OpenMainConfigFile()
FileReader FLumpPatchSetReader::OpenFile(const char *name)
{
FString path;
if (IsAbsPath(name)) return FileReader(); // no absolute paths in the virtual file system.
if (IsAbsPath(name)) return FileReader(); // no absolute paths in the lump directory.
path = mBasePath + name;
auto index = fileSystem.FindFile(path.GetChars());
auto index = fileSystem.CheckNumForFullName(path.GetChars());
if (index < 0) return FileReader();
return fileSystem.ReopenFileReader(index);
}
Expand Down Expand Up @@ -472,7 +472,7 @@ FSoundFontReader *FSoundFontManager::OpenSoundFont(const char *const name, int a
// To avoid clashes this will only be done if the name has the '.cfg' extension.
// Sound fonts cannot be loaded this way.
const char *p = name + strlen(name) - 4;
if (p > name && !stricmp(p, ".cfg") && fileSystem.FindFile(name) >= 0)
if (p > name && !stricmp(p, ".cfg") && fileSystem.CheckNumForFullName(name) >= 0)
{
return new FLumpPatchSetReader(name);
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/audio/music/music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static FileReader OpenMusic(const char* musicname)
{
int lumpnum;
lumpnum = mus_cb.FindMusic(musicname);
if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, ns_music);
if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, FileSys::ns_music);
if (lumpnum == -1)
{
Printf("Music \"%s\" not found\n", musicname);
Expand Down Expand Up @@ -143,7 +143,7 @@ bool MusicExists(const char* music_name)
{
int lumpnum;
lumpnum = mus_cb.FindMusic(music_name);
if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(music_name, ns_music);
if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(music_name, FileSys::ns_music);
if (lumpnum != -1 && fileSystem.FileLength(lumpnum) != 0)
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions src/common/console/c_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,15 +730,15 @@ void ReadBindings(int lump, bool override)

void C_SetDefaultKeys(const char* baseconfig)
{
auto lump = fileSystem.FindFile("engine/commonbinds.txt");
auto lump = fileSystem.CheckNumForFullName("engine/commonbinds.txt");
if (lump >= 0)
{
// Bail out if a mod tries to override this. Main game resources are allowed to do this, though.
auto fileno2 = fileSystem.GetFileContainer(lump);
if (fileno2 > fileSystem.GetMaxBaseNum())
if (fileno2 > fileSystem.GetMaxIwadNum())
{
I_FatalError("File %s is overriding core lump %s.",
fileSystem.GetContainerFullName(fileno2), "engine/commonbinds.txt");
fileSystem.GetResourceFileFullName(fileno2), "engine/commonbinds.txt");
}

ReadBindings(lump, true);
Expand All @@ -748,7 +748,7 @@ void C_SetDefaultKeys(const char* baseconfig)
while ((lump = fileSystem.FindLumpFullName(baseconfig, &lastlump)) != -1)
{
// Read this only from the main game resources.
if (fileSystem.GetFileContainer(lump) <= fileSystem.GetMaxBaseNum())
if (fileSystem.GetFileContainer(lump) <= fileSystem.GetMaxIwadNum())
ReadBindings(lump, true);
}

Expand All @@ -758,7 +758,7 @@ void C_SetDefaultKeys(const char* baseconfig)
// [SW] - We need to check to see the origin of the DEFBINDS... if it
// Comes from an IWAD/IPK3/IPK7 allow it to override the users settings...
// If it comes from a user mod however, don't.
if (fileSystem.GetFileContainer(lump) > fileSystem.GetMaxBaseNum())
if (fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum())
ReadBindings(lump, false);
else
ReadBindings(lump, true);
Expand Down
6 changes: 3 additions & 3 deletions src/common/console/c_enginecmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ CCMD (wdir)
if (argv.argc() != 2) wadnum = -1;
else
{
wadnum = fileSystem.CheckIfContainerLoaded (argv[1]);
wadnum = fileSystem.CheckIfResourceFileLoaded (argv[1]);
if (wadnum < 0)
{
Printf ("%s must be loaded to view its directory.\n", argv[1]);
return;
}
}
for (int i = 0; i < fileSystem.GetFileCount(); ++i)
for (int i = 0; i < fileSystem.GetNumEntries(); ++i)
{
if (wadnum == -1 || fileSystem.GetFileContainer(i) == wadnum)
{
Printf ("%10ld %s\n", fileSystem.FileLength(i), fileSystem.GetFileName(i));
Printf ("%10ld %s\n", fileSystem.FileLength(i), fileSystem.GetFileFullName(i));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/cutscenes/movieplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class VpxPlayer : public MoviePlayer
}
if (!MusicStream)
{
Printf(PRINT_BOLD, "Failed to decode %s\n", fileSystem.GetFileName(soundtrack));
Printf(PRINT_BOLD, "Failed to decode %s\n", fileSystem.GetFileFullName(soundtrack, false));
}
}
animtex.SetSize(AnimTexture::VPX, width, height);
Expand Down
Loading

0 comments on commit e334b78

Please sign in to comment.