diff --git a/src/rendering/gl/renderer/gl_postprocess.cpp b/src/rendering/gl/renderer/gl_postprocess.cpp index 4c4025df5a..b0dfe1c3e9 100644 --- a/src/rendering/gl/renderer/gl_postprocess.cpp +++ b/src/rendering/gl/renderer/gl_postprocess.cpp @@ -21,22 +21,20 @@ #include "gl_system.h" #include "m_png.h" -#include "r_utility.h" #include "gl/system/gl_buffers.h" #include "gl/system/gl_framebuffer.h" -#include "hwrenderer/utility/hw_cvars.h" #include "gl/system/gl_debug.h" -#include "gl/renderer/gl_renderstate.h" #include "gl/renderer/gl_renderbuffers.h" #include "gl/renderer/gl_renderer.h" #include "gl/renderer/gl_postprocessstate.h" #include "gl/shaders/gl_shaderprogram.h" #include "hwrenderer/postprocessing/hw_postprocess.h" #include "hwrenderer/postprocessing/hw_postprocess_cvars.h" -#include "hw_vrmodes.h" #include "hwrenderer/data/flatvertices.h" -#include "gl/textures/gl_hwtexture.h" #include "r_videoscale.h" +#include "v_video.h" +#include "templates.h" +#include "hw_vrmodes.h" extern bool vid_hdr_active; diff --git a/src/rendering/gl/renderer/gl_postprocessstate.h b/src/rendering/gl/renderer/gl_postprocessstate.h index c5a89445b7..b21e73840d 100644 --- a/src/rendering/gl/renderer/gl_postprocessstate.h +++ b/src/rendering/gl/renderer/gl_postprocessstate.h @@ -5,7 +5,6 @@ #include "gl_interface.h" #include "matrix.h" #include "c_cvars.h" -#include "r_defs.h" namespace OpenGLRenderer { diff --git a/src/rendering/gl/renderer/gl_renderbuffers.cpp b/src/rendering/gl/renderer/gl_renderbuffers.cpp index 6953fd9eee..319cf12789 100644 --- a/src/rendering/gl/renderer/gl_renderbuffers.cpp +++ b/src/rendering/gl/renderer/gl_renderbuffers.cpp @@ -22,6 +22,7 @@ #include "gl_system.h" #include "v_video.h" #include "gl_interface.h" +#include "printf.h" #include "hwrenderer/utility/hw_cvars.h" #include "gl/system/gl_debug.h" #include "gl/renderer/gl_renderer.h" @@ -29,8 +30,10 @@ #include "gl/renderer/gl_postprocessstate.h" #include "gl/shaders/gl_shaderprogram.h" #include "gl/system/gl_buffers.h" +#include "templates.h" #include +EXTERN_CVAR(Int, gl_debug_level) CVAR(Int, gl_multisample, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); namespace OpenGLRenderer diff --git a/src/rendering/gl/renderer/gl_renderbuffers.h b/src/rendering/gl/renderer/gl_renderbuffers.h index 4e1fd977c3..da967f021e 100644 --- a/src/rendering/gl/renderer/gl_renderbuffers.h +++ b/src/rendering/gl/renderer/gl_renderbuffers.h @@ -1,7 +1,6 @@ #pragma once -#include "gl/shaders/gl_shader.h" #include "hwrenderer/postprocessing/hw_postprocess.h" namespace OpenGLRenderer diff --git a/src/rendering/gl/renderer/gl_renderer.h b/src/rendering/gl/renderer/gl_renderer.h index 5b61d7aa8f..ab260563dc 100644 --- a/src/rendering/gl/renderer/gl_renderer.h +++ b/src/rendering/gl/renderer/gl_renderer.h @@ -19,7 +19,6 @@ struct particle_t; class FCanvasTexture; class FFlatVertexBuffer; class FSkyVertexBuffer; -class FShaderManager; class HWPortal; class FLightBuffer; class DPSprite; @@ -32,6 +31,7 @@ struct FRenderViewpoint; namespace OpenGLRenderer { + class FShaderManager; class FSamplerManager; class OpenGLFrameBuffer; class FPresentShaderBase; diff --git a/src/rendering/gl/shaders/gl_shader.cpp b/src/rendering/gl/shaders/gl_shader.cpp index 8487c29818..5dac1332e2 100644 --- a/src/rendering/gl/shaders/gl_shader.cpp +++ b/src/rendering/gl/shaders/gl_shader.cpp @@ -34,6 +34,7 @@ #include "cmdlib.h" #include "md5.h" #include "m_misc.h" +#include "gl/shaders/gl_shader.h" #include "hwrenderer/utility/hw_shaderpatcher.h" #include "hwrenderer/data/shaderuniforms.h" #include "hwrenderer/scene/hw_viewpointuniforms.h" diff --git a/src/rendering/hwrenderer/data/hw_vertexbuilder.h b/src/rendering/hwrenderer/data/hw_vertexbuilder.h index 8ab7d21d86..e13e5e7aff 100644 --- a/src/rendering/hwrenderer/data/hw_vertexbuilder.h +++ b/src/rendering/hwrenderer/data/hw_vertexbuilder.h @@ -1,5 +1,6 @@ #include "tarray.h" +#include "r_defs.h" struct vertex_t; struct FQualifiedVertex diff --git a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp index 2df708ca91..2d07869a57 100644 --- a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp @@ -48,6 +48,7 @@ EXTERN_CVAR(Float, r_visibility) CVAR(Bool, gl_bandedswlight, false, CVAR_ARCHIVE) CVAR(Bool, gl_sort_textures, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, gl_no_skyclear, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Int, gl_enhanced_nv_stealth, 3, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, gl_texture, true, 0) CVAR(Float, gl_mask_threshold, 0.5f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index a735842a32..020bae1f20 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -68,6 +68,26 @@ EXTERN_CVAR(Bool, r_debug_disable_vis_filter) EXTERN_CVAR(Float, transsouls) +//========================================================================== +// +// Sprite CVARs +// +//========================================================================== + +CVAR(Bool, gl_usecolorblending, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Bool, gl_sprite_blend, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); +CVAR(Int, gl_spriteclip, 1, CVAR_ARCHIVE) +CVAR(Float, gl_sclipthreshold, 10.0, CVAR_ARCHIVE) +CVAR(Float, gl_sclipfactor, 1.8f, CVAR_ARCHIVE) +CVAR(Int, gl_particles_style, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // 0 = square, 1 = round, 2 = smooth +CVAR(Int, gl_billboard_mode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Bool, gl_billboard_faces_camera, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Bool, gl_billboard_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE) +{ + if (self < 0 || self > 8) self = 0; +} + //========================================================================== // // diff --git a/src/rendering/hwrenderer/utility/hw_cvars.cpp b/src/rendering/hwrenderer/utility/hw_cvars.cpp index 348fc8821e..42b5ddacd7 100644 --- a/src/rendering/hwrenderer/utility/hw_cvars.cpp +++ b/src/rendering/hwrenderer/utility/hw_cvars.cpp @@ -1,24 +1,39 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2005-2016 Christoph Oelckers -// All rights reserved. -// -// 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 -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// +/* +** hw_cvars.cpp +** +** most of the hardware renderer's CVARs. +** +**--------------------------------------------------------------------------- +** Copyright 2005-2020 Christoph Oelckers +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. 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. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. +**--------------------------------------------------------------------------- +** +** +*/ + #include "c_cvars.h" @@ -65,7 +80,7 @@ CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); // Texture CVARs // //========================================================================== -CUSTOM_CVAR(Float,gl_texture_filter_anisotropic,8.0f,CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) +CUSTOM_CVARD(Float, gl_texture_filter_anisotropic, 8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL, "changes the OpenGL texture anisotropy setting") { screen->TextureFilterChanged(); } @@ -75,7 +90,7 @@ CCMD(gl_flush) TexMan.FlushAll(); } -CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) +CUSTOM_CVARD(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL, "changes the texture filtering settings") { if (self < 0 || self > 6) self=4; screen->TextureFilterChanged(); @@ -83,26 +98,6 @@ CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINI CVAR(Bool, gl_precache, false, CVAR_ARCHIVE) -//========================================================================== -// -// Sprite CVARs -// -//========================================================================== - -CVAR(Bool, gl_usecolorblending, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -CVAR(Bool, gl_sprite_blend, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); -CVAR(Int, gl_spriteclip, 1, CVAR_ARCHIVE) -CVAR(Float, gl_sclipthreshold, 10.0, CVAR_ARCHIVE) -CVAR(Float, gl_sclipfactor, 1.8f, CVAR_ARCHIVE) -CVAR(Int, gl_particles_style, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // 0 = square, 1 = round, 2 = smooth -CVAR(Int, gl_billboard_mode, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Bool, gl_billboard_faces_camera, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Bool, gl_billboard_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Int, gl_enhanced_nv_stealth, 3, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE) -{ - if (self < 0 || self > 8) self = 0; -} CUSTOM_CVAR(Int, gl_shadowmap_filter, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { diff --git a/src/rendering/hwrenderer/utility/hw_cvars.h b/src/rendering/hwrenderer/utility/hw_cvars.h index 79c97b6827..0b9d8f09b8 100644 --- a/src/rendering/hwrenderer/utility/hw_cvars.h +++ b/src/rendering/hwrenderer/utility/hw_cvars.h @@ -1,10 +1,8 @@ #pragma once -#include "r_defs.h" #include "c_cvars.h" - EXTERN_CVAR(Bool,gl_enhanced_nightvision) EXTERN_CVAR(Int, screenblocks); EXTERN_CVAR(Int, gl_texture_filter) @@ -52,19 +50,6 @@ EXTERN_CVAR(Float, gl_ssao_blur_amount) EXTERN_CVAR(Int, gl_debug_level) EXTERN_CVAR(Bool, gl_debug_breakpoint) - -EXTERN_CVAR(Bool, gl_usecolorblending) -EXTERN_CVAR(Bool, gl_sprite_blend) -EXTERN_CVAR(Int, gl_spriteclip) -EXTERN_CVAR(Float, gl_sclipthreshold) -EXTERN_CVAR(Float, gl_sclipfactor) -EXTERN_CVAR(Int, gl_particles_style) -EXTERN_CVAR(Int, gl_billboard_mode) -EXTERN_CVAR(Bool, gl_billboard_faces_camera) -EXTERN_CVAR(Bool, gl_billboard_particles) -EXTERN_CVAR(Int, gl_enhanced_nv_stealth) -EXTERN_CVAR(Int, gl_fuzztype) - EXTERN_CVAR(Int, gl_shadowmap_filter) EXTERN_CVAR(Bool, gl_brightfog) diff --git a/src/rendering/vulkan/renderer/vk_renderbuffers.cpp b/src/rendering/vulkan/renderer/vk_renderbuffers.cpp index 80e619fe7b..2557054ea7 100644 --- a/src/rendering/vulkan/renderer/vk_renderbuffers.cpp +++ b/src/rendering/vulkan/renderer/vk_renderbuffers.cpp @@ -27,6 +27,7 @@ #include "vulkan/system/vk_builders.h" #include "vulkan/system/vk_framebuffer.h" #include "hwrenderer/utility/hw_cvars.h" +#include "templates.h" VkRenderBuffers::VkRenderBuffers() {