fix I_ReadScreen warning

use uintptr to ensure same signdness, taken from srb2classic
This commit is contained in:
Alug 2025-10-19 21:10:54 +02:00
parent dbafe1da7a
commit e332959262

View file

@ -1340,11 +1340,12 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
else
{
UINT8 * restrict source = vid.screens[0];
INT32 w = vid.width/scale*scale, h = vid.height/scale*scale;
uintptr_t w = vid.width/scale*scale, h = vid.height/scale*scale;
// size_t saves a lea + movsxd over INT32. mind your types!
for (size_t y = 0; y < h; y += scale)
for (size_t x = 0; x < w; x += scale)
// uintptr_t is even better since it's guaranteed to be the size of a pointer
for (uintptr_t y = 0; y < h; y += scale)
for (uintptr_t x = 0; x < w; x += scale)
*scr++ = source[y*vid.width + x];
}
}