diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-08-04 22:45:25 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-08-04 22:52:00 -0400 |
| commit | dd5b8895fe983b0e577ddd222ecb902c7a9a4af1 (patch) | |
| tree | d169355ef25f7949007f99de00c3ab9a48cb2312 /Source/Core/VideoCommon | |
| parent | 7f6abfb0bf55612e1c2bde0ef633bd669e08e3ba (diff) | |
VideoCommon/RenderBase: Make functions const where applicable
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.h | 13 |
2 files changed, 12 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 48b8e4cfd3..4bd69e186d 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -665,13 +665,13 @@ void Renderer::ScaleTexture(AbstractFramebuffer* dst_framebuffer, MathUtil::Rectangle<int> Renderer::ConvertFramebufferRectangle(const MathUtil::Rectangle<int>& rect, - const AbstractFramebuffer* framebuffer) + const AbstractFramebuffer* framebuffer) const { return ConvertFramebufferRectangle(rect, framebuffer->GetWidth(), framebuffer->GetHeight()); } MathUtil::Rectangle<int> Renderer::ConvertFramebufferRectangle(const MathUtil::Rectangle<int>& rect, - u32 fb_width, u32 fb_height) + u32 fb_width, u32 fb_height) const { MathUtil::Rectangle<int> ret = rect; if (g_ActiveConfig.backend_info.bUsesLowerLeftOrigin) @@ -682,7 +682,7 @@ MathUtil::Rectangle<int> Renderer::ConvertFramebufferRectangle(const MathUtil::R return ret; } -MathUtil::Rectangle<int> Renderer::ConvertEFBRectangle(const MathUtil::Rectangle<int>& rc) +MathUtil::Rectangle<int> Renderer::ConvertEFBRectangle(const MathUtil::Rectangle<int>& rc) const { MathUtil::Rectangle<int> result; result.left = EFBToScaledX(rc.left); @@ -827,7 +827,7 @@ void Renderer::SetWindowSize(int width, int height) } } -std::tuple<int, int> Renderer::CalculateOutputDimensions(int width, int height) +std::tuple<int, int> Renderer::CalculateOutputDimensions(int width, int height) const { width = std::max(width, 1); height = std::max(height, 1); @@ -1356,7 +1356,7 @@ void Renderer::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc, } } -bool Renderer::IsFrameDumping() +bool Renderer::IsFrameDumping() const { if (m_screenshot_request.IsSet()) return true; diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 116080a1a8..6ff7f410dd 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -159,13 +159,14 @@ public: // Converts an upper-left to lower-left if required by the backend, optionally // clamping to the framebuffer size. MathUtil::Rectangle<int> ConvertFramebufferRectangle(const MathUtil::Rectangle<int>& rect, - u32 fb_width, u32 fb_height); - MathUtil::Rectangle<int> ConvertFramebufferRectangle(const MathUtil::Rectangle<int>& rect, - const AbstractFramebuffer* framebuffer); + u32 fb_width, u32 fb_height) const; + MathUtil::Rectangle<int> + ConvertFramebufferRectangle(const MathUtil::Rectangle<int>& rect, + const AbstractFramebuffer* framebuffer) const; // EFB coordinate conversion functions // Use this to convert a whole native EFB rect to backbuffer coordinates - MathUtil::Rectangle<int> ConvertEFBRectangle(const MathUtil::Rectangle<int>& rc); + MathUtil::Rectangle<int> ConvertEFBRectangle(const MathUtil::Rectangle<int>& rc) const; const MathUtil::Rectangle<int>& GetTargetRectangle() const { return m_target_rectangle; } float CalculateDrawAspectRatio() const; @@ -324,7 +325,7 @@ protected: private: void RunFrameDumps(); - std::tuple<int, int> CalculateOutputDimensions(int width, int height); + std::tuple<int, int> CalculateOutputDimensions(int width, int height) const; PEControl::PixelFormat m_prev_efb_format = PEControl::INVALID_FMT; unsigned int m_efb_scale = 1; @@ -373,7 +374,7 @@ private: void DumpFrameToImage(const FrameDumpConfig& config); void ShutdownFrameDumping(); - bool IsFrameDumping(); + bool IsFrameDumping() const; // Checks that the frame dump render texture exists and is the correct size. bool CheckFrameDumpRenderTexture(u32 target_width, u32 target_height); |
