From 6cdce0c95dda4fc1c0d96f71b533c989cd4be944 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 2 Apr 2025 10:01:38 +0200 Subject: [PATCH] use max --- src/hardware/hw_cache.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index ed73de2ec..824fd08e7 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -98,10 +98,7 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm position = 0; } - position = ((position * scale_y) + (FRACUNIT/2)) >> FRACBITS; - - if (position < 0) - position = 0; + position = max(((position * scale_y) + (FRACUNIT/2)) >> FRACBITS, 0); if (position + count >= pblockheight) count = pblockheight - position;