From cb1e8a177fa5b455f92cf1a3b8cb522d80c38814 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Apr 2020 22:24:27 +0200 Subject: [PATCH] - moved gl_shader.cpp to 'common'. --- src/CMakeLists.txt | 2 +- src/common/rendering/gl/gl_renderstate.cpp | 2 +- .../gl/shaders => common/rendering/gl}/gl_shader.cpp | 3 +-- .../gl/shaders => common/rendering/gl}/gl_shader.h | 0 src/common/rendering/gl/gl_shaderprogram.h | 2 +- src/rendering/gl/renderer/gl_renderer.cpp | 8 +------- src/rendering/v_framebuffer.cpp | 2 +- 7 files changed, 6 insertions(+), 13 deletions(-) rename src/{rendering/gl/shaders => common/rendering/gl}/gl_shader.cpp (99%) rename src/{rendering/gl/shaders => common/rendering/gl}/gl_shader.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93aa6d264d..3f1449ddf4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -940,7 +940,6 @@ set (PCH_SOURCES rendering/2d/v_blend.cpp rendering/gl/renderer/gl_renderer.cpp rendering/gl/renderer/gl_stereo3d.cpp - rendering/gl/shaders/gl_shader.cpp rendering/gl/system/gl_framebuffer.cpp rendering/hwrenderer/hw_entrypoint.cpp rendering/hwrenderer/data/hw_vertexbuilder.cpp @@ -1145,6 +1144,7 @@ set (PCH_SOURCES common/rendering/gl/gl_buffers.cpp common/rendering/gl/gl_hwtexture.cpp common/rendering/gl/gl_samplers.cpp + common/rendering/gl/gl_shader.cpp common/rendering/gl/gl_shaderprogram.cpp common/scripting/core/dictionary.cpp common/scripting/core/dynarrays.cpp diff --git a/src/common/rendering/gl/gl_renderstate.cpp b/src/common/rendering/gl/gl_renderstate.cpp index 8de101c2f8..555dbba918 100644 --- a/src/common/rendering/gl/gl_renderstate.cpp +++ b/src/common/rendering/gl/gl_renderstate.cpp @@ -33,7 +33,7 @@ #include "hw_cvars.h" #include "flatvertices.h" #include "hwrenderer/scene/hw_skydome.h" -#include "gl/shaders/gl_shader.h" +#include "gl_shader.h" #include "gl/renderer/gl_renderer.h" #include "hw_lightbuffer.h" #include "gl_renderbuffers.h" diff --git a/src/rendering/gl/shaders/gl_shader.cpp b/src/common/rendering/gl/gl_shader.cpp similarity index 99% rename from src/rendering/gl/shaders/gl_shader.cpp rename to src/common/rendering/gl/gl_shader.cpp index 9a30674fd2..844f979d72 100644 --- a/src/rendering/gl/shaders/gl_shader.cpp +++ b/src/common/rendering/gl/gl_shader.cpp @@ -34,7 +34,7 @@ #include "cmdlib.h" #include "md5.h" #include "m_misc.h" -#include "gl/shaders/gl_shader.h" +#include "gl_shader.h" #include "hw_shaderpatcher.h" #include "hwrenderer/data/shaderuniforms.h" #include "hwrenderer/scene/hw_viewpointuniforms.h" @@ -44,7 +44,6 @@ #include "gl_debug.h" #include "matrix.h" #include "gl/renderer/gl_renderer.h" -#include "gl/shaders/gl_shader.h" #include #include diff --git a/src/rendering/gl/shaders/gl_shader.h b/src/common/rendering/gl/gl_shader.h similarity index 100% rename from src/rendering/gl/shaders/gl_shader.h rename to src/common/rendering/gl/gl_shader.h diff --git a/src/common/rendering/gl/gl_shaderprogram.h b/src/common/rendering/gl/gl_shaderprogram.h index da45250525..90e2572974 100644 --- a/src/common/rendering/gl/gl_shaderprogram.h +++ b/src/common/rendering/gl/gl_shaderprogram.h @@ -2,7 +2,7 @@ #pragma once #include "gl_system.h" -#include "gl/shaders/gl_shader.h" +#include "gl_shader.h" #include "hwrenderer/postprocessing/hw_postprocess.h" namespace OpenGLRenderer diff --git a/src/rendering/gl/renderer/gl_renderer.cpp b/src/rendering/gl/renderer/gl_renderer.cpp index 624a5ef9ce..e35446e796 100644 --- a/src/rendering/gl/renderer/gl_renderer.cpp +++ b/src/rendering/gl/renderer/gl_renderer.cpp @@ -30,22 +30,16 @@ ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **--------------------------------------------------------------------------- ** -*/ +*/ #include "gl_system.h" #include "files.h" #include "v_video.h" #include "m_png.h" #include "filesystem.h" -#include "doomstat.h" #include "i_time.h" -#include "p_effect.h" -#include "d_player.h" -#include "a_dynlight.h" #include "cmdlib.h" #include "version.h" -#include "g_game.h" -#include "swrenderer/r_swscene.h" #include "hwrenderer/utility/hw_clock.h" #include "gl_interface.h" diff --git a/src/rendering/v_framebuffer.cpp b/src/rendering/v_framebuffer.cpp index bedab9d88a..bd08acc852 100644 --- a/src/rendering/v_framebuffer.cpp +++ b/src/rendering/v_framebuffer.cpp @@ -355,7 +355,7 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds) int screenWidth = GetWidth(); int screenHeight = GetHeight(); float scaleX, scaleY; - scaleX = MIN(clientWidth / (float)screenWidth, clientHeight / ((float)screenHeight * ViewportPixelAspect())); + scaleX = std::min(clientWidth / (float)screenWidth, clientHeight / ((float)screenHeight * ViewportPixelAspect())); scaleY = scaleX * ViewportPixelAspect(); mOutputLetterbox.width = (int)round(screenWidth * scaleX); mOutputLetterbox.height = (int)round(screenHeight * scaleY);