From b4250a74f5ac1dccb11ba199805fe1b85f8aaf1a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 21 Jun 2020 18:42:05 +0200 Subject: [PATCH] gfx/shader: Increase size limit and function to get base size --- source/gfx/shader/gfx-shader.cpp | 26 ++++++++++++++++++-------- source/gfx/shader/gfx-shader.hpp | 4 ++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/source/gfx/shader/gfx-shader.cpp b/source/gfx/shader/gfx-shader.cpp index 52a4ed1e..da027b49 100644 --- a/source/gfx/shader/gfx-shader.cpp +++ b/source/gfx/shader/gfx-shader.cpp @@ -373,16 +373,16 @@ std::uint32_t gfx::shader::shader::width() case shader_mode::Source: switch (_width_type) { case size_type::Pixel: - return std::clamp(static_cast(_width_value), 1u, 8192u); + return std::clamp(static_cast(_width_value), 1u, 16384u); case size_type::Percent: - return std::clamp(static_cast(_width_value * _base_width), 1u, 8192u); + return std::clamp(static_cast(_width_value * _base_width), 1u, 16384u); } case shader_mode::Filter: switch (_width_type) { case size_type::Pixel: - return std::clamp(static_cast(_width_value), 1u, 8192u); + return std::clamp(static_cast(_width_value), 1u, 16384u); case size_type::Percent: - return std::clamp(static_cast(_width_value * _base_width), 1u, 8192u); + return std::clamp(static_cast(_width_value * _base_width), 1u, 16384u); } default: return 0; @@ -397,22 +397,32 @@ std::uint32_t gfx::shader::shader::height() case shader_mode::Source: switch (_height_type) { case size_type::Pixel: - return std::clamp(static_cast(_height_value), 1u, 8192u); + return std::clamp(static_cast(_height_value), 1u, 16384u); case size_type::Percent: - return std::clamp(static_cast(_height_value * _base_height), 1u, 8192u); + return std::clamp(static_cast(_height_value * _base_height), 1u, 16384u); } case shader_mode::Filter: switch (_height_type) { case size_type::Pixel: - return std::clamp(static_cast(_height_value), 1u, 8192u); + return std::clamp(static_cast(_height_value), 1u, 16384u); case size_type::Percent: - return std::clamp(static_cast(_height_value * _base_height), 1u, 8192u); + return std::clamp(static_cast(_height_value * _base_height), 1u, 16384u); } default: return 0; } } +std::uint32_t gfx::shader::shader::base_width() +{ + return _base_width; +} + +std::uint32_t gfx::shader::shader::base_height() +{ + return _base_height; +} + bool gfx::shader::shader::tick(float_t time) { _shader_file_tick = static_cast(static_cast(_shader_file_tick) + static_cast(time)); diff --git a/source/gfx/shader/gfx-shader.hpp b/source/gfx/shader/gfx-shader.hpp index aa4fb041..3f1e4a4a 100644 --- a/source/gfx/shader/gfx-shader.hpp +++ b/source/gfx/shader/gfx-shader.hpp @@ -101,6 +101,10 @@ namespace gfx { std::uint32_t height(); + std::uint32_t base_width(); + + std::uint32_t base_height(); + bool tick(float_t time); void prepare_render();