- removed a few tabledivide uses in the game modules

This commit is contained in:
Christoph Oelckers 2020-07-14 14:08:59 +02:00
parent aa01adb2f1
commit 1a0b388570
4 changed files with 6 additions and 4 deletions

View file

@ -385,7 +385,7 @@ void PreloadCache(void)
#if 0
if (videoGetRenderMode() != REND_CLASSIC && totalclock - clock > (kTicRate>>2))
{
int const percentComplete = min(100, tabledivide32_noinline(100 * cnt, nPrecacheCount));
int const percentComplete = min(100, Scale(100 * cnt, nPrecacheCount));
// this just prevents the loading screen percentage bar from making large jumps
while (percentDisplayed < percentComplete)

View file

@ -193,7 +193,9 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav)
else
{
// DOS Blood v1.11: 320x240, 320x320, 640x400, and 640x480 SMKs all display 1:1 and centered in a 640x480 viewport
nScale = tabledivide32(scale(65536, ydim << 2, xdim * 3), ((max(nHeight, 240 + 1u) + 239) / 240));
int num = scale(65536, ydim << 2, xdim * 3);
int div = (max(nHeight, 240 + 1u) + 239) / 240;
nScale = num / div;
nStat = 2 | 8 | 64 | 1024;
renderSetAspect(viewingrange, 65536);
}

View file

@ -514,7 +514,7 @@ void DrawView(int smoothRatio, bool sceneonly)
if (r_usenewaspect)
{
newaspect_enable = 0;
renderSetAspect(viewingRange, tabledivide32_noinline(65536 * ydim * 8, xdim * 5));
renderSetAspect(viewingRange, divscale16(ydim * 8, xdim * 5));
}
if (nFreeze)

View file

@ -2197,7 +2197,7 @@ drawscreen(PLAYERp pp)
if (r_usenewaspect)
{
newaspect_enable = 0;
renderSetAspect(viewingRange, tabledivide32_noinline(65536 * ydim * 8, xdim * 5));
renderSetAspect(viewingRange, divscale16(ydim * 8, xdim * 5));
}
UpdatePanel();