diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 06a4fa8d0..f9484aef5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -746,7 +746,6 @@ set( NOT_COMPILED_SOURCE_FILES games/blood/src/prediction.cpp games/blood/src/preload.cpp games/blood/src/qav.cpp - games/blood/src/replace.cpp games/blood/src/sbar.cpp games/blood/src/sectorfx.cpp games/blood/src/seq.cpp diff --git a/source/common/models/model.cpp b/source/common/models/model.cpp index f167180e7..e8826d5b8 100644 --- a/source/common/models/model.cpp +++ b/source/common/models/model.cpp @@ -6,7 +6,7 @@ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or +// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, diff --git a/source/common/models/models_md2.cpp b/source/common/models/models_md2.cpp index 7e75a208e..17cde4548 100644 --- a/source/common/models/models_md2.cpp +++ b/source/common/models/models_md2.cpp @@ -6,7 +6,7 @@ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or +// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, diff --git a/source/common/models/models_md3.cpp b/source/common/models/models_md3.cpp index 4ecfb4903..202ccf8d1 100644 --- a/source/common/models/models_md3.cpp +++ b/source/common/models/models_md3.cpp @@ -6,7 +6,7 @@ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or +// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, diff --git a/source/common/models/models_voxel.cpp b/source/common/models/models_voxel.cpp index e09ef4689..e0036d6da 100644 --- a/source/common/models/models_voxel.cpp +++ b/source/common/models/models_voxel.cpp @@ -6,7 +6,7 @@ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or +// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, diff --git a/source/common/rendering/gles/gles_shader.h b/source/common/rendering/gles/gles_shader.h index 8ab25ddb1..88e94dc26 100644 --- a/source/common/rendering/gles/gles_shader.h +++ b/source/common/rendering/gles/gles_shader.h @@ -481,7 +481,10 @@ public: { return mMaterialShaders[eff]; } - return NULL; + else // This can happen if we try and active a user shader which is not loaded, so return default shader so it does not crash + { + return mMaterialShaders[0]; + } } }; diff --git a/source/common/textures/formats/multipatchtexture.h b/source/common/textures/formats/multipatchtexture.h index 48223ec5e..c8cb16f24 100644 --- a/source/common/textures/formats/multipatchtexture.h +++ b/source/common/textures/formats/multipatchtexture.h @@ -120,6 +120,7 @@ struct BuildInfo bool bComplex = false; bool textual = false; bool bNoDecals = false; + bool bNoTrim = false; int LeftOffset[2] = {}; int TopOffset[2] = {}; FGameTexture *texture = nullptr; diff --git a/source/common/textures/gametexture.h b/source/common/textures/gametexture.h index 051d4f710..a9e516ae4 100644 --- a/source/common/textures/gametexture.h +++ b/source/common/textures/gametexture.h @@ -59,6 +59,7 @@ enum EGameTexFlags GTexf_BrightmapChecked = 128, // Check for a colormap-based brightmap was already done. GTexf_AutoMaterialsAdded = 256, // AddAutoMaterials has been called on this texture. GTexf_OffsetsNotForFont = 512, // The offsets must be ignored when using this texture in a font. + GTexf_NoTrim = 1024, // Don't perform trimming on this texture. }; // Refactoring helper to allow piece by piece adjustment of the API @@ -159,6 +160,8 @@ public: bool expandSprites() { return expandSprite == -1? ShouldExpandSprite() : !!expandSprite; } bool useWorldPanning() const { return !!(flags & GTexf_WorldPanning); } void SetWorldPanning(bool on) { if (on) flags |= GTexf_WorldPanning; else flags &= ~GTexf_WorldPanning; } + void SetNoTrimming(bool on) { if (on) flags |= GTexf_NoTrim; else flags &= ~GTexf_NoTrim; } + bool GetNoTrimming() { return !!(flags & GTexf_NoTrim); } bool allowNoDecals() const { return !!(flags & GTexf_NoDecals); } void SetNoDecals(bool on) { if (on) flags |= GTexf_NoDecals; else flags &= ~GTexf_NoDecals; } void SetOffsetsNotForFont() { flags |= GTexf_OffsetsNotForFont; } diff --git a/source/common/textures/multipatchtexturebuilder.cpp b/source/common/textures/multipatchtexturebuilder.cpp index 7cf998ae8..f7684c6ce 100644 --- a/source/common/textures/multipatchtexturebuilder.cpp +++ b/source/common/textures/multipatchtexturebuilder.cpp @@ -144,6 +144,7 @@ void FMultipatchTextureBuilder::MakeTexture(BuildInfo &buildinfo, ETextureType u buildinfo.texture->SetScale((float)buildinfo.Scale.X, (float)buildinfo.Scale.Y); buildinfo.texture->SetWorldPanning(buildinfo.bWorldPanning); buildinfo.texture->SetNoDecals(buildinfo.bNoDecals); + buildinfo.texture->SetNoTrimming(buildinfo.bNoTrim); TexMan.AddGameTexture(buildinfo.texture); } @@ -669,6 +670,10 @@ void FMultipatchTextureBuilder::ParseTexture(FScanner &sc, ETextureType UseType, { buildinfo.bNoDecals = true; } + else if (sc.Compare("NoTrim")) + { + buildinfo.bNoTrim = true; + } else if (sc.Compare("Patch")) { TexPartBuild part; diff --git a/source/common/textures/texturemanager.cpp b/source/common/textures/texturemanager.cpp index c8d843a9c..5d49c7a9a 100644 --- a/source/common/textures/texturemanager.cpp +++ b/source/common/textures/texturemanager.cpp @@ -811,6 +811,22 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build } //else Printf("Unable to define hires texture '%s'\n", tex->Name); } + else if (sc.Compare("notrim")) + { + sc.MustGetString(); + + FTextureID id = TexMan.CheckForTexture(sc.String, ETextureType::Sprite); + if (id.isValid()) + { + FGameTexture *tex = TexMan.GetGameTexture(id); + + if (tex) tex->SetNoTrimming(true); + else sc.ScriptError("NoTrim: %s not found", sc.String); + } + else + sc.ScriptError("NoTrim: %s is not a sprite", sc.String); + + } else if (sc.Compare("texture")) { build.ParseTexture(sc, ETextureType::Override, lump); diff --git a/source/common/utility/cmdlib.cpp b/source/common/utility/cmdlib.cpp index cfde4ebff..e47610cf6 100644 --- a/source/common/utility/cmdlib.cpp +++ b/source/common/utility/cmdlib.cpp @@ -248,7 +248,7 @@ bool GetFileInfo(const char* pathname, size_t *size, time_t *time) bool res = _wstat64(wstr.c_str(), &info) == 0; #endif if (!res || (info.st_mode & S_IFDIR)) return false; - if (size) *size = info.st_size; + if (size) *size = (size_t)info.st_size; if (time) *time = info.st_mtime; return res; } diff --git a/source/core/rendering/hw_entrypoint.cpp b/source/core/rendering/hw_entrypoint.cpp index 7381b1898..7093285c3 100644 --- a/source/core/rendering/hw_entrypoint.cpp +++ b/source/core/rendering/hw_entrypoint.cpp @@ -6,7 +6,7 @@ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or +// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful,