More pass by reference changes

This commit is contained in:
Dave Allie
2025-12-06 15:50:11 +11:00
parent 5ed2fe391d
commit 4ecfdea1a1
7 changed files with 42 additions and 37 deletions

View File

@@ -11,12 +11,12 @@ static tinfl_decompressor decomp;
template <typename Renderable>
class EpdFontRenderer {
Renderable* renderer;
Renderable& renderer;
void renderChar(uint32_t cp, int* x, const int* y, uint16_t color, EpdFontStyle style = REGULAR);
public:
const EpdFontFamily* fontFamily;
explicit EpdFontRenderer(const EpdFontFamily* fontFamily, Renderable* renderer)
explicit EpdFontRenderer(const EpdFontFamily* fontFamily, Renderable& renderer)
: fontFamily(fontFamily), renderer(renderer) {}
~EpdFontRenderer() = default;
void renderString(const char* string, int* x, int* y, uint16_t color, EpdFontStyle style = REGULAR);
@@ -113,7 +113,7 @@ void EpdFontRenderer<Renderable>::renderChar(const uint32_t cp, int* x, const in
}
if (bm) {
renderer->drawPixel(xx, yy, color);
renderer.drawPixel(xx, yy, color);
}
byteComplete = !byteComplete;
localX++;