Remove SHORT macros for referencing patch width/height/offsets

This commit is contained in:
Jaime Ita Passos 2020-11-22 20:02:47 -03:00
parent 2e21168395
commit 5293c52bca
13 changed files with 125 additions and 131 deletions

View File

@ -1682,7 +1682,7 @@ static void CON_DrawHudlines(void)
;//charwidth = 4 * con_scalefactor; ;//charwidth = 4 * con_scalefactor;
else 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, true); V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
} }
} }

View File

@ -507,7 +507,7 @@ static void D_Display(void)
else else
py = viewwindowy + 4; py = viewwindowy + 4;
patch = W_CachePatchName("M_PAUSE", PU_PATCH); patch = W_CachePatchName("M_PAUSE", PU_PATCH);
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch); V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, 0, patch);
#else #else
INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2)); INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2));
M_DrawTextBox((BASEVIDWIDTH/2) - (60), y - (16), 13, 2); M_DrawTextBox((BASEVIDWIDTH/2) - (60), y - (16), 13, 2);

View File

@ -2336,8 +2336,8 @@ void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname)
pat = W_CachePatchName(patchname, PU_PATCH_LOWPRIORITY); pat = W_CachePatchName(patchname, PU_PATCH_LOWPRIORITY);
patwidth = SHORT(pat->width); patwidth = pat->width;
patheight = SHORT(pat->height); patheight = pat->height;
pw = patwidth * dupz; pw = patwidth * dupz;
ph = patheight * dupz; ph = patheight * dupz;

View File

@ -1206,8 +1206,8 @@ static void HWR_DrawFadeMaskInCache(GLMipmap_t *mipmap, INT32 pblockwidth, INT32
W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum), W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum),
PU_HWRCACHE, &flat)); PU_HWRCACHE, &flat));
stepy = ((INT32)SHORT(fmheight)<<FRACBITS)/pblockheight; stepy = ((INT32)fmheight<<FRACBITS)/pblockheight;
stepx = ((INT32)SHORT(fmwidth)<<FRACBITS)/pblockwidth; stepx = ((INT32)fmwidth<<FRACBITS)/pblockwidth;
posy = 0; posy = 0;
for (j = 0; j < pblockheight; j++) for (j = 0; j < pblockheight; j++)
{ {

View File

@ -282,7 +282,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 (ONLY IF TOP LEFT ISN'T TRANSPARENT) // if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT)
// cx and cy are possibly *slightly* off from float maths // 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 // 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 && SHORT(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])); const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
if (!column->topdelta) if (!column->topdelta)
@ -427,8 +427,8 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
// fuck it, no GL support for croppedpatch v_perplayer right now. it's not like it's accessible to Lua or anything, and we only use it for menus... // fuck it, no GL support for croppedpatch v_perplayer right now. it's not like it's accessible to Lua or anything, and we only use it for menus...
cy -= (float)SHORT(gpatch->topoffset) * fscale; cy -= (float)(gpatch->topoffset) * fscale;
cx -= (float)SHORT(gpatch->leftoffset) * fscale; cx -= (float)(gpatch->leftoffset) * fscale;
if (!(option & V_NOSCALESTART)) if (!(option & V_NOSCALESTART))
{ {
@ -440,7 +440,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 (ONLY IF TOP LEFT ISN'T TRANSPARENT) // if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT)
// cx and cy are possibly *slightly* off from float maths // 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 // This is done before here compared to software because we directly alter cx and cy to centre
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(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])); const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
if (!column->topdelta) if (!column->topdelta)

View File

@ -1145,7 +1145,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
texturevpegtop += gl_sidedef->rowoffset; texturevpegtop += gl_sidedef->rowoffset;
// This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway // This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway
texturevpegtop %= SHORT(textures[gl_toptexture]->height)<<FRACBITS; texturevpegtop %= (textures[gl_toptexture]->height)<<FRACBITS;
wallVerts[3].t = wallVerts[2].t = texturevpegtop * grTex->scaleY; wallVerts[3].t = wallVerts[2].t = texturevpegtop * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (texturevpegtop + gl_frontsector->ceilingheight - gl_backsector->ceilingheight) * grTex->scaleY; wallVerts[0].t = wallVerts[1].t = (texturevpegtop + gl_frontsector->ceilingheight - gl_backsector->ceilingheight) * grTex->scaleY;
@ -1211,7 +1211,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
texturevpegbottom += gl_sidedef->rowoffset; texturevpegbottom += gl_sidedef->rowoffset;
// This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway // This is so that it doesn't overflow and screw up the wall, it doesn't need to go higher than the texture's height anyway
texturevpegbottom %= SHORT(textures[gl_bottomtexture]->height)<<FRACBITS; texturevpegbottom %= (textures[gl_bottomtexture]->height)<<FRACBITS;
wallVerts[3].t = wallVerts[2].t = texturevpegbottom * grTex->scaleY; wallVerts[3].t = wallVerts[2].t = texturevpegbottom * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (texturevpegbottom + gl_backsector->floorheight - gl_frontsector->floorheight) * grTex->scaleY; wallVerts[0].t = wallVerts[1].t = (texturevpegbottom + gl_backsector->floorheight - gl_frontsector->floorheight) * grTex->scaleY;

View File

@ -1794,8 +1794,8 @@ static void HU_DrawChat_Old(void)
size_t i = 0; size_t i = 0;
const char *ntalk = "Say: ", *ttalk = "Say-Team: "; const char *ntalk = "Say: ", *ttalk = "Say-Team: ";
const char *talk = ntalk; const char *talk = ntalk;
INT32 charwidth = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor; INT32 charwidth = 8 * con_scalefactor; //(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor;
INT32 charheight = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor; INT32 charheight = 8 * con_scalefactor; //(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor;
if (teamtalk) if (teamtalk)
{ {
talk = ttalk; talk = ttalk;
@ -1816,7 +1816,7 @@ static void HU_DrawChat_Old(void)
} }
else 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, true); V_DrawCharacter(HU_INPUTX + c, y, talk[i++] | cv_constextsize.value | V_NOSCALESTART, true);
} }
c += charwidth; c += charwidth;
@ -1844,7 +1844,7 @@ static void HU_DrawChat_Old(void)
} }
else else
{ {
//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[i++] | cv_constextsize.value | V_NOSCALESTART | t, true); V_DrawCharacter(HU_INPUTX + c, y, w_chat[i++] | cv_constextsize.value | V_NOSCALESTART | t, true);
} }
@ -2364,7 +2364,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
} }
if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED)) if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED))
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon); V_DrawSmallScaledPatch(x - exiticon->width/2 - 1, y-3, 0, exiticon);
if (gametyperankings[gametype] == GT_RACE) if (gametyperankings[gametype] == GT_RACE)
{ {
@ -2668,7 +2668,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico); V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);
if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED)) if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED))
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon); V_DrawSmallScaledPatch(x - exiticon->width/2 - 1, y-3, 0, exiticon);
// Draw emeralds // Draw emeralds
if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1)) if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
@ -3094,7 +3094,7 @@ static void HU_DrawCoopOverlay(void)
if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata)) if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata))
{ {
V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems)); V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems));
V_DrawScaledPatch(128, 144 - SHORT(emblemicon->height)/4, 0, emblemicon); V_DrawScaledPatch(128, 144 - emblemicon->height/4, 0, emblemicon);
} }
if (!LUA_HudEnabled(hud_coopemeralds)) if (!LUA_HudEnabled(hud_coopemeralds))

