1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 06:34:33 +01:00

Codechange: use std::fill_n over memset

This commit is contained in:
Rubidium
2025-05-06 22:35:24 +02:00
committed by rubidium42
parent 92bd78dd25
commit 7981fcb297
6 changed files with 9 additions and 8 deletions

View File

@@ -43,9 +43,10 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8_t colour)
{
std::byte *p = static_cast<std::byte *>(video);
do {
memset(video, colour, width);
video = (uint8_t *)video + _screen.pitch;
std::fill_n(p, width, static_cast<std::byte>(colour));
p += _screen.pitch;
} while (--height);
}