slight optimization

This commit is contained in:
Jorijn van der Graaf 2025-11-25 02:10:18 +01:00
commit 4793d6f26a
6 changed files with 39 additions and 25 deletions

View file

@ -70,9 +70,7 @@ void UiElementTextBuffer::Render(const std::string_view text, float size, Pixel_
for (int j = 0; j < h; j++) {
for (int i = 0; i < w; i++) {
int bufIndex = ((baseline + j + c_y1) * bufferWidth + (x + i + c_x1));
unsigned char val = bitmap[j * w + i];
buffer[bufIndex] = {color.r, color.g, color.b, val};
buffer[(baseline + j + c_y1) * bufferWidth + (x + i + c_x1)] = {color.r, color.g, color.b, bitmap[j * w + i]};
}
}