From 4f6a0c579db03271c37be0eb205f2e1cd5e3d250 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Thu, 26 Aug 2021 14:16:52 -0500 Subject: [PATCH] Derp fix: Return const reference to image vectors It was copying the whole bitmap and palette for *every pixel* in sprite draws --- include/image.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/image.hpp b/include/image.hpp index c86218d..e863e3a 100644 --- a/include/image.hpp +++ b/include/image.hpp @@ -69,8 +69,8 @@ public: u16 width(void) const { return _width; } u16 height(void) const { return _height; } u8 paletteStart(void) const { return _paletteStart; } - std::vector bitmap(void) const { return _bitmap; } - std::vector palette(void) const { return _palette; } + const std::vector &bitmap(void) const { return _bitmap; } + const std::vector &palette(void) const { return _palette; } void changePaletteStart(u8 paletteStart);