diff --git a/src/console.c b/src/console.c index 3212521b0..8cc04fe93 100644 --- a/src/console.c +++ b/src/console.c @@ -621,11 +621,11 @@ static void CON_MoveConsole(void) con_curlines -= FixedInt(fracmovement); if (con_curlines < con_destlines) con_curlines = con_destlines; - + if (con_destlines == 0) // If the console is being closed, not just moved up... con_tick = 0; // ...don't show the blinking cursor } - + fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction Unlock_state(); @@ -635,7 +635,7 @@ INT32 CON_ShiftChar(INT32 ch) { if (I_UseNativeKeyboard()) return ch; - + if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { if (cv_keyboardlayout.value == 3) @@ -1244,7 +1244,7 @@ void CONS_Printf(const char *fmt, ...) if (con_started) CON_Print(txt); - + CON_LogMessage(txt); Lock_state(); @@ -1474,7 +1474,7 @@ static void CON_DrawHudlines(void) ;//charwidth = 4 * con_scalefactor; else { - //charwidth = SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor; + //charwidth = hu_font['A'-HU_FONTSTART]->width * con_scalefactor; V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); } } @@ -1577,11 +1577,11 @@ void CON_Drawer(void) if (con_recalc) { CON_RecalcSize(); - + if (con_curlines <= 0) CON_ClearHUD(); } - + // console movement if (con_curlines != con_destlines) CON_MoveConsole(); diff --git a/src/d_main.c b/src/d_main.c index 8c986a24e..6f281421a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -604,7 +604,7 @@ static boolean D_Display(void) else py = viewwindowy + 4; patch = W_CachePatchName("M_PAUSE", PU_CACHE); - V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, V_SNAPTOTOP, patch); + V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, V_SNAPTOTOP, patch); } if (rendermode == render_soft && demo.rewinding) diff --git a/src/f_finale.c b/src/f_finale.c index 1b8d236fe..a534eee68 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -170,8 +170,8 @@ static void F_SkyScroll(INT32 scrollspeed) w = (vid.width / vid.dupx)<width)*16))<width)<width)*16))<width*16))<width<width*16))<width)<width<height))<height)<width)<width<width))/2, 32, 0, contsonic); + V_DrawScaledPatch((BASEVIDWIDTH - contsonic->width)/2, 32, 0, contsonic); // Draw the continue markers! Show continues minus one. x -= ncontinues * 6; diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 6fef6d0a9..836d3adac 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -1090,15 +1090,15 @@ static void HWR_DrawFadeMaskInCache(GLMipmap_t *mipmap, INT32 pblockwidth, INT32 W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum), PU_HWRCACHE, &flat)); - stepy = ((INT32)SHORT(fmheight)<width)]; // 1bpp - src = &flat[(posy>>FRACBITS)*SHORT(fmwidth)]; + src = &flat[(posy>>FRACBITS)*fmwidth]; for (i = 0; i < pblockwidth;i++) { // fademask bpp is always 1, and is used just for alpha diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index 9a7f19995..d47d58841 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -108,10 +108,10 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option) if (option & V_NOSCALESTART) sdupx = sdupy = 2.0f; - v[0].x = v[3].x = (x*sdupx-(gpatch->leftoffset)*pdupx)/vid.width - 1; - v[2].x = v[1].x = (x*sdupx+((gpatch->width)-(gpatch->leftoffset))*pdupx)/vid.width - 1; - v[0].y = v[1].y = 1-(y*sdupy-(gpatch->topoffset)*pdupy)/vid.height; - v[2].y = v[3].y = 1-(y*sdupy+((gpatch->height)-(gpatch->topoffset))*pdupy)/vid.height; + v[0].x = v[3].x = (x*sdupx-gpatch->leftoffset*pdupx)/vid.width - 1; + v[2].x = v[1].x = (x*sdupx+(gpatch->width - gpatch->leftoffset)*pdupx)/vid.width - 1; + v[0].y = v[1].y = 1-(y*sdupy-gpatch->topoffset*pdupy)/vid.height; + v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height - gpatch->topoffset)*pdupy)/vid.height; v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; @@ -191,7 +191,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p // left offset if (option & V_FLIP) - offsetx = (float)((gpatch->width) - (gpatch->leftoffset)) * fscalew; + offsetx = (float)(gpatch->width - gpatch->leftoffset) * fscalew; else offsetx = (float)(gpatch->leftoffset) * fscalew; @@ -225,7 +225,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p // if it's meant to cover the whole screen, black out the rest // cx and cy are possibly *slightly* off from float maths // This is done before here compared to software because we directly alter cx and cy to centre - if (cx >= -0.1f && cx <= 0.1f && (gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && (gpatch->height) == BASEVIDHEIGHT) + if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT) { const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0])); @@ -376,7 +376,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, // if it's meant to cover the whole screen, black out the rest // cx and cy are possibly *slightly* off from float maths // This is done before here compared to software because we directly alter cx and cy to centre - if (cx >= -0.1f && cx <= 0.1f && (gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && (gpatch->height) == BASEVIDHEIGHT) + if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT) { const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0])); @@ -415,11 +415,11 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, if (fheight > h - sy) fheight = h - sy; - if (fwidth > (gpatch->width)) - fwidth = (gpatch->width); + if (fwidth > gpatch->width) + fwidth = gpatch->width; - if (fheight > (gpatch->height)) - fheight = (gpatch->height); + if (fheight > gpatch->height) + fheight = gpatch->height; if (pscale != FRACUNIT) { diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 77e9e598a..8e877a044 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4797,10 +4797,10 @@ static void HWR_ProjectSprite(mobj_t *thing) if (rotsprite != NULL) { - spr_width = SHORT(rotsprite->width) << FRACBITS; - spr_height = SHORT(rotsprite->height) << FRACBITS; - spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS; - spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS; + spr_width = rotsprite->width << FRACBITS; + spr_height = rotsprite->height << FRACBITS; + spr_offset = rotsprite->leftoffset << FRACBITS; + spr_topoffset = rotsprite->topoffset << FRACBITS; spr_topoffset += FEETADJUST; // flip -> rotate, not rotate -> flip diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 268059d06..b7984c1e5 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1949,17 +1949,11 @@ static void HU_DrawChat_Old(void) const char *ntalk = "Say: ", *ttalk = "Say-Team: "; const char *talk = ntalk; size_t select_start = 0, select_end = 0; - INT32 charwidth = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor; - INT32 charheight = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor; + INT32 charwidth = 8 * con_scalefactor; //hu_font['A'-HU_FONTSTART]->width * con_scalefactor; + INT32 charheight = 8 * con_scalefactor; //hu_font['A'-HU_FONTSTART]->height * con_scalefactor; if (teamtalk) { talk = ttalk; -#if 0 - if (players[consoleplayer].ctfteam == 1) - t = 0x500; // Red - else if (players[consoleplayer].ctfteam == 2) - t = 0x400; // Blue -#endif } while (talk[i]) @@ -1971,7 +1965,7 @@ static void HU_DrawChat_Old(void) } else { - //charwidth = SHORT(hu_font[talk[i]-HU_FONTSTART]->width) * con_scalefactor; + //charwidth = hu_font[talk[i]-HU_FONTSTART]->width * con_scalefactor; V_DrawCharacter(HU_INPUTX + c, y, talk[i++] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); } c += charwidth; @@ -1999,7 +1993,7 @@ static void HU_DrawChat_Old(void) //Hurdler: isn't it better like that? if (w_chat_buf[i] >= HU_FONTSTART) { - //charwidth = SHORT(hu_font[w_chat[i]-HU_FONTSTART]->width) * con_scalefactor; + //charwidth = hu_font[w_chat[i]-HU_FONTSTART]->width * con_scalefactor; V_DrawCharacter(HU_INPUTX + c, y, w_chat_buf[i] | cv_constextsize.value | V_NOSCALESTART | t, !cv_allcaps.value); } @@ -2638,7 +2632,7 @@ static void HU_DrawRankings(void) else p = bmatcico; - V_DrawSmallScaledPatch(128 - SHORT(p->width)/4, 4, 0, p); + V_DrawSmallScaledPatch(128 - p->width/4, 4, 0, p); V_DrawCenteredString(128, 16, 0, va("%u", bluescore)); if (gametype == GT_CTF) @@ -2646,7 +2640,7 @@ static void HU_DrawRankings(void) else p = rmatcico; - V_DrawSmallScaledPatch(192 - SHORT(p->width)/4, 4, 0, p); + V_DrawSmallScaledPatch(192 - p->width/4, 4, 0, p); V_DrawCenteredString(192, 16, 0, va("%u", redscore)); } diff --git a/src/k_kart.c b/src/k_kart.c index 1d2bde533..fb14741cc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9045,7 +9045,7 @@ static void K_DrawKartPositionNum(INT32 num) const boolean wheeloffs = (cv_showinput.value && cv_posi_xoffset.value == 0 && cv_posi_yoffset.value == 0 && cv_wheel_xoffset.value == 0 && cv_wheel_yoffset.value == 0); boolean win = (stplyr->exiting && num == 1); //INT32 X = POSI_X; - INT32 W = SHORT(kp_positionnum[0][0]->width); + INT32 W = kp_positionnum[0][0]->width; fixed_t scale = FRACUNIT; patch_t *localpatch = kp_positionnum[0][0]; //INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT); @@ -9159,7 +9159,7 @@ static void K_DrawKartPositionNum(INT32 num) localpatch = kp_positionnum[num % 10][0]; } - V_DrawFixedPatch((fx<width)*scale/2) : 0), (fy<height)*scale/2) : 0), scale, V_HUDTRANSHALF|fflags, localpatch, NULL); + V_DrawFixedPatch((fx<width*scale/2) : 0), (fy<height*scale/2) : 0), scale, V_HUDTRANSHALF|fflags, localpatch, NULL); // ^ if we overtake as p1 or p3 in splitscren, we shift it so that it doesn't go off screen. // ^ if we overtake as p1 in 2p splits, shift vertically so that this doesn't happen either. @@ -9493,9 +9493,9 @@ static void K_DrawDialNum(INT32 x, INT32 y, boolean colorized, INT32 flags, INT3 INT32 w; if (colorized) - w = SHORT(skp_dialnumclr[0]->width); + w = skp_dialnumclr[0]->width; else - w = SHORT(skp_dialnum[0]->width); + w = skp_dialnum[0]->width; if (flags & V_NOSCALESTART) w *= vid.dupx; @@ -10436,7 +10436,7 @@ static void K_drawKartWanted(void) } else if (splitscreen == 3) // 4P splitscreen... { - basex = BASEVIDWIDTH/2 - (SHORT(kp_wantedsplit->width)/2); // center on screen + basex = BASEVIDWIDTH/2 - (kp_wantedsplit->width/2); // center on screen basey = BASEVIDHEIGHT - 55; //basey2 = 4; } @@ -10559,8 +10559,8 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags) if (encoremode) amnumxpos = -amnumxpos; - amxpos = amnumxpos + ((x + (SHORT(minimapinfo.minimap_pic->width)-SHORT(minimaphead->width)) / 2)<height)-SHORT(minimaphead->height)) / 2)<width-minimaphead->width) / 2)<height-minimaphead->height) / 2)<width) / 4)<height) / 4)<width / 4)<height / 4)<width)/2); - y = info.y - (SHORT(minimapinfo.minimap_pic->height)/2); + x = info.x - (minimapinfo.minimap_pic->width/2); + y = info.y - (minimapinfo.minimap_pic->height/2); splitflags = info.flags; splitflags |= minimaptrans; if (encoremode) - V_DrawScaledPatch(x+SHORT(minimapinfo.minimap_pic->width), y, splitflags|V_FLIP, minimapinfo.minimap_pic); + V_DrawScaledPatch(x+minimapinfo.minimap_pic->width, y, splitflags|V_FLIP, minimapinfo.minimap_pic); else V_DrawScaledPatch(x, y, splitflags, minimapinfo.minimap_pic); @@ -10665,10 +10665,10 @@ static void K_drawKartMinimap(void) // let offsets transfer to the heads, too! if (encoremode) - x += SHORT(minimapinfo.minimap_pic->leftoffset); + x += minimapinfo.minimap_pic->leftoffset; else - x -= SHORT(minimapinfo.minimap_pic->leftoffset); - y -= SHORT(minimapinfo.minimap_pic->topoffset); + x -= minimapinfo.minimap_pic->leftoffset; + y -= minimapinfo.minimap_pic->topoffset; // initialize for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) @@ -10749,7 +10749,7 @@ static void K_drawKartStartCountdown(void) if (splitscreen) // splitscreen pnum += 8; - V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), splitflags, kp_startcountdown[pnum]); + V_DrawScaledPatch(STCD_X - (kp_startcountdown[pnum]->width/2), STCD_Y - (kp_startcountdown[pnum]->height/2), splitflags, kp_startcountdown[pnum]); } static void K_drawKartFinish(void) @@ -10765,7 +10765,7 @@ static void K_drawKartFinish(void) if (splitscreen > 1) // 3/4p, stationary FIN { pnum += 2; - V_DrawScaledPatch(STCD_X - (SHORT(kp_racefinish[pnum]->width)/2), STCD_Y - (SHORT(kp_racefinish[pnum]->height)/2), splitflags, kp_racefinish[pnum]); + V_DrawScaledPatch(STCD_X - (kp_racefinish[pnum]->width/2), STCD_Y - (kp_racefinish[pnum]->height/2), splitflags, kp_racefinish[pnum]); return; } @@ -10777,14 +10777,14 @@ static void K_drawKartFinish(void) pnum += 4; x = ((vid.width<width)<width<kartstuff[k_cardanimation])< x ? xval : x))/TICRATE; if (splitscreen && stplyrnum == 1) x = -x; V_DrawFixedPatch(x + (STCD_X<>1), - (STCD_Y<height)<<(FRACBITS-1)), + (STCD_Y<height<<(FRACBITS-1)), FRACUNIT, splitflags, kp_racefinish[pnum], NULL); } @@ -11705,7 +11705,7 @@ void K_drawKartHUD(void) return; if (G_BattleGametype() && !splitscreen && (stplyr->kartstuff[k_yougotem] % 2)) // * YOU GOT EM * - V_DrawScaledPatch(BASEVIDWIDTH/2 - (SHORT(kp_yougotem->width)/2), 32, V_HUDTRANS, kp_yougotem); + V_DrawScaledPatch(BASEVIDWIDTH/2 - (kp_yougotem->width/2), 32, V_HUDTRANS, kp_yougotem); // Draw FREE PLAY. if (isfreeplay && !stplyr->spectator && timeinmap > 113) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index dc2e8f824..5bfb21e2e 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -303,16 +303,16 @@ static int patch_get(lua_State *L) lua_pushboolean(L, patch != NULL); break; case patch_width: - lua_pushinteger(L, SHORT(patch->width)); + lua_pushinteger(L, patch->width); break; case patch_height: - lua_pushinteger(L, SHORT(patch->height)); + lua_pushinteger(L, patch->height); break; case patch_leftoffset: - lua_pushinteger(L, SHORT(patch->leftoffset)); + lua_pushinteger(L, patch->leftoffset); break; case patch_topoffset: - lua_pushinteger(L, SHORT(patch->topoffset)); + lua_pushinteger(L, patch->topoffset); break; } return 1; @@ -657,27 +657,27 @@ static int libd_drawOnMinimap(lua_State *L) splitflags |= V_HUDTRANS; // Handle offsets and stuff. - mm_x = info.x - (SHORT(AutomapPic->width)/2); - mm_y = info.y - (SHORT(AutomapPic->height)/2); + mm_x = info.x - (AutomapPic->width/2); + mm_y = info.y - (AutomapPic->height/2); // let offsets transfer to the heads, too! if (encoremode) { - mm_x += SHORT(AutomapPic->leftoffset); + mm_x += AutomapPic->leftoffset; } else { - mm_x -= SHORT(AutomapPic->leftoffset); + mm_x -= AutomapPic->leftoffset; } - mm_y -= SHORT(AutomapPic->topoffset); + mm_y -= AutomapPic->topoffset; // patch is supposedly already centered, don't butt in. if (!centered) { // scale patch coords - patchw = (SHORT(patch->width) * scale / 2); - patchh = (SHORT(patch->height) * scale / 2); + patchw = (patch->width * scale / 2); + patchh = (patch->height * scale / 2); } amnumxpos = (FixedMul(x, minimapinfo.zoom) - minimapinfo.offs_x); @@ -688,8 +688,8 @@ static int libd_drawOnMinimap(lua_State *L) amnumxpos = -amnumxpos; } - amxpos = amnumxpos + ((mm_x + SHORT(AutomapPic->width) / 2)<height) / 2)<width / 2)<height / 2)<width) - SHORT(p->leftoffset); + xx += p->width - p->leftoffset; for (i = 0; i < 16; i++) { V_DrawScaledPatch(xx, y, V_WRAPX, W_CachePatchNum(centerlump[i & 1], PU_CACHE)); @@ -5192,8 +5192,8 @@ static void M_DrawMenuTitle(void) if (p->height > 24) // title is larger than normal { - INT32 xtitle = (BASEVIDWIDTH - (SHORT(p->width)/2))/2; - INT32 ytitle = (30 - (SHORT(p->height)/2))/2; + INT32 xtitle = (BASEVIDWIDTH - (p->width/2))/2; + INT32 ytitle = (30 - (p->height/2))/2; if (xtitle < 0) xtitle = 0; @@ -5204,8 +5204,8 @@ static void M_DrawMenuTitle(void) } else { - INT32 xtitle = (BASEVIDWIDTH - SHORT(p->width))/2; - INT32 ytitle = (30 - SHORT(p->height))/2; + INT32 xtitle = (BASEVIDWIDTH - p->width)/2; + INT32 ytitle = (30 - p->height)/2; if (xtitle < 0) xtitle = 0; @@ -5293,7 +5293,7 @@ static void M_DrawGenericMenu(void) { patch_t *p; p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE); - V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, y, 0, p); + V_DrawScaledPatch((BASEVIDWIDTH - p->width)/2, y, 0, p); } else { @@ -5621,7 +5621,7 @@ static void M_DrawCenteredMenu(void) if (currentMenu->menuitems[i].status & IT_CENTER) { - V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, y, 0, p); + V_DrawScaledPatch((BASEVIDWIDTH - p->width)/2, y, 0, p); } else { @@ -6052,7 +6052,7 @@ static void M_DrawMessageMenu(void) } V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2,y,V_ALLOWLOWERCASE,string); - y += 8; //SHORT(hu_font[0]->height); + y += 8; //hu_font[0]->height; } } @@ -7222,8 +7222,8 @@ static void DrawReplayHutReplayInfo(void) V_DrawSmallScaledPatch(x, y, V_SNAPTOTOP, patch); else { - w = SHORT(patch->width); - h = SHORT(patch->height); + w = patch->width; + h = patch->height; V_DrawSmallScaledPatch(x+(w>>1), y, V_SNAPTOTOP|V_FLIP, patch); { @@ -7314,7 +7314,7 @@ static void DrawReplayHutReplayInfo(void) GTC_MENUCACHE); } - V_DrawMappedPatch(BASEVIDWIDTH-15 - SHORT(patch->width), y+20, V_SNAPTOTOP, patch, colormap); + V_DrawMappedPatch(BASEVIDWIDTH-15 - patch->width, y+20, V_SNAPTOTOP, patch, colormap); break; } @@ -7533,7 +7533,7 @@ static void M_DrawReplayStartMenu(void) GTC_MENUCACHE); } - V_DrawMappedPatch(BASEVIDWIDTH-5 - SHORT(patch->width), STARTY + i*20, V_SNAPTOTOP, patch, colormap); + V_DrawMappedPatch(BASEVIDWIDTH-5 - patch->width, STARTY + i*20, V_SNAPTOTOP, patch, colormap); } #undef STARTY @@ -9132,7 +9132,7 @@ void M_DrawTimeAttackMenu(void) if (W_CheckNumForName(skins[cv_chooseskin.value-1].facewant) != LUMPERROR) { UINT8 *colormap = R_GetTranslationColormap(cv_chooseskin.value-1, cv_playercolor.value, GTC_MENUCACHE); - V_DrawMappedPatch(BASEVIDWIDTH-x - SHORT(facewantprefix[cv_chooseskin.value-1]->width), y, 0, facewantprefix[cv_chooseskin.value-1], colormap); + V_DrawMappedPatch(BASEVIDWIDTH-x - facewantprefix[cv_chooseskin.value-1]->width, y, 0, facewantprefix[cv_chooseskin.value-1], colormap); } for (i = 0; i < currentMenu->numitems; ++i) @@ -10254,8 +10254,8 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade) else PictureOfLevel = W_CachePatchName("RANDOMLV", PU_CACHE); - w = SHORT(PictureOfLevel->width)/2; - i = SHORT(PictureOfLevel->height)/2; + w = PictureOfLevel->width/2; + i = PictureOfLevel->height/2; x = BASEVIDWIDTH/2 - w/2; y = currentMenu->y + 130 + 8 - i; diff --git a/src/r_data.c b/src/r_data.c index ec84cf3bf..de4d239fa 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -642,8 +642,8 @@ void R_LoadTextures(void) // Set texture properties. M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name)); - texture->width = SHORT(patchlump->width); - texture->height = SHORT(patchlump->height); + texture->width = patchlump->width; + texture->height = patchlump->height; texture->patchcount = 1; texture->holes = false; diff --git a/src/r_patch.c b/src/r_patch.c index 2320b9e52..665b50122 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -344,10 +344,10 @@ patch_t *Patch_Create(softwarepatch_t *source, size_t srcsize, void *dest) size_t size = sizeof(INT32) * source->width; size_t offs = (sizeof(INT16) * 4) + size; - patch->width = source->width; - patch->height = source->height; - patch->leftoffset = source->leftoffset; - patch->topoffset = source->topoffset; + patch->width = SHORT(source->width); + patch->height = SHORT(source->height); + patch->leftoffset = SHORT(source->leftoffset); + patch->topoffset = SHORT(source->topoffset); patch->columnofs = Z_Calloc(size, PU_CACHE, NULL); for (col = 0; col < source->width; col++) @@ -800,7 +800,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle } ox = (newwidth / 2) + (leftoffset - xpivot); - oy = (newheight / 2) + (SHORT(patch->topoffset) - ypivot); + oy = (newheight / 2) + (patch->topoffset - ypivot); width = (maxx - minx); height = (maxy - miny); diff --git a/src/r_segs.c b/src/r_segs.c index 313bae9b5..d1f46b6e8 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -173,7 +173,7 @@ static void R_DrawWallSplats(void) patch = W_CachePatchNum(splat->patch, PU_CACHE); - dc_texturemid = splat->top + (SHORT(patch->height)<<(FRACBITS-1)) - viewz; + dc_texturemid = splat->top + (patch->height<<(FRACBITS-1)) - viewz; if (splat->yoffset) dc_texturemid += *splat->yoffset; @@ -225,7 +225,7 @@ static void R_DrawWallSplats(void) // FIXME! texturecolumn >>= FRACBITS; - if (texturecolumn < 0 || texturecolumn >= SHORT(patch->width)) + if (texturecolumn < 0 || texturecolumn >= patch->width) continue; // draw the texture diff --git a/src/r_things.c b/src/r_things.c index 164e56814..57ec53e5e 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -297,10 +297,10 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, // store sprite info in lookup tables //FIXME : numspritelumps do not duplicate sprite replacements W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof (patch_t), 0); - spritecachedinfo[numspritelumps].width = (patch.width)<startfrac < 0 || vis->startfrac > (SHORT(patch->width) << FRACBITS)) + if (vis->startfrac < 0 || vis->startfrac > (patch->width << FRACBITS)) { // never draw vissprites with startfrac out of patch range return; @@ -814,7 +814,7 @@ static void R_DrawVisSprite(vissprite_t *vis) dc_colormap += COLORMAP_REMAPOFFSET; dc_texturemid = vis->texturemid; - dc_texheight = SHORT(patch->height); + dc_texheight = patch->height; frac = vis->startfrac; windowtop = windowbottom = sprbotscreen = INT32_MAX; @@ -858,8 +858,8 @@ static void R_DrawVisSprite(vissprite_t *vis) vis->x2 = vid.width-1; localcolfunc = (vis->vflip) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn; - lengthcol = SHORT(patch->height); - pwidth = SHORT(patch->width); + lengthcol = patch->height; + pwidth = patch->width; // Split drawing loops for paper and non-paper to reduce conditional checks per sprite if (vis->scalestep) @@ -938,7 +938,7 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis) dc_iscale = FixedDiv(FRACUNIT, vis->scale); dc_texturemid = FixedDiv(vis->texturemid, this_scale); - dc_texheight = SHORT(patch->height); + dc_texheight = patch->height; frac = vis->startfrac; spryscale = vis->scale; @@ -1391,10 +1391,10 @@ static void R_ProjectSprite(mobj_t *thing) if (rotsprite != NULL) { - spr_width = SHORT(rotsprite->width) << FRACBITS; - spr_height = SHORT(rotsprite->height) << FRACBITS; - spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS; - spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS; + spr_width = rotsprite->width << FRACBITS; + spr_height = rotsprite->height << FRACBITS; + spr_offset = rotsprite->leftoffset << FRACBITS; + spr_topoffset = rotsprite->topoffset << FRACBITS; spr_topoffset += FEETADJUST; // flip -> rotate, not rotate -> flip diff --git a/src/v_video.c b/src/v_video.c index e46acb14e..413829a8b 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -710,13 +710,13 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca // left offset if (scrn & V_FLIP) - offsetx = FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<width - patch->leftoffset)<leftoffset)<leftoffset<topoffset)<topoffset<width) == BASEVIDWIDTH && y == 0 && SHORT(patch->height) == BASEVIDHEIGHT) + if (x == 0 && patch->width == BASEVIDWIDTH && y == 0 && patch->height == BASEVIDHEIGHT) { column = (const column_t *)((const UINT8 *)(patch->columns) + (patch->columnofs[0])); if (!column->topdelta) @@ -797,18 +797,18 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca if (pscale != FRACUNIT) // scale width properly { - pwidth = SHORT(patch->width)<width<>= FRACBITS; } else - pwidth = SHORT(patch->width) * dupx; + pwidth = patch->width * dupx; deststart = desttop; destend = desttop + pwidth; - for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++) + for (col = 0; (col>>FRACBITS) < patch->width; col += colfrac, ++offx, desttop++) { INT32 topdelta, prevdelta = -1; if (scrn & V_FLIP) // offx is measured from right edge instead of left @@ -905,8 +905,8 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ colfrac = FixedDiv(FRACUNIT, fdup); rowfrac = FixedDiv(FRACUNIT, fdup); - y -= FixedMul(SHORT(patch->topoffset)<leftoffset)<topoffset<leftoffset<>FRACBITS) < SHORT(patch->width) && ((col>>FRACBITS) - sx) < w; col += colfrac, ++x, desttop++) + for (col = sx<>FRACBITS) < patch->width && ((col>>FRACBITS) - sx) < w; col += colfrac, ++x, desttop++) { INT32 topdelta, prevdelta = -1; if (x < 0) // don't draw off the left of the screen (WRAP PREVENTION) @@ -1505,7 +1505,7 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum) void V_DrawPatchFill(patch_t *pat) { INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); - INT32 x, y, pw = SHORT(pat->width) * dupz, ph = SHORT(pat->height) * dupz; + INT32 x, y, pw = pat->width * dupz, ph = pat->height * dupz; for (x = 0; x < vid.width; x += pw) { @@ -1706,7 +1706,7 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) return; - w = SHORT(hu_font[c]->width); + w = hu_font[c]->width; if (x + w > vid.width) return; @@ -1733,7 +1733,7 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) return; - w = SHORT(hu_font[c]->width)/2; + w = hu_font[c]->width/2; if (x + w > vid.width) return; @@ -1899,10 +1899,10 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) if (charwidth) { w = charwidth * dupx; - center = w/2 - SHORT(hu_font[c]->width)*dupx/2; + center = w/2 - hu_font[c]->width*dupx/2; } else - w = SHORT(hu_font[c]->width) * dupx; + w = hu_font[c]->width * dupx; if (cx > scrwidth) break; @@ -2001,10 +2001,10 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) if (charwidth) { w = charwidth * dupx; - center = w/2 - SHORT(kart_font[c]->width)*dupx/2; + center = w/2 - kart_font[c]->width*dupx/2; } else - w = SHORT(kart_font[c]->width) * dupx; + w = kart_font[c]->width * dupx; if (cx > scrwidth) break; @@ -2119,10 +2119,10 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) if (charwidth) { w = charwidth * dupx; - center = w/2 - SHORT(hu_font[c]->width)*dupx/4; + center = w/2 - hu_font[c]->width*dupx/4; } else - w = SHORT(hu_font[c]->width) * dupx / 2; + w = hu_font[c]->width * dupx / 2; if (cx > scrwidth) break; if (cx+left + w < 0) //left boundary check @@ -2236,8 +2236,8 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) if (charwidth) w = charwidth * dupx; else - w = ((option & V_6WIDTHSPACE ? max(1, SHORT(tny_font[c]->width)-1) // Reuse this flag for the alternate bunched-up spacing - : SHORT(tny_font[c]->width)) * dupx); + w = ((option & V_6WIDTHSPACE ? max(1, tny_font[c]->width-1) // Reuse this flag for the alternate bunched-up spacing + : tny_font[c]->width) * dupx); if (cx > scrwidth) break; @@ -2337,10 +2337,10 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) if (charwidth) { w = charwidth * dupx; - center = w/2 - SHORT(hu_font[c]->width)*(dupx/2); + center = w/2 - hu_font[c]->width*(dupx/2); } else - w = SHORT(hu_font[c]->width) * dupx; + w = hu_font[c]->width * dupx; if ((cx>>FRACBITS) > scrwidth) break; @@ -2535,10 +2535,10 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str if (charwidth) { w = charwidth * dupx; - center = w/2 - SHORT(tny_font[c]->width)*(dupx/2); + center = w/2 - tny_font[c]->width*(dupx/2); } else - w = SHORT(tny_font[c]->width) * dupx; + w = tny_font[c]->width * dupx; if ((cx>>FRACBITS) > scrwidth) break; @@ -2558,7 +2558,7 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str // Draws a tallnum. Replaces two functions in y_inter and st_stuff void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) { - INT32 w = SHORT(tallnum[0]->width); + INT32 w = tallnum[0]->width; boolean neg; if (flags & V_NOSCALESTART) @@ -2584,7 +2584,7 @@ void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) // Does not handle negative numbers in a special way, don't try to feed it any. void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits) { - INT32 w = SHORT(tallnum[0]->width); + INT32 w = tallnum[0]->width; if (flags & V_NOSCALESTART) w *= vid.dupx; @@ -2605,7 +2605,7 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits) // Does not handle negative numbers in a special way, don't try to feed it any. void V_DrawPaddedTallColorNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits, const UINT8 *colormap) { - INT32 w = SHORT(tallnum[0]->width); + INT32 w = tallnum[0]->width; if (flags & V_NOSCALESTART) w *= vid.dupx; @@ -2627,7 +2627,7 @@ void V_DrawPaddedTallColorNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 di INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap) { - INT32 w = SHORT(pingnum[0]->width); // this SHOULD always be 5 but I guess custom graphics exist. + INT32 w = pingnum[0]->width; // this SHOULD always be 5 but I guess custom graphics exist. if (flags & V_NOSCALESTART) w *= vid.dupx; @@ -2650,7 +2650,7 @@ INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *color // void V_DrawRankNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits, const UINT8 *colormap) { - INT32 w = SHORT(ranknum[0]->width) - 1; + INT32 w = ranknum[0]->width - 1; if (flags & V_NOSCALESTART) w *= vid.dupx; @@ -2709,7 +2709,7 @@ void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string) continue; } - w = SHORT(cred_font[c]->width) * dupx; + w = cred_font[c]->width * dupx; if ((cx>>FRACBITS) > scrwidth) break; @@ -2735,7 +2735,7 @@ INT32 V_CreditStringWidth(const char *string) if (c < 0 || c >= CRED_FONTSIZE) w += 16; else - w += SHORT(cred_font[c]->width); + w += cred_font[c]->width; } return w; @@ -2782,7 +2782,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string) continue; } - w = SHORT(lt_font[c]->width) * dupx; + w = lt_font[c]->width * dupx; if (cx > scrwidth) break; if (cx+left + w < 0) //left boundary check @@ -2809,7 +2809,7 @@ INT32 V_LevelNameWidth(const char *string) if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) w += 12; else - w += SHORT(lt_font[c]->width); + w += lt_font[c]->width; } return w; @@ -2828,8 +2828,8 @@ INT32 V_LevelNameHeight(const char *string) if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) continue; - if (SHORT(lt_font[c]->height) > w) - w = SHORT(lt_font[c]->height); + if (lt_font[c]->height > w) + w = lt_font[c]->height; } return w; @@ -2871,7 +2871,7 @@ INT32 V_SubStringWidth(const char *string, INT32 length, INT32 option) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) w += spacewidth; else - w += (charwidth ? charwidth : SHORT(hu_font[c]->width)); + w += (charwidth ? charwidth : hu_font[c]->width); } return w; @@ -2913,7 +2913,7 @@ INT32 V_SmallSubStringWidth(const char *string, INT32 length, INT32 option) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) w += spacewidth; else - w += (charwidth ? charwidth : SHORT(hu_font[c]->width)/2); + w += (charwidth ? charwidth : hu_font[c]->width/2); } return w; @@ -2965,8 +2965,8 @@ INT32 V_ThinSubStringWidth(const char *string, INT32 length, INT32 option) else { w += (charwidth ? charwidth - : ((option & V_6WIDTHSPACE && i < length-1) ? max(1, SHORT(tny_font[c]->width)-1) // Reuse this flag for the alternate bunched-up spacing - : SHORT(tny_font[c]->width))); + : ((option & V_6WIDTHSPACE && i < length-1) ? max(1, tny_font[c]->width-1) // Reuse this flag for the alternate bunched-up spacing + : tny_font[c]->width)); } } @@ -3007,7 +3007,7 @@ INT32 V_SubStringLengthToFit(const char *string, INT32 width, INT32 option) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) w += spacewidth; else - w += (charwidth ? charwidth : SHORT(hu_font[c]->width)); + w += (charwidth ? charwidth : hu_font[c]->width); } return max(i-1, 0); diff --git a/src/w_wad.c b/src/w_wad.c index 3642efe2f..0f298067d 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1814,7 +1814,6 @@ void *W_GetCachedRotPatchPwad(UINT16 wadnum, UINT16 lumpnum) return (void *)rspr; } - #endif // ROTSPRITE void W_UnlockCachedPatch(void *patch) diff --git a/src/y_inter.c b/src/y_inter.c index 213bf90d8..68ad7365a 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -923,8 +923,8 @@ static void Y_DrawAnimatedVoteScreenPatch(boolean widePatch) currentAnimFrame = 0; patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE); - V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(background->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) - (vid.height / vid.dupy) - SHORT(background->height), + V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (background->width/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) + (vid.height / vid.dupy) - background->height, V_SNAPTOTOP|V_SNAPTOLEFT, background); if (renderisnewtic && votetic % 2 == 0 && !paused) @@ -954,8 +954,8 @@ static void Y_DrawVoteScreenPatch(void) votebg = widebgpatch; } - V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(votebg->width)/2), - (vid.height / vid.dupy) - SHORT(votebg->height), + V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (votebg->width/2), + (vid.height / vid.dupy) - votebg->height, V_SNAPTOTOP|V_SNAPTOLEFT, votebg); }