View File

@ -4031,7 +4031,7 @@ static void M_DrawThermo(INT32 x, INT32 y, consvar_t *cv)
cursorlump = W_GetNumForName("M_THERMO"); cursorlump = W_GetNumForName("M_THERMO");
V_DrawScaledPatch(xx, y, 0, p = W_CachePatchNum(leftlump,PU_PATCH)); V_DrawScaledPatch(xx, y, 0, p = W_CachePatchNum(leftlump,PU_PATCH));
xx += SHORT(p->width) - SHORT(p->leftoffset); xx += p->width - p->leftoffset;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {
V_DrawScaledPatch(xx, y, V_WRAPX, W_CachePatchNum(centerlump[i & 1], PU_PATCH)); V_DrawScaledPatch(xx, y, V_WRAPX, W_CachePatchNum(centerlump[i & 1], PU_PATCH));
@ -4170,7 +4170,7 @@ static void M_DrawStaticBox(fixed_t x, fixed_t y, INT32 flags, fixed_t w, fixed_
fixed_t sw, pw; fixed_t sw, pw;
patch = W_CachePatchName("LSSTATIC", PU_PATCH); patch = W_CachePatchName("LSSTATIC", PU_PATCH);
pw = SHORT(patch->width) - (sw = w*2); //FixedDiv(w, scale); -- for scale FRACUNIT/2 pw = patch->width - (sw = w*2); //FixedDiv(w, scale); -- for scale FRACUNIT/2
/*if (pw > 0) -- model code for modders providing weird LSSTATIC /*if (pw > 0) -- model code for modders providing weird LSSTATIC
{ {
@ -4267,8 +4267,8 @@ static void M_DrawMenuTitle(void)
if (p->height > 24) // title is larger than normal if (p->height > 24) // title is larger than normal
{ {
INT32 xtitle = (BASEVIDWIDTH - (SHORT(p->width)/2))/2; INT32 xtitle = (BASEVIDWIDTH - (p->width/2))/2;
INT32 ytitle = (30 - (SHORT(p->height)/2))/2; INT32 ytitle = (30 - (p->height/2))/2;
if (xtitle < 0) if (xtitle < 0)
xtitle = 0; xtitle = 0;
@ -4279,8 +4279,8 @@ static void M_DrawMenuTitle(void)
} }
else else
{ {
INT32 xtitle = (BASEVIDWIDTH - SHORT(p->width))/2; INT32 xtitle = (BASEVIDWIDTH - p->width)/2;
INT32 ytitle = (30 - SHORT(p->height))/2; INT32 ytitle = (30 - p->height)/2;
if (xtitle < 0) if (xtitle < 0)
xtitle = 0; xtitle = 0;
@ -4316,7 +4316,7 @@ static void M_DrawGenericMenu(void)
{ {
patch_t *p; patch_t *p;
p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_PATCH); p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_PATCH);
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, y, 0, p); V_DrawScaledPatch((BASEVIDWIDTH - p->width)/2, y, 0, p);
} }
else else
{ {
@ -4847,7 +4847,7 @@ static void M_DrawCenteredMenu(void)
{ {
patch_t *p; patch_t *p;
p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_PATCH); p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_PATCH);
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, y, 0, p); V_DrawScaledPatch((BASEVIDWIDTH - p->width)/2, y, 0, p);
} }
else else
{ {
@ -5695,7 +5695,7 @@ static void M_DrawRecordAttackForeground(void)
angle_t fa; angle_t fa;
INT32 i; INT32 i;
INT32 height = (SHORT(fg->height)/2); INT32 height = (fg->height / 2);
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
for (i = -12; i < (BASEVIDHEIGHT/height) + 12; i++) for (i = -12; i < (BASEVIDHEIGHT/height) + 12; i++)
@ -5730,9 +5730,9 @@ static void M_DrawNightsAttackMountains(void)
static INT32 bgscrollx; static INT32 bgscrollx;
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
patch_t *background = W_CachePatchName(curbgname, PU_PATCH); patch_t *background = W_CachePatchName(curbgname, PU_PATCH);
INT16 w = SHORT(background->width); INT16 w = background->width;
INT32 x = FixedInt(-bgscrollx) % w; INT32 x = FixedInt(-bgscrollx) % w;
INT32 y = BASEVIDHEIGHT - SHORT(background->height)*2; INT32 y = BASEVIDHEIGHT - (background->height * 2);
if (vid.height != BASEVIDHEIGHT * dupz) if (vid.height != BASEVIDHEIGHT * dupz)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 158); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 158);
@ -5757,18 +5757,18 @@ static void M_DrawNightsAttackBackground(void)
// top // top
patch_t *backtopfg = W_CachePatchName("NTSATKT1", PU_PATCH); patch_t *backtopfg = W_CachePatchName("NTSATKT1", PU_PATCH);
patch_t *fronttopfg = W_CachePatchName("NTSATKT2", PU_PATCH); patch_t *fronttopfg = W_CachePatchName("NTSATKT2", PU_PATCH);
INT32 backtopwidth = SHORT(backtopfg->width); INT32 backtopwidth = backtopfg->width;
//INT32 backtopheight = SHORT(backtopfg->height); //INT32 backtopheight = backtopfg->height;
INT32 fronttopwidth = SHORT(fronttopfg->width); INT32 fronttopwidth = fronttopfg->width;
//INT32 fronttopheight = SHORT(fronttopfg->height); //INT32 fronttopheight = fronttopfg->height;
// bottom // bottom
patch_t *backbottomfg = W_CachePatchName("NTSATKB1", PU_PATCH); patch_t *backbottomfg = W_CachePatchName("NTSATKB1", PU_PATCH);
patch_t *frontbottomfg = W_CachePatchName("NTSATKB2", PU_PATCH); patch_t *frontbottomfg = W_CachePatchName("NTSATKB2", PU_PATCH);
INT32 backbottomwidth = SHORT(backbottomfg->width); INT32 backbottomwidth = backbottomfg->width;
INT32 backbottomheight = SHORT(backbottomfg->height); INT32 backbottomheight = backbottomfg->height;
INT32 frontbottomwidth = SHORT(frontbottomfg->width); INT32 frontbottomwidth = frontbottomfg->width;
INT32 frontbottomheight = SHORT(frontbottomfg->height); INT32 frontbottomheight = frontbottomfg->height;
// background // background
M_DrawNightsAttackMountains(); M_DrawNightsAttackMountains();
@ -6151,7 +6151,7 @@ static void M_DrawMessageMenu(void)
} }
V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2,y,V_ALLOWLOWERCASE,string); 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;
} }
} }
@ -9165,10 +9165,10 @@ static void M_DrawSetupChoosePlayerMenu(void)
patch_t *charbg = W_CachePatchName("CHARBG", PU_PATCH); patch_t *charbg = W_CachePatchName("CHARBG", PU_PATCH);
patch_t *charfg = W_CachePatchName("CHARFG", PU_PATCH); patch_t *charfg = W_CachePatchName("CHARFG", PU_PATCH);
INT16 bgheight = SHORT(charbg->height); INT16 bgheight = charbg->height;
INT16 fgheight = SHORT(charfg->height); INT16 fgheight = charfg->height;
INT16 bgwidth = SHORT(charbg->width); INT16 bgwidth = charbg->width;
INT16 fgwidth = SHORT(charfg->width); INT16 fgwidth = charfg->width;
INT32 x, y; INT32 x, y;
INT32 w = (vid.width/vid.dupx); INT32 w = (vid.width/vid.dupx);
@ -9260,14 +9260,14 @@ static void M_DrawSetupChoosePlayerMenu(void)
curoutlinecolor = col = skincolors[charskin->prefcolor].invcolor; curoutlinecolor = col = skincolors[charskin->prefcolor].invcolor;
txsh = oxsh; txsh = oxsh;
ox = 8 + SHORT((description[char_on].charpic)->width)/2; ox = 8 + ((description[char_on].charpic)->width)/2;
y = my + 144; y = my + 144;
// cur // cur
{ {
x = ox - txsh; x = ox - txsh;
if (curpatch) if (curpatch)
x -= (SHORT(curpatch->width)/2); x -= curpatch->width / 2;
if (curtext[0] != '\0') if (curtext[0] != '\0')
{ {
@ -9300,7 +9300,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
x = (ox - txsh) - w; x = (ox - txsh) - w;
if (prevpatch) if (prevpatch)
x -= (SHORT(prevpatch->width)/2); x -= prevpatch->width / 2;
if (prevtext[0] != '\0') if (prevtext[0] != '\0')
{ {
@ -9330,7 +9330,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
x = (ox - txsh) + w; x = (ox - txsh) + w;
if (nextpatch) if (nextpatch)
x -= (SHORT(nextpatch->width)/2); x -= nextpatch->width / 2;
if (nexttext[0] != '\0') if (nexttext[0] != '\0')
{ {
@ -9352,7 +9352,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
{ {
patch_t *header = W_CachePatchName("M_PICKP", PU_PATCH); patch_t *header = W_CachePatchName("M_PICKP", PU_PATCH);
INT32 xtitle = 146; INT32 xtitle = 146;
INT32 ytitle = (35 - SHORT(header->height))/2; INT32 ytitle = (35 - header->height) / 2;
V_DrawFixedPatch(xtitle<<FRACBITS, ytitle<<FRACBITS, FRACUNIT/2, 0, header, NULL); V_DrawFixedPatch(xtitle<<FRACBITS, ytitle<<FRACBITS, FRACUNIT/2, 0, header, NULL);
} }
#endif // CHOOSEPLAYER_DRAWHEADER #endif // CHOOSEPLAYER_DRAWHEADER
@ -9818,8 +9818,8 @@ void M_DrawTimeAttackMenu(void)
empatch = W_CachePatchName(M_GetEmblemPatch(em, true), PU_PATCH); empatch = W_CachePatchName(M_GetEmblemPatch(em, true), PU_PATCH);
empatx = SHORT(empatch->leftoffset)/2; empatx = empatch->leftoffset / 2;
empaty = SHORT(empatch->topoffset)/2; empaty = empatch->topoffset / 2;
if (em->collected) if (em->collected)
V_DrawSmallMappedPatch(104+76+empatx, yHeight+lsheadingheight/2+empaty, 0, empatch, V_DrawSmallMappedPatch(104+76+empatx, yHeight+lsheadingheight/2+empaty, 0, empatch,
@ -10055,7 +10055,7 @@ void M_DrawNightsAttackMenu(void)
// Super Sonic // Super Sonic
M_DrawNightsAttackSuperSonic(); M_DrawNightsAttackSuperSonic();
//if (P_HasGrades(cv_nextmap.value, 0)) //if (P_HasGrades(cv_nextmap.value, 0))
// V_DrawScaledPatch(235 - (SHORT((ngradeletters[bestoverall])->width)*3)/2, 135, 0, ngradeletters[bestoverall]); // V_DrawScaledPatch(235 - (((ngradeletters[bestoverall])->width)*3)/2, 135, 0, ngradeletters[bestoverall]);
if (P_HasGrades(cv_nextmap.value, cv_dummymares.value)) if (P_HasGrades(cv_nextmap.value, cv_dummymares.value))
{//make bigger again {//make bigger again
@ -10612,7 +10612,7 @@ void M_DrawMarathon(void)
{ {
patch_t *fg = W_CachePatchName("RECATKFG", PU_PATCH); patch_t *fg = W_CachePatchName("RECATKFG", PU_PATCH);
INT32 trans = V_60TRANS+((cnt&~3)<<(V_ALPHASHIFT-2)); INT32 trans = V_60TRANS+((cnt&~3)<<(V_ALPHASHIFT-2));
INT32 height = (SHORT(fg->height)/2); INT32 height = fg->height / 2;
char patchname[7] = "CEMGx0"; char patchname[7] = "CEMGx0";
dupz = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain. dupz = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain.
@ -11382,7 +11382,7 @@ static void M_DrawServerMenu(void)
else else
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_PATCH); PictureOfLevel = W_CachePatchName("BLANKLVL", PU_PATCH);
V_DrawSmallScaledPatch(319 - (currentMenu->x + (SHORT(PictureOfLevel->width)/2)), currentMenu->y + imgheight, 0, PictureOfLevel); V_DrawSmallScaledPatch(319 - (currentMenu->x + (PictureOfLevel->width / 2)), currentMenu->y + imgheight, 0, PictureOfLevel);
} }
} }

View File

@ -31,13 +31,13 @@ patch_t *Patch_Create(softwarepatch_t *source, size_t srcsize, void *dest)
if (source) if (source)
{ {
INT32 col, colsize; INT32 col, colsize;
size_t size = sizeof(INT32) * source->width; size_t size = sizeof(INT32) * SHORT(source->width);
size_t offs = (sizeof(INT16) * 4) + size; size_t offs = (sizeof(INT16) * 4) + size;
patch->width = source->width; patch->width = SHORT(source->width);
patch->height = source->height; patch->height = SHORT(source->height);
patch->leftoffset = source->leftoffset; patch->leftoffset = SHORT(source->leftoffset);
patch->topoffset = source->topoffset; patch->topoffset = SHORT(source->topoffset);
patch->columnofs = Z_Calloc(size, PU_PATCH_DATA, NULL); patch->columnofs = Z_Calloc(size, PU_PATCH_DATA, NULL);
for (col = 0; col < source->width; col++) for (col = 0; col < source->width; col++)

View File

@ -297,10 +297,10 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
#endif #endif
{ {
W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof(INT16) * 4, 0); W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof(INT16) * 4, 0);
width = SHORT(patch.width); width = (INT32)(SHORT(patch.width));
height = SHORT(patch.height); height = (INT32)(SHORT(patch.height));
topoffset = SHORT(patch.topoffset); topoffset = (INT16)(SHORT(patch.topoffset));
leftoffset = SHORT(patch.leftoffset); leftoffset = (INT16)(SHORT(patch.leftoffset));
} }
spritecachedinfo[numspritelumps].width = width<<FRACBITS; spritecachedinfo[numspritelumps].width = width<<FRACBITS;
@ -308,14 +308,8 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
spritecachedinfo[numspritelumps].topoffset = topoffset<<FRACBITS; spritecachedinfo[numspritelumps].topoffset = topoffset<<FRACBITS;
spritecachedinfo[numspritelumps].height = height<<FRACBITS; spritecachedinfo[numspritelumps].height = height<<FRACBITS;
//BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer // BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer
if (rendermode != render_none) // not for psprite spritecachedinfo[numspritelumps].topoffset += FEETADJUST;
spritecachedinfo[numspritelumps].topoffset += FEETADJUST;
// Being selective with this causes bad things. :( Like the special stage tokens breaking apart.
/*if (rendermode != render_none // not for psprite
&& SHORT(patch.topoffset)>0 && SHORT(patch.topoffset)<SHORT(patch.height))
// perfect is patch.height but sometime it is too high
spritecachedinfo[numspritelumps].topoffset = min(SHORT(patch.topoffset)+(FEETADJUST>>FRACBITS),SHORT(patch.height))<<FRACBITS;*/
//---------------------------------------------------- //----------------------------------------------------
@ -896,7 +890,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
vis->x2 = vid.width-1; vis->x2 = vid.width-1;
localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn; localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn;
lengthcol = SHORT(patch->height); lengthcol = patch->height;
// Split drawing loops for paper and non-paper to reduce conditional checks per sprite // Split drawing loops for paper and non-paper to reduce conditional checks per sprite
if (vis->scalestep) if (vis->scalestep)
@ -904,7 +898,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
fixed_t horzscale = FixedMul(vis->spritexscale, this_scale); fixed_t horzscale = FixedMul(vis->spritexscale, this_scale);
fixed_t scalestep = FixedMul(vis->scalestep, vis->spriteyscale); fixed_t scalestep = FixedMul(vis->scalestep, vis->spriteyscale);
pwidth = SHORT(patch->width); pwidth = patch->width;
// Papersprite drawing loop // Papersprite drawing loop
for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, spryscale += scalestep) for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, spryscale += scalestep)
@ -929,7 +923,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
else if (vis->cut & SC_SHEAR) else if (vis->cut & SC_SHEAR)
{ {
#ifdef RANGECHECK #ifdef RANGECHECK
pwidth = SHORT(patch->width); pwidth = patch->width;
#endif #endif
// Vertically sheared sprite // Vertically sheared sprite
@ -951,7 +945,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
else else
{ {
#ifdef RANGECHECK #ifdef RANGECHECK
pwidth = SHORT(patch->width); pwidth = patch->width;
#endif #endif
// Non-paper drawing loop // Non-paper drawing loop
@ -1025,7 +1019,7 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis)
#ifdef RANGECHECK #ifdef RANGECHECK
texturecolumn = frac>>FRACBITS; texturecolumn = frac>>FRACBITS;
if (texturecolumn < 0 || texturecolumn >= SHORT(patch->width)) if (texturecolumn < 0 || texturecolumn >= patch->width)
I_Error("R_DrawPrecipitationSpriteRange: bad texturecolumn"); I_Error("R_DrawPrecipitationSpriteRange: bad texturecolumn");
column = (column_t *)((UINT8 *)patch->columns + (patch->columnofs[texturecolumn])); column = (column_t *)((UINT8 *)patch->columns + (patch->columnofs[texturecolumn]));

View File

@ -458,7 +458,7 @@ boolean st_overlay;
static void ST_DrawNightsOverlayNum(fixed_t x /* right border */, fixed_t y, fixed_t s, INT32 a, static void ST_DrawNightsOverlayNum(fixed_t x /* right border */, fixed_t y, fixed_t s, INT32 a,
UINT32 num, patch_t **numpat, skincolornum_t colornum) UINT32 num, patch_t **numpat, skincolornum_t colornum)
{ {
fixed_t w = SHORT(numpat[0]->width)*s; fixed_t w = numpat[0]->width * s;
const UINT8 *colormap; const UINT8 *colormap;
// I want my V_SNAPTOx flags. :< -Red // I want my V_SNAPTOx flags. :< -Red
@ -676,7 +676,7 @@ static void ST_drawRaceNum(INT32 time)
if (!(P_AutoPause() || paused) && !bounce) if (!(P_AutoPause() || paused) && !bounce)
S_StartSound(0, ((racenum == racego) ? sfx_s3kad : sfx_s3ka7)); S_StartSound(0, ((racenum == racego) ? sfx_s3kad : sfx_s3ka7));
} }
V_DrawScaledPatch(((BASEVIDWIDTH - SHORT(racenum->width))/2), height, V_PERPLAYER, racenum); V_DrawScaledPatch(((BASEVIDWIDTH - racenum->width)/2), height, V_PERPLAYER, racenum);
} }
static void ST_drawTime(void) static void ST_drawTime(void)
@ -1625,8 +1625,8 @@ static void ST_drawFirstPersonHUD(void)
p = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE); p = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE);
// Display the countdown drown numbers! // Display the countdown drown numbers!
if (p && !F_GetPromptHideHud(60 - SHORT(p->topoffset))) if (p && !F_GetPromptHideHud(60 - p->topoffset))
V_DrawScaledPatch((BASEVIDWIDTH/2) - (SHORT(p->width)/2) + SHORT(p->leftoffset), 60 - SHORT(p->topoffset), V_DrawScaledPatch((BASEVIDWIDTH/2) - (p->width / 2) + SHORT(p->leftoffset), 60 - SHORT(p->topoffset),
V_PERPLAYER|V_PERPLAYER|V_TRANSLUCENT, p); V_PERPLAYER|V_PERPLAYER|V_TRANSLUCENT, p);
} }
@ -2379,7 +2379,7 @@ static void ST_drawTeamHUD(void)
p = bmatcico; p = bmatcico;
if (LUA_HudEnabled(hud_teamscores)) if (LUA_HudEnabled(hud_teamscores))
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - (p->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
if (gametyperules & GTR_TEAMFLAGS) if (gametyperules & GTR_TEAMFLAGS)
p = rflagico; p = rflagico;
@ -2387,7 +2387,7 @@ static void ST_drawTeamHUD(void)
p = rmatcico; p = rmatcico;
if (LUA_HudEnabled(hud_teamscores)) if (LUA_HudEnabled(hud_teamscores))
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p); V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - (p->width / 4), 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
if (!(gametyperules & GTR_TEAMFLAGS)) if (!(gametyperules & GTR_TEAMFLAGS))
goto num; goto num;
@ -2400,11 +2400,11 @@ static void ST_drawTeamHUD(void)
{ {
// Blue flag isn't at base // Blue flag isn't at base
if (players[i].gotflag & GF_BLUEFLAG && LUA_HudEnabled(hud_teamscores)) if (players[i].gotflag & GF_BLUEFLAG && LUA_HudEnabled(hud_teamscores))
V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(nonicon->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon); V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - (nonicon->width / 2), 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon);
// Red flag isn't at base // Red flag isn't at base
if (players[i].gotflag & GF_REDFLAG && LUA_HudEnabled(hud_teamscores)) if (players[i].gotflag & GF_REDFLAG && LUA_HudEnabled(hud_teamscores))
V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2); V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - (nonicon2->width / 2), 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2);
whichflag |= players[i].gotflag; whichflag |= players[i].gotflag;
@ -2677,7 +2677,7 @@ static void ST_overlayDrawer(void)
else else
{ {
tic_t num = time; tic_t num = time;
INT32 sz = SHORT(tallnum[0]->width)/2, width = 0; INT32 sz = tallnum[0]->width / 2, width = 0;
do do
{ {
width += sz; width += sz;

View File

@ -599,13 +599,13 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
// left offset // left offset
if (scrn & V_FLIP) if (scrn & V_FLIP)
offsetx = FixedMul((SHORT(patch->width) - SHORT(patch->leftoffset))<<FRACBITS, pscale) + 1; offsetx = FixedMul((patch->width - patch->leftoffset)<<FRACBITS, pscale) + 1;
else else
offsetx = FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); offsetx = FixedMul(patch->leftoffset<<FRACBITS, pscale);
// top offset // top offset
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!? // TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
offsety = FixedMul(SHORT(patch->topoffset)<<FRACBITS, vscale); offsety = FixedMul(patch->topoffset<<FRACBITS, vscale);
if ((scrn & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs if ((scrn & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs
{ {
@ -712,7 +712,7 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
if (!(scrn & V_SCALEPATCHMASK)) if (!(scrn & V_SCALEPATCHMASK))
{ {
// if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT) // if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT)
if (x == 0 && SHORT(patch->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])); column = (const column_t *)((const UINT8 *)(patch->columns) + (patch->columnofs[0]));
if (!column->topdelta) if (!column->topdelta)
@ -754,18 +754,18 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
if (pscale != FRACUNIT) // scale width properly if (pscale != FRACUNIT) // scale width properly
{ {
pwidth = SHORT(patch->width)<<FRACBITS; pwidth = patch->width<<FRACBITS;
pwidth = FixedMul(pwidth, pscale); pwidth = FixedMul(pwidth, pscale);
pwidth = FixedMul(pwidth, dupx<<FRACBITS); pwidth = FixedMul(pwidth, dupx<<FRACBITS);
pwidth >>= FRACBITS; pwidth >>= FRACBITS;
} }
else else
pwidth = SHORT(patch->width) * dupx; pwidth = patch->width * dupx;
deststart = desttop; deststart = desttop;
destend = desttop + pwidth; 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; INT32 topdelta, prevdelta = -1;
if (scrn & V_FLIP) // offx is measured from right edge instead of left if (scrn & V_FLIP) // offx is measured from right edge instead of left
@ -862,8 +862,8 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
colfrac = FixedDiv(FRACUNIT, fdup); colfrac = FixedDiv(FRACUNIT, fdup);
rowfrac = FixedDiv(FRACUNIT, fdup); rowfrac = FixedDiv(FRACUNIT, fdup);
y -= FixedMul(SHORT(patch->topoffset)<<FRACBITS, pscale); y -= FixedMul(patch->topoffset<<FRACBITS, pscale);
x -= FixedMul(SHORT(patch->leftoffset)<<FRACBITS, pscale); x -= FixedMul(patch->leftoffset<<FRACBITS, pscale);
if (splitscreen && (scrn & V_PERPLAYER)) if (splitscreen && (scrn & V_PERPLAYER))
{ {
@ -998,7 +998,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
desttop += (y*vid.width) + x; desttop += (y*vid.width) + x;
} }
for (col = sx<<FRACBITS; (col>>FRACBITS) < SHORT(patch->width) && ((col>>FRACBITS) - sx) < w; col += colfrac, ++x, desttop++) for (col = sx<<FRACBITS; (col>>FRACBITS) < patch->width && ((col>>FRACBITS) - sx) < w; col += colfrac, ++x, desttop++)
{ {
INT32 topdelta, prevdelta = -1; INT32 topdelta, prevdelta = -1;
if (x < 0) // don't draw off the left of the screen (WRAP PREVENTION) if (x < 0) // don't draw off the left of the screen (WRAP PREVENTION)
@ -1796,7 +1796,7 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum)
void V_DrawPatchFill(patch_t *pat) void V_DrawPatchFill(patch_t *pat)
{ {
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); 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) for (x = 0; x < vid.width; x += pw)
{ {
@ -1984,7 +1984,7 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed)
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
return; return;
w = SHORT(hu_font[c]->width); w = hu_font[c]->width;
if (x + w > vid.width) if (x + w > vid.width)
return; return;
@ -2011,7 +2011,7 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
return; return;
w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. w = (vid.width < 640 ) ? ((hu_font[c]->width / 2)) : (hu_font[c]->width); // use normal sized characters if we're using a terribly low resolution.
if (x + w > vid.width) if (x + w > vid.width)
return; return;
@ -2173,10 +2173,10 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
if (charwidth) if (charwidth)
{ {
w = charwidth * dupx; w = charwidth * dupx;
center = w/2 - SHORT(hu_font[c]->width)*dupx/2; center = w/2 - hu_font[c]->width*dupx/2;
} }
else else
w = SHORT(hu_font[c]->width) * dupx; w = hu_font[c]->width * dupx;
if (cx > scrwidth) if (cx > scrwidth)
continue; continue;
@ -2290,10 +2290,10 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
if (charwidth) if (charwidth)
{ {
w = charwidth * dupx; w = charwidth * dupx;
center = w/2 - SHORT(hu_font[c]->width)*dupx/4; center = w/2 - hu_font[c]->width*dupx/4;
} }
else else
w = SHORT(hu_font[c]->width) * dupx / 2; w = hu_font[c]->width * dupx / 2;
if (cx > scrwidth) if (cx > scrwidth)
continue; continue;
@ -2408,7 +2408,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
if (charwidth) if (charwidth)
w = charwidth * dupx; w = charwidth * dupx;
else else
w = (SHORT(tny_font[c]->width) * dupx); w = tny_font[c]->width * dupx;
if (cx > scrwidth) if (cx > scrwidth)
continue; continue;
@ -2547,10 +2547,10 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
if (charwidth) if (charwidth)
{ {
w = charwidth * dupx; w = charwidth * dupx;
center = w/2 - SHORT(hu_font[c]->width)*(dupx/2); center = w/2 - hu_font[c]->width*(dupx/2);
} }
else else
w = SHORT(hu_font[c]->width) * dupx; w = hu_font[c]->width * dupx;
if ((cx>>FRACBITS) > scrwidth) if ((cx>>FRACBITS) > scrwidth)
continue; continue;
@ -2663,10 +2663,10 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st
if (charwidth) if (charwidth)
{ {
w = charwidth * dupx; w = charwidth * dupx;
center = w/2 - SHORT(hu_font[c]->width)*(dupx/4); center = w/2 - hu_font[c]->width*(dupx/4);
} }
else else
w = SHORT(hu_font[c]->width) * dupx / 2; w = hu_font[c]->width * dupx / 2;
if ((cx>>FRACBITS) > scrwidth) if ((cx>>FRACBITS) > scrwidth)
break; break;
@ -2780,10 +2780,10 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str
if (charwidth) if (charwidth)
{ {
w = charwidth * dupx; w = charwidth * dupx;
center = w/2 - SHORT(tny_font[c]->width)*(dupx/2); center = w/2 - tny_font[c]->width*(dupx/2);
} }
else else
w = SHORT(tny_font[c]->width) * dupx; w = tny_font[c]->width * dupx;
if ((cx>>FRACBITS) > scrwidth) if ((cx>>FRACBITS) > scrwidth)
break; break;
@ -2897,10 +2897,10 @@ void V_DrawSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char
if (charwidth) if (charwidth)
{ {
w = FixedMul(charwidth, dupx); w = FixedMul(charwidth, dupx);
center = w/2 - SHORT(tny_font[c]->width)*(dupx/4); center = w/2 - tny_font[c]->width*(dupx/4);
} }
else else
w = SHORT(tny_font[c]->width) * dupx / 2; w = tny_font[c]->width * dupx / 2;
if (cx > scrwidth) if (cx > scrwidth)
break; break;
@ -2933,7 +2933,7 @@ void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option
// Draws a tallnum. Replaces two functions in y_inter and st_stuff // Draws a tallnum. Replaces two functions in y_inter and st_stuff
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num) void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num)
{ {
INT32 w = SHORT(tallnum[0]->width); INT32 w = tallnum[0]->width;
boolean neg; boolean neg;
if (flags & (V_NOSCALESTART|V_NOSCALEPATCH)) if (flags & (V_NOSCALESTART|V_NOSCALEPATCH))
@ -2959,7 +2959,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. // 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) 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|V_NOSCALEPATCH)) if (flags & (V_NOSCALESTART|V_NOSCALEPATCH))
w *= vid.dupx; w *= vid.dupx;
@ -3036,7 +3036,7 @@ void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string)
continue; continue;
} }
w = SHORT(cred_font[c]->width) * dupx; w = cred_font[c]->width * dupx;
if ((cx>>FRACBITS) > scrwidth) if ((cx>>FRACBITS) > scrwidth)
continue; continue;
@ -3098,7 +3098,7 @@ static void V_DrawNameTagLine(INT32 x, INT32 y, INT32 option, fixed_t scale, UIN
continue; continue;
} }
w = FixedMul((SHORT(ntb_font[c]->width)+2 * dupx) * FRACUNIT, scale); w = FixedMul(((ntb_font[c]->width)+2 * dupx) * FRACUNIT, scale);
if (FixedInt(cx) > scrwidth) if (FixedInt(cx) > scrwidth)
continue; continue;
@ -3239,7 +3239,7 @@ INT32 V_NameTagWidth(const char *string)
if (c < 0 || c >= NT_FONTSIZE || !ntb_font[c] || !nto_font[c]) if (c < 0 || c >= NT_FONTSIZE || !ntb_font[c] || !nto_font[c])
w += 4; w += 4;
else else
w += SHORT(ntb_font[c]->width)+2; w += (ntb_font[c]->width)+2;
} }
return w; return w;
@ -3262,7 +3262,7 @@ INT32 V_CreditStringWidth(const char *string)
if (c < 0 || c >= CRED_FONTSIZE) if (c < 0 || c >= CRED_FONTSIZE)
w += 16; w += 16;
else else
w += SHORT(cred_font[c]->width); w += cred_font[c]->width;
} }
return w; return w;
@ -3320,7 +3320,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
continue; continue;
} }
w = SHORT(lt_font[c]->width) * dupx; w = lt_font[c]->width * dupx;
if (cx > scrwidth) if (cx > scrwidth)
continue; continue;
@ -3352,7 +3352,7 @@ INT32 V_LevelNameWidth(const char *string)
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
w += 16; w += 16;
else else
w += SHORT(lt_font[c]->width); w += lt_font[c]->width;
} }
return w; return w;
@ -3371,8 +3371,8 @@ INT32 V_LevelNameHeight(const char *string)
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
continue; continue;
if (SHORT(lt_font[c]->height) > w) if (lt_font[c]->height > w)
w = SHORT(lt_font[c]->height); w = lt_font[c]->height;
} }
return w; return w;
@ -3385,11 +3385,11 @@ INT16 V_LevelActNumWidth(UINT8 num)
INT16 result = 0; INT16 result = 0;
if (num == 0) if (num == 0)
result = SHORT(ttlnum[num]->width); result = ttlnum[num]->width;
while (num > 0 && num <= 99) while (num > 0 && num <= 99)
{ {
result = result + SHORT(ttlnum[num%10]->width); result = result + ttlnum[num%10]->width;
num = num/10; num = num/10;
} }
@ -3427,7 +3427,7 @@ INT32 V_StringWidth(const char *string, INT32 option)
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
w += spacewidth; w += spacewidth;
else else
w += (charwidth ? charwidth : SHORT(hu_font[c]->width)); w += (charwidth ? charwidth : hu_font[c]->width);
} }
if (option & (V_NOSCALESTART|V_NOSCALEPATCH)) if (option & (V_NOSCALESTART|V_NOSCALEPATCH))
@ -3467,7 +3467,7 @@ INT32 V_SmallStringWidth(const char *string, INT32 option)
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
w += spacewidth; w += spacewidth;
else else
w += (charwidth ? charwidth : SHORT(hu_font[c]->width)/2); w += (charwidth ? charwidth : (hu_font[c]->width / 2));
} }
return w; return w;
@ -3504,7 +3504,7 @@ INT32 V_ThinStringWidth(const char *string, INT32 option)
if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) if (c < 0 || c >= HU_FONTSIZE || !tny_font[c])
w += spacewidth; w += spacewidth;
else else
w += (charwidth ? charwidth : SHORT(tny_font[c]->width)); w += (charwidth ? charwidth : tny_font[c]->width);
} }
return w; return w;

