Skip to content

Commit

Permalink
Backport VPT_STRETCH
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Dec 29, 2014
1 parent 63f7030 commit 9ba6b3a
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 102 deletions.
4 changes: 2 additions & 2 deletions src/d_main.c
Expand Up @@ -274,7 +274,7 @@ void D_Display (void)
if (paused && (menuactive != mnact_full)) {
// Simplified the "logic" here and no need for x-coord caching - POPE
V_DrawNamePatch((320 - V_NamePatchWidth("M_PAUSE"))/2, 4,
0, "M_PAUSE", CR_DEFAULT, VPT_NONE);
0, "M_PAUSE", CR_DEFAULT, VPT_STRETCH);
}

// menus go directly to the screen
Expand Down Expand Up @@ -339,7 +339,7 @@ static void D_PageDrawer(void)
// proff - added M_DrawCredits
if (pagename)
{
V_DrawNamePatch(0, 0, 0, pagename, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, pagename, CR_DEFAULT, VPT_STRETCH);
}
else
M_DrawCredits();
Expand Down
1 change: 1 addition & 0 deletions src/doomtype.h
Expand Up @@ -112,6 +112,7 @@ enum patch_translation_e {
VPT_NONE = 0, // Normal
VPT_FLIP = 1, // Flip image horizontally
VPT_TRANS = 2, // Translate image via a translation table
VPT_STRETCH = 4, // Stretch to compensate for high-res
};

#endif
28 changes: 14 additions & 14 deletions src/f_finale.c
Expand Up @@ -304,7 +304,7 @@ static void F_TextWrite (void)
if (cx+w > SCREENWIDTH)
break;
// CPhipps - patch drawing updated
V_DrawNumPatch(cx, cy, 0, hu_font[c].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(cx, cy, 0, hu_font[c].lumpnum, CR_DEFAULT, VPT_STRETCH);
cx+=w;
}
}
Expand Down Expand Up @@ -547,7 +547,7 @@ static void F_CastPrint (const char* text) // CPhipps - static, const char*

w = hu_font[c].width;
// CPhipps - patch drawing updated
V_DrawNumPatch(cx, 180, 0, hu_font[c].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(cx, 180, 0, hu_font[c].lumpnum, CR_DEFAULT, VPT_STRETCH);
cx+=w;
}
}
Expand All @@ -566,7 +566,7 @@ void F_CastDrawer (void)

// erase the entire screen to a background
// CPhipps - patch drawing updated
V_DrawNamePatch(0,0,0, bgcastcall, CR_DEFAULT, VPT_NONE); // Ty 03/30/98 bg texture extern
V_DrawNamePatch(0,0,0, bgcastcall, CR_DEFAULT, VPT_STRETCH); // Ty 03/30/98 bg texture extern

F_CastPrint (*(castorder[castnum].name));

Expand All @@ -578,7 +578,7 @@ void F_CastDrawer (void)

// CPhipps - patch drawing updated
V_DrawNumPatch(160, 170, 0, lump+firstspritelump, CR_DEFAULT,
(flip ? VPT_FLIP : 0));
VPT_STRETCH | (flip ? VPT_FLIP : 0));
}

