slight optimization
This commit is contained in:
parent
83b45a0dea
commit
4793d6f26a
6 changed files with 39 additions and 25 deletions
|
|
@ -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]};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue