From 5f7d0a31de9ffe891af6eb43aeb6d37372b8ade7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 6 Dec 2016 23:32:08 +0200 Subject: [PATCH] Mark some functions as const that by all rights should be --- source/rendertarget.cpp | 6 +++--- source/rendertarget.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/rendertarget.cpp b/source/rendertarget.cpp index 376af048..f575670a 100644 --- a/source/rendertarget.cpp +++ b/source/rendertarget.cpp @@ -59,7 +59,7 @@ RenderTargetFormat RenderTargetFormat::operator,(PixelFormat f) const return result; } -int RenderTargetFormat::index(RenderOutput o) +int RenderTargetFormat::index(RenderOutput o) const { unsigned type = get_output_type(o); unsigned i = 0; @@ -155,7 +155,7 @@ RenderTarget::~RenderTarget() } } -const Texture2D &RenderTarget::get_target_texture(unsigned i) +const Texture2D &RenderTarget::get_target_texture(unsigned i) const { if(i>=buffers.size()) throw out_of_range("RenderTarget::get_target_texture"); @@ -165,7 +165,7 @@ const Texture2D &RenderTarget::get_target_texture(unsigned i) return *buffers[i].texture; } -const Texture2D &RenderTarget::get_target_texture(RenderOutput o) +const Texture2D &RenderTarget::get_target_texture(RenderOutput o) const { int index = format.index(o); if(index<0) diff --git a/source/rendertarget.h b/source/rendertarget.h index e38f6f51..0181365e 100644 --- a/source/rendertarget.h +++ b/source/rendertarget.h @@ -31,7 +31,7 @@ public: bool empty() const { return !count; } const unsigned char *begin() const { return outputs; } const unsigned char *end() const { return outputs+count; } - int index(RenderOutput); + int index(RenderOutput) const; }; inline RenderTargetFormat operator,(RenderOutput o1, RenderOutput o2) @@ -74,8 +74,8 @@ public: const RenderTargetFormat &get_format() const { return format; } Framebuffer &get_framebuffer() { return fbo; } - const Texture2D &get_target_texture(unsigned); - const Texture2D &get_target_texture(RenderOutput); + const Texture2D &get_target_texture(unsigned) const; + const Texture2D &get_target_texture(RenderOutput) const; void blit_from(const RenderTarget &); }; -- 2.45.2