From 3dc19a980848bf63d87011b3d7f1f60254469dbd Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sun, 18 Aug 2024 00:54:54 -0400 Subject: [PATCH] Mark texture state getters const --- src/sdl/texture.cpp | 6 +++--- src/sdl/texture.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sdl/texture.cpp b/src/sdl/texture.cpp index b7fd8fd306b..3b488215289 100644 --- a/src/sdl/texture.cpp +++ b/src/sdl/texture.cpp @@ -155,7 +155,7 @@ void texture::set_alpha_mod(uint8_t alpha) } } -uint8_t texture::get_alpha_mod() +uint8_t texture::get_alpha_mod() const { if (!texture_) { return 0; @@ -178,7 +178,7 @@ void texture::set_color_mod(uint8_t r, uint8_t g, uint8_t b) } } -color_t texture::get_color_mod() +color_t texture::get_color_mod() const { if (!texture_) { return {0,0,0}; @@ -195,7 +195,7 @@ void texture::set_blend_mode(SDL_BlendMode b) } } -SDL_BlendMode texture::get_blend_mode() +SDL_BlendMode texture::get_blend_mode() const { if (!texture_) { return SDL_BLENDMODE_NONE; diff --git a/src/sdl/texture.hpp b/src/sdl/texture.hpp index 79e0fdfaa05..68d367b0c34 100644 --- a/src/sdl/texture.hpp +++ b/src/sdl/texture.hpp @@ -173,16 +173,16 @@ public: /** Alpha modifier. Multiplies alpha when drawing. */ void set_alpha_mod(uint8_t alpha); - uint8_t get_alpha_mod(); + uint8_t get_alpha_mod() const; /** Blend mode. Modifies how draw operations are applied. */ void set_blend_mode(SDL_BlendMode); - SDL_BlendMode get_blend_mode(); + SDL_BlendMode get_blend_mode() const; /** Colour modifier. Multiplies each colour component when drawing. */ void set_color_mod(uint8_t r, uint8_t g, uint8_t b); void set_color_mod(color_t); - color_t get_color_mod(); + color_t get_color_mod() const; /** Releases ownership of the managed texture and resets the ptr to null. */ void reset();