View File

@ -183,7 +183,7 @@ static void Y_IntermissionTokenDrawer(void)
offs = 0; offs = 0;
lowy = BASEVIDHEIGHT - 32 - 8; lowy = BASEVIDHEIGHT - 32 - 8;
temp = SHORT(tokenicon->height)/2; temp = tokenicon->height / 2;
em = 0; em = 0;
while (emeralds & (1 << em)) while (emeralds & (1 << em))
@ -212,7 +212,7 @@ static void Y_IntermissionTokenDrawer(void)
calc = (lowy - y)*2; calc = (lowy - y)*2;
if (calc > 0) if (calc > 0)
V_DrawCroppedPatch(32<<FRACBITS, y<<FRACBITS, FRACUNIT/2, 0, tokenicon, 0, 0, SHORT(tokenicon->width), calc); V_DrawCroppedPatch(32<<FRACBITS, y<<FRACBITS, FRACUNIT/2, 0, tokenicon, 0, 0, tokenicon->width, calc);
} }
// //
@ -402,7 +402,7 @@ void Y_IntermissionDrawer(void)
// Total // Total
V_DrawScaledPatch(152, bonusy, 0, data.coop.ptotal); V_DrawScaledPatch(152, bonusy, 0, data.coop.ptotal);
V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.total); V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.total);
bonusy -= (3*SHORT(tallnum[0]->height)/2) + 1; bonusy -= (3*(tallnum[0]->height)/2) + 1;
// Draw bonuses // Draw bonuses
for (i = 3; i >= 0; --i) for (i = 3; i >= 0; --i)
@ -412,7 +412,7 @@ void Y_IntermissionDrawer(void)
V_DrawScaledPatch(152, bonusy, 0, data.coop.bonuspatches[i]); V_DrawScaledPatch(152, bonusy, 0, data.coop.bonuspatches[i]);
V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.bonuses[i].points); V_DrawTallNum(BASEVIDWIDTH - 68, bonusy + 1, 0, data.coop.bonuses[i].points);
} }
bonusy -= (3*SHORT(tallnum[0]->height)/2) + 1; bonusy -= (3*(tallnum[0]->height)/2) + 1;
} }
} }
else if (intertype == int_spec) else if (intertype == int_spec)
@ -749,10 +749,10 @@ void Y_IntermissionDrawer(void)
char name[MAXPLAYERNAME+1]; char name[MAXPLAYERNAME+1];
// Show the team flags and the team score at the top instead of "RESULTS" // Show the team flags and the team score at the top instead of "RESULTS"
V_DrawSmallScaledPatch(128 - SHORT(data.match.blueflag->width)/4, 2, 0, data.match.blueflag); V_DrawSmallScaledPatch(128 - (data.match.blueflag->width / 4), 2, 0, data.match.blueflag);
V_DrawCenteredString(128, 16, 0, va("%u", bluescore)); V_DrawCenteredString(128, 16, 0, va("%u", bluescore));
V_DrawSmallScaledPatch(192 - SHORT(data.match.redflag->width)/4, 2, 0, data.match.redflag); V_DrawSmallScaledPatch(192 - (data.match.redflag->width / 4), 2, 0, data.match.redflag);
V_DrawCenteredString(192, 16, 0, va("%u", redscore)); V_DrawCenteredString(192, 16, 0, va("%u", redscore));
// draw the level name // draw the level name