//
Expand All @@ -596,12 +596,12 @@ static void F_BunnyScroll (void)
{
int scrolled = 320 - (finalecount-230)/2;
if (scrolled <= 0) {
V_DrawNamePatch(0, 0, 0, pfub2, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, pfub2, CR_DEFAULT, VPT_STRETCH);
} else if (scrolled >= 320) {
V_DrawNamePatch(0, 0, 0, pfub1, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, pfub1, CR_DEFAULT, VPT_STRETCH);
} else {
V_DrawNamePatch(320-scrolled, 0, 0, pfub1, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(-scrolled, 0, 0, pfub2, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(320-scrolled, 0, 0, pfub1, CR_DEFAULT, VPT_STRETCH);
V_DrawNamePatch(-scrolled, 0, 0, pfub2, CR_DEFAULT, VPT_STRETCH);
}
}

Expand All @@ -610,7 +610,7 @@ static void F_BunnyScroll (void)
if (finalecount < 1180)
{
// CPhipps - patch drawing updated
V_DrawNamePatch((320-13*8)/2, (200-8*8)/2,0, "END0", CR_DEFAULT, VPT_NONE);
V_DrawNamePatch((320-13*8)/2, (200-8*8)/2,0, "END0", CR_DEFAULT, VPT_STRETCH);
laststage = 0;
return;
}
Expand All @@ -626,7 +626,7 @@ static void F_BunnyScroll (void)

sprintf (name,"END%i",stage);
// CPhipps - patch drawing updated
V_DrawNamePatch((320-13*8)/2, (200-8*8)/2, 0, name, CR_DEFAULT, VPT_NONE);
V_DrawNamePatch((320-13*8)/2, (200-8*8)/2, 0, name, CR_DEFAULT, VPT_STRETCH);
}


Expand All @@ -650,18 +650,18 @@ void F_Drawer (void)
// CPhipps - patch drawing updated
case 1:
if ( gamemode == retail )
V_DrawNamePatch(0, 0, 0, "CREDIT", CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, "CREDIT", CR_DEFAULT, VPT_STRETCH);
else
V_DrawNamePatch(0, 0, 0, "HELP2", CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, "HELP2", CR_DEFAULT, VPT_STRETCH);
break;
case 2:
V_DrawNamePatch(0, 0, 0, "VICTORY2", CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, "VICTORY2", CR_DEFAULT, VPT_STRETCH);
break;
case 3:
F_BunnyScroll ();
break;
case 4:
V_DrawNamePatch(0, 0, 0, "ENDPIC", CR_DEFAULT, VPT_NONE);
V_DrawNamePatch(0, 0, 0, "ENDPIC", CR_DEFAULT, VPT_STRETCH);
break;
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/hu_lib.c
Expand Up @@ -184,7 +184,7 @@ void HUlib_drawTextLine
break;
// killough 1/18/98 -- support multiple lines:
// CPhipps - patch drawing updated
V_DrawNumPatch(x, y, FG, l->f[c - l->sc].lumpnum, l->cm, VPT_TRANS);
V_DrawNumPatch(x, y, FG, l->f[c - l->sc].lumpnum, l->cm, VPT_TRANS | VPT_STRETCH);
x += w;
}
else
Expand All @@ -201,7 +201,7 @@ void HUlib_drawTextLine
{
// killough 1/18/98 -- support multiple lines
// CPhipps - patch drawing updated
V_DrawNumPatch(x, y, FG, l->f['_' - l->sc].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(x, y, FG, l->f['_' - l->sc].lumpnum, CR_DEFAULT, VPT_NONE | VPT_STRETCH);
}
}

Expand Down Expand Up @@ -468,25 +468,25 @@ void HUlib_drawMBg

// CPhipps - patch drawing updated
// top rows
V_DrawNumPatch(x, y, FG, bgp[0].lumpnum, CR_DEFAULT, VPT_NONE); // ul
V_DrawNumPatch(x, y, FG, bgp[0].lumpnum, CR_DEFAULT, VPT_STRETCH); // ul
for (j=x+xs;j<x+w-xs;j+=xs) // uc
V_DrawNumPatch(j, y, FG, bgp[1].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(j, y, FG, bgp[2].lumpnum, CR_DEFAULT, VPT_NONE); // ur
V_DrawNumPatch(j, y, FG, bgp[1].lumpnum, CR_DEFAULT, VPT_STRETCH);
V_DrawNumPatch(j, y, FG, bgp[2].lumpnum, CR_DEFAULT, VPT_STRETCH); // ur

// middle rows
for (i=y+ys;i<y+h-ys;i+=ys)
{
V_DrawNumPatch(x, i, FG, bgp[3].lumpnum, CR_DEFAULT, VPT_NONE); // cl
V_DrawNumPatch(x, i, FG, bgp[3].lumpnum, CR_DEFAULT, VPT_STRETCH); // cl
for (j=x+xs;j<x+w-xs;j+=xs) // cc
V_DrawNumPatch(j, i, FG, bgp[4].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(j, i, FG, bgp[5].lumpnum, CR_DEFAULT, VPT_NONE); // cr
V_DrawNumPatch(j, i, FG, bgp[4].lumpnum, CR_DEFAULT, VPT_STRETCH);
V_DrawNumPatch(j, i, FG, bgp[5].lumpnum, CR_DEFAULT, VPT_STRETCH); // cr
}

// bottom row
V_DrawNumPatch(x, i, FG, bgp[6].lumpnum, CR_DEFAULT, VPT_NONE); // ll
V_DrawNumPatch(x, i, FG, bgp[6].lumpnum, CR_DEFAULT, VPT_STRETCH); // ll
for (j=x+xs;j<x+w-xs;j+=xs) // lc
V_DrawNumPatch(j, i, FG, bgp[7].lumpnum, CR_DEFAULT, VPT_NONE);
V_DrawNumPatch(j, i, FG, bgp[8].lumpnum, CR_DEFAULT, VPT_NONE); // lr
V_DrawNumPatch(j, i, FG, bgp[7].lumpnum, CR_DEFAULT, VPT_STRETCH);
V_DrawNumPatch(j, i, FG, bgp[8].lumpnum, CR_DEFAULT, VPT_STRETCH); // lr
}

//
Expand Down

0 comments on commit 9ba6b3a

Please sign in to comment.