From adf62d216c13a4641bc702896272f41c47d9f3bd Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 24 Jun 2017 09:20:42 +0000 Subject: [PATCH] scale(1<<##, b, c) --> divscale##(b, c) git-svn-id: https://svn.eduke32.com/eduke32@6256 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/menus.cpp | 12 ++++++------ source/duke3d/src/player.cpp | 2 +- source/duke3d/src/screens.cpp | 4 ++-- source/kenbuild/src/bstub.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 4c584cb30..92da49845 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -3420,19 +3420,19 @@ MenuAnimation_t m_animation; int32_t Menu_Anim_SinOutRight(MenuAnimation_t *animdata) { - return sintable[scale(1024, totalclock - animdata->start, animdata->length) + 512] - 16384; + return sintable[divscale10(totalclock - animdata->start, animdata->length) + 512] - 16384; } int32_t Menu_Anim_SinInRight(MenuAnimation_t *animdata) { - return sintable[scale(1024, totalclock - animdata->start, animdata->length) + 512] + 16384; + return sintable[divscale10(totalclock - animdata->start, animdata->length) + 512] + 16384; } int32_t Menu_Anim_SinOutLeft(MenuAnimation_t *animdata) { - return -sintable[scale(1024, totalclock - animdata->start, animdata->length) + 512] + 16384; + return -sintable[divscale10(totalclock - animdata->start, animdata->length) + 512] + 16384; } int32_t Menu_Anim_SinInLeft(MenuAnimation_t *animdata) { - return -sintable[scale(1024, totalclock - animdata->start, animdata->length) + 512] - 16384; + return -sintable[divscale10(totalclock - animdata->start, animdata->length) + 512] - 16384; } void Menu_AnimateChange(int32_t cm, MenuAnimationType_t animtype) @@ -3775,7 +3775,7 @@ static int32_t ydim_from_200_16(int32_t y) static void Menu_BlackRectangle(int32_t x, int32_t y, int32_t width, int32_t height, int32_t orientation) { - const int32_t xscale = scale(65536, width, tilesiz[0].x<<16), yscale = scale(65536, height, tilesiz[0].y<<16); + const int32_t xscale = divscale16(width, tilesiz[0].x<<16), yscale = divscale16(height, tilesiz[0].y<<16); rotatesprite_(x, y, max(xscale, yscale), 0, 0, 127, 4, (orientation&(1|32))|2|8|16, 0, 0, xdim_from_320_16(x), ydim_from_200_16(y), xdim_from_320_16(x + width), ydim_from_200_16(y + height)); } @@ -4521,7 +4521,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current dim = Menu_Text(origin.x + stringx, stringy, object->font, object->editfield, status | MT_Literal, ydim_upper, ydim_lower); h = max(dim.y, entry->font->get_yline()); - rotatesprite_ybounds(origin.x + x + dim.x + (1<<16) + scale(tilesiz[SPINNINGNUKEICON].x<<15, h, tilesiz[SPINNINGNUKEICON].y<<16), stringy, scale(65536, h, tilesiz[SPINNINGNUKEICON].y<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10, ydim_upper, ydim_lower); + rotatesprite_ybounds(origin.x + x + dim.x + (1<<16) + scale(tilesiz[SPINNINGNUKEICON].x<<15, h, tilesiz[SPINNINGNUKEICON].y<<16), stringy, divscale16(h, tilesiz[SPINNINGNUKEICON].y<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10, ydim_upper, ydim_lower); } else { diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index ea34b60f7..b69e82659 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2148,7 +2148,7 @@ void P_DisplayWeapon(void) case 1: break; case 2: if ((unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON) - rotatesprite_win(160 << 16, (180 + (pPlayer->weapon_pos * pPlayer->weapon_pos)) << 16, scale(65536, ud.statusbarscale, 100), 0, + rotatesprite_win(160 << 16, (180 + (pPlayer->weapon_pos * pPlayer->weapon_pos)) << 16, divscale16(ud.statusbarscale, 100), 0, hudweap.cur == GROW_WEAPON ? GROWSPRITEICON : WeaponPickupSprites[hudweap.cur], 0, 0, 2); default: goto enddisplayweapon; diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index bac9547a2..d07a5c351 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -1153,12 +1153,12 @@ void G_DisplayRest(int32_t smoothratio) vec2_t crosshairpos = { 160<<16, 100<<16 }; - rotatesprite_win(crosshairpos.x-(g_player[myconnectindex].ps->look_ang<<15), crosshairpos.y, scale(65536, ud.crosshairscale, 100), + rotatesprite_win(crosshairpos.x-(g_player[myconnectindex].ps->look_ang<<15), crosshairpos.y, divscale16(ud.crosshairscale, 100), 0, a, 0, CROSSHAIR_PAL, 2+1); #ifdef GEKKO if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0 && readmouseabsxy(&crosshairpos, &mouseabs)) - rotatesprite_win(crosshairpos.x, crosshairpos.y, scale(65536, ud.crosshairscale, 100), 0, a, 0, CROSSHAIR_PAL, 2+1); + rotatesprite_win(crosshairpos.x, crosshairpos.y, divscale16(ud.crosshairscale, 100), 0, a, 0, CROSSHAIR_PAL, 2+1); #endif } } diff --git a/source/kenbuild/src/bstub.cpp b/source/kenbuild/src/bstub.cpp index 48d2ff385..ee57743bd 100644 --- a/source/kenbuild/src/bstub.cpp +++ b/source/kenbuild/src/bstub.cpp @@ -258,7 +258,7 @@ void ExtPreCheckKeys(void) dy = dmulscale1(i,cosang,320,sinang); horizval2 = dy*(320>>1)/dx+1; - daviewingrange = scale(65536,16384*(xdim>>1),mindx-16); + daviewingrange = divscale30(xdim>>1, mindx-16); daaspect = scale(daviewingrange,scale(320,tilesiz[4094].x,tilesiz[4094].y),horizval2+6-horizval1); setaspect(daviewingrange,scale(daaspect,ydim*320,xdim*i)); horiz = 100-divscale15(horizval1+horizval2,daviewingrange);