mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Merge branch 'combine-dupx-and-dupy' into 'next'
Combine vid.dupx and vid.dupy See merge request STJr/SRB2!1118
This commit is contained in:
commit
d6a0006b75
14 changed files with 408 additions and 475 deletions
|
@ -543,13 +543,13 @@ static void CON_RecalcSize(void)
|
||||||
con_scalefactor = 1;
|
con_scalefactor = 1;
|
||||||
break;
|
break;
|
||||||
case V_SMALLSCALEPATCH:
|
case V_SMALLSCALEPATCH:
|
||||||
con_scalefactor = vid.smalldupx;
|
con_scalefactor = vid.smalldup;
|
||||||
break;
|
break;
|
||||||
case V_MEDSCALEPATCH:
|
case V_MEDSCALEPATCH:
|
||||||
con_scalefactor = vid.meddupx;
|
con_scalefactor = vid.meddup;
|
||||||
break;
|
break;
|
||||||
default: // Full scaling
|
default: // Full scaling
|
||||||
con_scalefactor = vid.dupx;
|
con_scalefactor = vid.dup;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ static void CON_MoveConsole(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not instant - Increment fracmovement fractionally
|
// Not instant - Increment fracmovement fractionally
|
||||||
fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
|
fracmovement += FixedMul(cons_speed.value*vid.fdup, renderdeltatics);
|
||||||
|
|
||||||
if (con_curlines < con_destlines) // Move the console downwards
|
if (con_curlines < con_destlines) // Move the console downwards
|
||||||
{
|
{
|
||||||
|
@ -1764,9 +1764,9 @@ static void CON_DrawBackpic(void)
|
||||||
con_backpic = W_CachePatchNum(piclump, PU_PATCH);
|
con_backpic = W_CachePatchNum(piclump, PU_PATCH);
|
||||||
|
|
||||||
// Center the backpic, and draw a vertically cropped patch.
|
// Center the backpic, and draw a vertically cropped patch.
|
||||||
w = (con_backpic->width * vid.dupx);
|
w = con_backpic->width * vid.dup;
|
||||||
x = (vid.width / 2) - (w / 2);
|
x = (vid.width / 2) - (w / 2);
|
||||||
h = con_curlines/vid.dupy;
|
h = con_curlines/vid.dup;
|
||||||
|
|
||||||
// If the patch doesn't fill the entire screen,
|
// If the patch doesn't fill the entire screen,
|
||||||
// then fill the sides with a solid color.
|
// then fill the sides with a solid color.
|
||||||
|
|
|
@ -1327,7 +1327,7 @@ void F_CreditDrawer(void)
|
||||||
y += 12<<FRACBITS;
|
y += 12<<FRACBITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (FixedMul(y,vid.dupy) > vid.height)
|
if (FixedMul(y,vid.dup) > vid.height)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1362,7 @@ void F_CreditTicker(void)
|
||||||
case 1: y += 30<<FRACBITS; break;
|
case 1: y += 30<<FRACBITS; break;
|
||||||
default: y += 12<<FRACBITS; break;
|
default: y += 12<<FRACBITS; break;
|
||||||
}
|
}
|
||||||
if (FixedMul(y,vid.dupy) > vid.height)
|
if (FixedMul(y,vid.dup) > vid.height)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2082,7 +2082,7 @@ void F_EndingDrawer(void)
|
||||||
if (goodending && finalecount >= TICRATE && finalecount < INFLECTIONPOINT)
|
if (goodending && finalecount >= TICRATE && finalecount < INFLECTIONPOINT)
|
||||||
{
|
{
|
||||||
INT32 workingtime = finalecount - TICRATE;
|
INT32 workingtime = finalecount - TICRATE;
|
||||||
fixed_t radius = ((vid.width/vid.dupx)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE);
|
fixed_t radius = ((vid.width/vid.dup)*(INFLECTIONPOINT - TICRATE - workingtime))/(INFLECTIONPOINT - TICRATE);
|
||||||
angle_t fa;
|
angle_t fa;
|
||||||
INT32 eemeralds_cur[4];
|
INT32 eemeralds_cur[4];
|
||||||
char patchname[7] = "CEMGx0";
|
char patchname[7] = "CEMGx0";
|
||||||
|
@ -2287,7 +2287,6 @@ void F_InitMenuPresValues(void)
|
||||||
void F_SkyScroll(const char *patchname)
|
void F_SkyScroll(const char *patchname)
|
||||||
{
|
{
|
||||||
INT32 x, basey = 0;
|
INT32 x, basey = 0;
|
||||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
|
||||||
patch_t *pat;
|
patch_t *pat;
|
||||||
|
|
||||||
if (rendermode == render_none)
|
if (rendermode == render_none)
|
||||||
|
@ -2315,17 +2314,17 @@ void F_SkyScroll(const char *patchname)
|
||||||
curbgy %= pat->height * 16;
|
curbgy %= pat->height * 16;
|
||||||
|
|
||||||
// Ooh, fancy frame interpolation
|
// Ooh, fancy frame interpolation
|
||||||
x = ((curbgx*dupz) + FixedInt((rendertimefrac-FRACUNIT) * curbgxspeed*dupz)) / 16;
|
x = ((curbgx*vid.dup) + FixedInt((rendertimefrac-FRACUNIT) * curbgxspeed*vid.dup)) / 16;
|
||||||
basey = ((curbgy*dupz) + FixedInt((rendertimefrac-FRACUNIT) * curbgyspeed*dupz)) / 16;
|
basey = ((curbgy*vid.dup) + FixedInt((rendertimefrac-FRACUNIT) * curbgyspeed*vid.dup)) / 16;
|
||||||
|
|
||||||
if (x > 0) // Make sure that we don't leave the left or top sides empty
|
if (x > 0) // Make sure that we don't leave the left or top sides empty
|
||||||
x -= pat->width * dupz;
|
x -= pat->width * vid.dup;
|
||||||
if (basey > 0)
|
if (basey > 0)
|
||||||
basey -= pat->height * dupz;
|
basey -= pat->height * vid.dup;
|
||||||
|
|
||||||
for (; x < vid.width; x += pat->width * dupz)
|
for (; x < vid.width; x += pat->width * vid.dup)
|
||||||
{
|
{
|
||||||
for (INT32 y = basey; y < vid.height; y += pat->height * dupz)
|
for (INT32 y = basey; y < vid.height; y += pat->height * vid.dup)
|
||||||
V_DrawScaledPatch(x, y, V_NOSCALESTART, pat);
|
V_DrawScaledPatch(x, y, V_NOSCALESTART, pat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2603,7 +2602,7 @@ static void F_LoadAlacroixGraphics(SINT8 newttscale)
|
||||||
|
|
||||||
static void F_FigureActiveTtScale(void)
|
static void F_FigureActiveTtScale(void)
|
||||||
{
|
{
|
||||||
SINT8 newttscale = max(1, min(6, vid.dupx));
|
SINT8 newttscale = max(1, min(6, vid.dup));
|
||||||
SINT8 oldttscale = activettscale;
|
SINT8 oldttscale = activettscale;
|
||||||
|
|
||||||
if (newttscale == testttscale)
|
if (newttscale == testttscale)
|
||||||
|
@ -4095,7 +4094,7 @@ static fixed_t F_GetPromptHideHudBound(void)
|
||||||
F_GetPageTextGeometry(&pagelines, &rightside, &boxh, &texth, &texty, &namey, &chevrony, &textx, &textr);
|
F_GetPageTextGeometry(&pagelines, &rightside, &boxh, &texth, &texty, &namey, &chevrony, &textx, &textr);
|
||||||
|
|
||||||
// calc boxheight (see V_DrawPromptBack)
|
// calc boxheight (see V_DrawPromptBack)
|
||||||
boxh *= vid.dupy;
|
boxh *= vid.dup;
|
||||||
boxh = (boxh * 4) + (boxh/2)*5; // 4 lines of space plus gaps between and some leeway
|
boxh = (boxh * 4) + (boxh/2)*5; // 4 lines of space plus gaps between and some leeway
|
||||||
|
|
||||||
// return a coordinate to check
|
// return a coordinate to check
|
||||||
|
|
|
@ -78,10 +78,8 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||||
// | /|
|
// | /|
|
||||||
// |/ |
|
// |/ |
|
||||||
// 0--1
|
// 0--1
|
||||||
float sdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
|
float sdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
|
||||||
float sdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
|
float pdup = FIXED_TO_FLOAT(vid.fdup)*2.0f;
|
||||||
float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
|
|
||||||
float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
|
|
||||||
|
|
||||||
// make patch ready in hardware cache
|
// make patch ready in hardware cache
|
||||||
HWR_GetPatch(gpatch);
|
HWR_GetPatch(gpatch);
|
||||||
|
@ -90,25 +88,23 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
||||||
switch (option & V_SCALEPATCHMASK)
|
switch (option & V_SCALEPATCHMASK)
|
||||||
{
|
{
|
||||||
case V_NOSCALEPATCH:
|
case V_NOSCALEPATCH:
|
||||||
pdupx = pdupy = 2.0f;
|
pdup = 2.0f;
|
||||||
break;
|
break;
|
||||||
case V_SMALLSCALEPATCH:
|
case V_SMALLSCALEPATCH:
|
||||||
pdupx = 2.0f * FIXED_TO_FLOAT(vid.fsmalldupx);
|
pdup = 2.0f * FIXED_TO_FLOAT(vid.fsmalldup);
|
||||||
pdupy = 2.0f * FIXED_TO_FLOAT(vid.fsmalldupy);
|
|
||||||
break;
|
break;
|
||||||
case V_MEDSCALEPATCH:
|
case V_MEDSCALEPATCH:
|
||||||
pdupx = 2.0f * FIXED_TO_FLOAT(vid.fmeddupx);
|
pdup = 2.0f * FIXED_TO_FLOAT(vid.fmeddup);
|
||||||
pdupy = 2.0f * FIXED_TO_FLOAT(vid.fmeddupy);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option & V_NOSCALESTART)
|
if (option & V_NOSCALESTART)
|
||||||
sdupx = sdupy = 2.0f;
|
sdup = 2.0f;
|
||||||
|
|
||||||
v[0].x = v[3].x = (x*sdupx-(gpatch->leftoffset)*pdupx)/vid.width - 1;
|
v[0].x = v[3].x = (x*sdup-(gpatch->leftoffset)*pdup)/vid.width - 1;
|
||||||
v[2].x = v[1].x = (x*sdupx+(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
|
v[2].x = v[1].x = (x*sdup+(gpatch->width-gpatch->leftoffset)*pdup)/vid.width - 1;
|
||||||
v[0].y = v[1].y = 1-(y*sdupy-(gpatch->topoffset)*pdupy)/vid.height;
|
v[0].y = v[1].y = 1-(y*sdup-(gpatch->topoffset)*pdup)/vid.height;
|
||||||
v[2].y = v[3].y = 1-(y*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
|
v[2].y = v[3].y = 1-(y*sdup+(gpatch->height-gpatch->topoffset)*pdup)/vid.height;
|
||||||
|
|
||||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||||
|
|
||||||
|
@ -137,7 +133,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||||
// | /|
|
// | /|
|
||||||
// |/ |
|
// |/ |
|
||||||
// 0--1
|
// 0--1
|
||||||
float dupx, dupy, fscalew, fscaleh, fwidth, fheight;
|
float dup, fscalew, fscaleh, fwidth, fheight;
|
||||||
|
|
||||||
UINT8 perplayershuffle = 0;
|
UINT8 perplayershuffle = 0;
|
||||||
|
|
||||||
|
@ -149,25 +145,21 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||||
|
|
||||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||||
|
|
||||||
dupx = (float)vid.dupx;
|
dup = (float)vid.dup;
|
||||||
dupy = (float)vid.dupy;
|
|
||||||
|
|
||||||
switch (option & V_SCALEPATCHMASK)
|
switch (option & V_SCALEPATCHMASK)
|
||||||
{
|
{
|
||||||
case V_NOSCALEPATCH:
|
case V_NOSCALEPATCH:
|
||||||
dupx = dupy = 1.0f;
|
dup = 1.0f;
|
||||||
break;
|
break;
|
||||||
case V_SMALLSCALEPATCH:
|
case V_SMALLSCALEPATCH:
|
||||||
dupx = (float)vid.smalldupx;
|
dup = (float)vid.smalldup;
|
||||||
dupy = (float)vid.smalldupy;
|
|
||||||
break;
|
break;
|
||||||
case V_MEDSCALEPATCH:
|
case V_MEDSCALEPATCH:
|
||||||
dupx = (float)vid.meddupx;
|
dup = (float)vid.meddup;
|
||||||
dupy = (float)vid.meddupy;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dupx = dupy = (dupx < dupy ? dupx : dupy);
|
|
||||||
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
||||||
if (vscale != pscale)
|
if (vscale != pscale)
|
||||||
fscaleh = FIXED_TO_FLOAT(vscale);
|
fscaleh = FIXED_TO_FLOAT(vscale);
|
||||||
|
@ -261,8 +253,8 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||||
|
|
||||||
if (!(option & V_NOSCALESTART))
|
if (!(option & V_NOSCALESTART))
|
||||||
{
|
{
|
||||||
cx = cx * dupx;
|
cx = cx * dup;
|
||||||
cy = cy * dupy;
|
cy = cy * dup;
|
||||||
|
|
||||||
if (!(option & V_SCALEPATCHMASK))
|
if (!(option & V_SCALEPATCHMASK))
|
||||||
{
|
{
|
||||||
|
@ -279,40 +271,40 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// centre screen
|
// centre screen
|
||||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (option & V_SNAPTORIGHT)
|
if (option & V_SNAPTORIGHT)
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||||
else if (!(option & V_SNAPTOLEFT))
|
else if (!(option & V_SNAPTOLEFT))
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/2;
|
||||||
if (perplayershuffle & 4)
|
if (perplayershuffle & 4)
|
||||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||||
else if (perplayershuffle & 8)
|
else if (perplayershuffle & 8)
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||||
}
|
}
|
||||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (option & V_SNAPTOBOTTOM)
|
if (option & V_SNAPTOBOTTOM)
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||||
else if (!(option & V_SNAPTOTOP))
|
else if (!(option & V_SNAPTOTOP))
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/2;
|
||||||
if (perplayershuffle & 1)
|
if (perplayershuffle & 1)
|
||||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||||
else if (perplayershuffle & 2)
|
else if (perplayershuffle & 2)
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
||||||
{
|
{
|
||||||
fwidth = (float)(gpatch->width) * fscalew * dupx;
|
fwidth = (float)(gpatch->width) * fscalew * dup;
|
||||||
fheight = (float)(gpatch->height) * fscaleh * dupy;
|
fheight = (float)(gpatch->height) * fscaleh * dup;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fwidth = (float)(gpatch->width) * dupx;
|
fwidth = (float)(gpatch->width) * dup;
|
||||||
fheight = (float)(gpatch->height) * dupy;
|
fheight = (float)(gpatch->height) * dup;
|
||||||
}
|
}
|
||||||
|
|
||||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||||
|
@ -379,7 +371,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
// | /|
|
// | /|
|
||||||
// |/ |
|
// |/ |
|
||||||
// 0--1
|
// 0--1
|
||||||
float dupx, dupy, fscalew, fscaleh, fwidth, fheight;
|
float dup, fscalew, fscaleh, fwidth, fheight;
|
||||||
|
|
||||||
UINT8 perplayershuffle = 0;
|
UINT8 perplayershuffle = 0;
|
||||||
|
|
||||||
|
@ -391,25 +383,21 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
|
|
||||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||||
|
|
||||||
dupx = (float)vid.dupx;
|
dup = (float)vid.dup;
|
||||||
dupy = (float)vid.dupy;
|
|
||||||
|
|
||||||
switch (option & V_SCALEPATCHMASK)
|
switch (option & V_SCALEPATCHMASK)
|
||||||
{
|
{
|
||||||
case V_NOSCALEPATCH:
|
case V_NOSCALEPATCH:
|
||||||
dupx = dupy = 1.0f;
|
dup = 1.0f;
|
||||||
break;
|
break;
|
||||||
case V_SMALLSCALEPATCH:
|
case V_SMALLSCALEPATCH:
|
||||||
dupx = (float)vid.smalldupx;
|
dup = (float)vid.smalldup;
|
||||||
dupy = (float)vid.smalldupy;
|
|
||||||
break;
|
break;
|
||||||
case V_MEDSCALEPATCH:
|
case V_MEDSCALEPATCH:
|
||||||
dupx = (float)vid.meddupx;
|
dup = (float)vid.meddup;
|
||||||
dupy = (float)vid.meddupy;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dupx = dupy = (dupx < dupy ? dupx : dupy);
|
|
||||||
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
fscalew = fscaleh = FIXED_TO_FLOAT(pscale);
|
||||||
if (vscale != pscale)
|
if (vscale != pscale)
|
||||||
fscaleh = FIXED_TO_FLOAT(vscale);
|
fscaleh = FIXED_TO_FLOAT(vscale);
|
||||||
|
@ -487,8 +475,8 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
|
|
||||||
if (!(option & V_NOSCALESTART))
|
if (!(option & V_NOSCALESTART))
|
||||||
{
|
{
|
||||||
cx = cx * dupx;
|
cx = cx * dup;
|
||||||
cy = cy * dupy;
|
cy = cy * dup;
|
||||||
|
|
||||||
if (!(option & V_SCALEPATCHMASK))
|
if (!(option & V_SCALEPATCHMASK))
|
||||||
{
|
{
|
||||||
|
@ -496,27 +484,27 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
// no the patch is cropped do not do this ever
|
// no the patch is cropped do not do this ever
|
||||||
|
|
||||||
// centre screen
|
// centre screen
|
||||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (option & V_SNAPTORIGHT)
|
if (option & V_SNAPTORIGHT)
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||||
else if (!(option & V_SNAPTOLEFT))
|
else if (!(option & V_SNAPTOLEFT))
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/2;
|
||||||
if (perplayershuffle & 4)
|
if (perplayershuffle & 4)
|
||||||
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
cx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||||
else if (perplayershuffle & 8)
|
else if (perplayershuffle & 8)
|
||||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/4;
|
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dup))/4;
|
||||||
}
|
}
|
||||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (option & V_SNAPTOBOTTOM)
|
if (option & V_SNAPTOBOTTOM)
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||||
else if (!(option & V_SNAPTOTOP))
|
else if (!(option & V_SNAPTOTOP))
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/2;
|
||||||
if (perplayershuffle & 1)
|
if (perplayershuffle & 1)
|
||||||
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
cy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||||
else if (perplayershuffle & 2)
|
else if (perplayershuffle & 2)
|
||||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/4;
|
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup))/4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -532,13 +520,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
||||||
|
|
||||||
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
if (pscale != FRACUNIT || vscale != FRACUNIT || (splitscreen && option & V_PERPLAYER))
|
||||||
{
|
{
|
||||||
fwidth *= fscalew * dupx;
|
fwidth *= fscalew * dup;
|
||||||
fheight *= fscaleh * dupy;
|
fheight *= fscaleh * dup;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fwidth *= dupx;
|
fwidth *= dup;
|
||||||
fheight *= dupy;
|
fheight *= dup;
|
||||||
}
|
}
|
||||||
|
|
||||||
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
// positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1
|
||||||
|
@ -674,9 +662,9 @@ void HWR_DrawPic(INT32 x, INT32 y, lumpnum_t lumpnum)
|
||||||
// 0--1
|
// 0--1
|
||||||
|
|
||||||
v[0].x = v[3].x = 2.0f * (float)x/vid.width - 1;
|
v[0].x = v[3].x = 2.0f * (float)x/vid.width - 1;
|
||||||
v[2].x = v[1].x = 2.0f * (float)(x + patch->width*FIXED_TO_FLOAT(vid.fdupx))/vid.width - 1;
|
v[2].x = v[1].x = 2.0f * (float)(x + patch->width*FIXED_TO_FLOAT(vid.fdup))/vid.width - 1;
|
||||||
v[0].y = v[1].y = 1.0f - 2.0f * (float)y/vid.height;
|
v[0].y = v[1].y = 1.0f - 2.0f * (float)y/vid.height;
|
||||||
v[2].y = v[3].y = 1.0f - 2.0f * (float)(y + patch->height*FIXED_TO_FLOAT(vid.fdupy))/vid.height;
|
v[2].y = v[3].y = 1.0f - 2.0f * (float)(y + patch->height*FIXED_TO_FLOAT(vid.fdup))/vid.height;
|
||||||
|
|
||||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||||
|
|
||||||
|
@ -866,35 +854,33 @@ void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 ac
|
||||||
|
|
||||||
if (!(color & V_NOSCALESTART))
|
if (!(color & V_NOSCALESTART))
|
||||||
{
|
{
|
||||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
fx *= vid.dup;
|
||||||
|
fy *= vid.dup;
|
||||||
|
fw *= vid.dup;
|
||||||
|
fh *= vid.dup;
|
||||||
|
|
||||||
fx *= dupx;
|
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * vid.dup) > 1.0E-36f)
|
||||||
fy *= dupy;
|
|
||||||
fw *= dupx;
|
|
||||||
fh *= dupy;
|
|
||||||
|
|
||||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
|
||||||
{
|
{
|
||||||
if (color & V_SNAPTORIGHT)
|
if (color & V_SNAPTORIGHT)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup));
|
||||||
else if (!(color & V_SNAPTOLEFT))
|
else if (!(color & V_SNAPTOLEFT))
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 2;
|
||||||
if (perplayershuffle & 4)
|
if (perplayershuffle & 4)
|
||||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||||
else if (perplayershuffle & 8)
|
else if (perplayershuffle & 8)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||||
}
|
}
|
||||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * vid.dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
// same thing here
|
// same thing here
|
||||||
if (color & V_SNAPTOBOTTOM)
|
if (color & V_SNAPTOBOTTOM)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup));
|
||||||
else if (!(color & V_SNAPTOTOP))
|
else if (!(color & V_SNAPTOTOP))
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 2;
|
||||||
if (perplayershuffle & 1)
|
if (perplayershuffle & 1)
|
||||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||||
else if (perplayershuffle & 2)
|
else if (perplayershuffle & 2)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1032,10 +1018,10 @@ void HWR_DrawViewBorder(INT32 clearlines)
|
||||||
clearlines = BASEVIDHEIGHT; // refresh all
|
clearlines = BASEVIDHEIGHT; // refresh all
|
||||||
|
|
||||||
// calc view size based on original game resolution
|
// calc view size based on original game resolution
|
||||||
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdup)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
|
||||||
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
|
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdup));
|
||||||
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
|
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdup));
|
||||||
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdupx));
|
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdup));
|
||||||
|
|
||||||
// top
|
// top
|
||||||
HWR_DrawFlatFill(0, 0,
|
HWR_DrawFlatFill(0, 0,
|
||||||
|
@ -1250,35 +1236,35 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32
|
||||||
|
|
||||||
if (!(color & V_NOSCALESTART))
|
if (!(color & V_NOSCALESTART))
|
||||||
{
|
{
|
||||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
float dup = (float)vid.dup;
|
||||||
|
|
||||||
fx *= dupx;
|
fx *= dup;
|
||||||
fy *= dupy;
|
fy *= dup;
|
||||||
fw *= dupx;
|
fw *= dup;
|
||||||
fh *= dupy;
|
fh *= dup;
|
||||||
|
|
||||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (color & V_SNAPTORIGHT)
|
if (color & V_SNAPTORIGHT)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup));
|
||||||
else if (!(color & V_SNAPTOLEFT))
|
else if (!(color & V_SNAPTOLEFT))
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 2;
|
||||||
if (perplayershuffle & 4)
|
if (perplayershuffle & 4)
|
||||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 4;
|
||||||
else if (perplayershuffle & 8)
|
else if (perplayershuffle & 8)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dup)) / 4;
|
||||||
}
|
}
|
||||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
// same thing here
|
// same thing here
|
||||||
if (color & V_SNAPTOBOTTOM)
|
if (color & V_SNAPTOBOTTOM)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup));
|
||||||
else if (!(color & V_SNAPTOTOP))
|
else if (!(color & V_SNAPTOTOP))
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 2;
|
||||||
if (perplayershuffle & 1)
|
if (perplayershuffle & 1)
|
||||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 4;
|
||||||
else if (perplayershuffle & 2)
|
else if (perplayershuffle & 2)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dup)) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1416,8 +1402,6 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||||
|
|
||||||
if (!(color & V_NOSCALESTART))
|
if (!(color & V_NOSCALESTART))
|
||||||
{
|
{
|
||||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
|
||||||
|
|
||||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||||
{
|
{
|
||||||
RGBA_t rgbaColour = V_GetColor(color);
|
RGBA_t rgbaColour = V_GetColor(color);
|
||||||
|
@ -1430,33 +1414,33 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fx *= dupx;
|
fx *= vid.dup;
|
||||||
fy *= dupy;
|
fy *= vid.dup;
|
||||||
fw *= dupx;
|
fw *= vid.dup;
|
||||||
fh *= dupy;
|
fh *= vid.dup;
|
||||||
|
|
||||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * vid.dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
if (color & V_SNAPTORIGHT)
|
if (color & V_SNAPTORIGHT)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup));
|
||||||
else if (!(color & V_SNAPTOLEFT))
|
else if (!(color & V_SNAPTOLEFT))
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 2;
|
||||||
if (perplayershuffle & 4)
|
if (perplayershuffle & 4)
|
||||||
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx -= ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||||
else if (perplayershuffle & 8)
|
else if (perplayershuffle & 8)
|
||||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 4;
|
fx += ((float)vid.width - ((float)BASEVIDWIDTH * vid.dup)) / 4;
|
||||||
}
|
}
|
||||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * vid.dup) > 1.0E-36f)
|
||||||
{
|
{
|
||||||
// same thing here
|
// same thing here
|
||||||
if (color & V_SNAPTOBOTTOM)
|
if (color & V_SNAPTOBOTTOM)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup));
|
||||||
else if (!(color & V_SNAPTOTOP))
|
else if (!(color & V_SNAPTOTOP))
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 2;
|
||||||
if (perplayershuffle & 1)
|
if (perplayershuffle & 1)
|
||||||
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy -= ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||||
else if (perplayershuffle & 2)
|
else if (perplayershuffle & 2)
|
||||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 4;
|
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * vid.dup)) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1206,19 +1206,11 @@ static int libd_height(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int libd_dupx(lua_State *L)
|
static int libd_dup(lua_State *L)
|
||||||
{
|
{
|
||||||
HUDONLY
|
HUDONLY
|
||||||
lua_pushinteger(L, vid.dupx); // push integral scale (patch scale)
|
lua_pushinteger(L, vid.dup); // push integral scale (patch scale)
|
||||||
lua_pushfixed(L, vid.fdupx); // push fixed point scale (position scale)
|
lua_pushfixed(L, vid.fdup); // push fixed point scale (position scale)
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int libd_dupy(lua_State *L)
|
|
||||||
{
|
|
||||||
HUDONLY
|
|
||||||
lua_pushinteger(L, vid.dupy); // push integral scale (patch scale)
|
|
||||||
lua_pushfixed(L, vid.fdupy); // push fixed point scale (position scale)
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1338,8 +1330,8 @@ static luaL_Reg lib_draw[] = {
|
||||||
// properties
|
// properties
|
||||||
{"width", libd_width},
|
{"width", libd_width},
|
||||||
{"height", libd_height},
|
{"height", libd_height},
|
||||||
{"dupx", libd_dupx},
|
{"dupx", libd_dup},
|
||||||
{"dupy", libd_dupy},
|
{"dupy", libd_dup},
|
||||||
{"renderer", libd_renderer},
|
{"renderer", libd_renderer},
|
||||||
{"localTransFlag", libd_getlocaltransflag},
|
{"localTransFlag", libd_getlocaltransflag},
|
||||||
{"userTransFlag", libd_getusertransflag},
|
{"userTransFlag", libd_getusertransflag},
|
||||||
|
|
|
@ -462,7 +462,7 @@ static void GIF_headwrite(void)
|
||||||
// Image width/height
|
// Image width/height
|
||||||
if (gif_downscale)
|
if (gif_downscale)
|
||||||
{
|
{
|
||||||
scrbuf_downscaleamt = vid.dupx;
|
scrbuf_downscaleamt = vid.dup;
|
||||||
rwidth = (vid.width / scrbuf_downscaleamt);
|
rwidth = (vid.width / scrbuf_downscaleamt);
|
||||||
rheight = (vid.height / scrbuf_downscaleamt);
|
rheight = (vid.height / scrbuf_downscaleamt);
|
||||||
}
|
}
|
||||||
|
|
61
src/m_menu.c
61
src/m_menu.c
|
@ -214,7 +214,7 @@ static fixed_t lsoffs[2];
|
||||||
#define lshli levelselectselect[2]
|
#define lshli levelselectselect[2]
|
||||||
|
|
||||||
#define lshseperation 101
|
#define lshseperation 101
|
||||||
#define lsbasevseperation ((62*vid.height)/(BASEVIDHEIGHT*vid.dupy)) //62
|
#define lsbasevseperation ((62*vid.height)/(BASEVIDHEIGHT*vid.dup)) //62
|
||||||
#define lsheadingheight 16
|
#define lsheadingheight 16
|
||||||
#define getheadingoffset(row) (levelselect.rows[row].header[0] ? lsheadingheight : 0)
|
#define getheadingoffset(row) (levelselect.rows[row].header[0] ? lsheadingheight : 0)
|
||||||
#define lsvseperation(row) (lsbasevseperation + getheadingoffset(row))
|
#define lsvseperation(row) (lsbasevseperation + getheadingoffset(row))
|
||||||
|
@ -3574,16 +3574,16 @@ void M_Drawer(void)
|
||||||
{
|
{
|
||||||
if (customversionstring[0] != '\0')
|
if (customversionstring[0] != '\0')
|
||||||
{
|
{
|
||||||
V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:");
|
V_DrawThinString(vid.dup, vid.height - 17*vid.dup, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:");
|
||||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring);
|
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef DEVELOP // Development -- show revision / branch info
|
#ifdef DEVELOP // Development -- show revision / branch info
|
||||||
V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
|
V_DrawThinString(vid.dup, vid.height - 17*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
|
||||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
|
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
|
||||||
#else // Regular build
|
#else // Regular build
|
||||||
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
|
V_DrawThinString(vid.dup, vid.height - 9*vid.dup, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5757,16 +5757,15 @@ static void M_DrawRecordAttackForeground(void)
|
||||||
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 height = (fg->height / 2);
|
INT32 height = (fg->height / 2);
|
||||||
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++)
|
||||||
{
|
{
|
||||||
INT32 y = ((i*height) - (height - ((FixedInt(recatkdrawtimer*2))%height)));
|
INT32 y = ((i*height) - (height - ((FixedInt(recatkdrawtimer*2))%height)));
|
||||||
// don't draw above the screen
|
// don't draw above the screen
|
||||||
{
|
{
|
||||||
INT32 sy = FixedMul(y, dupz<<FRACBITS) >> FRACBITS;
|
INT32 sy = FixedMul(y, vid.dup<<FRACBITS) >> FRACBITS;
|
||||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
if (vid.height != BASEVIDHEIGHT * vid.dup)
|
||||||
sy += (vid.height - (BASEVIDHEIGHT * dupz)) / 2;
|
sy += (vid.height - (BASEVIDHEIGHT * vid.dup)) / 2;
|
||||||
if ((sy+height) < 0)
|
if ((sy+height) < 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5790,13 +5789,12 @@ static void M_DrawRecordAttackForeground(void)
|
||||||
static void M_DrawNightsAttackMountains(void)
|
static void M_DrawNightsAttackMountains(void)
|
||||||
{
|
{
|
||||||
static fixed_t bgscrollx;
|
static fixed_t bgscrollx;
|
||||||
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 = background->width;
|
INT16 w = background->width;
|
||||||
INT32 x = FixedInt(-bgscrollx) % w;
|
INT32 x = FixedInt(-bgscrollx) % w;
|
||||||
INT32 y = BASEVIDHEIGHT - (background->height * 2);
|
INT32 y = BASEVIDHEIGHT - (background->height * 2);
|
||||||
|
|
||||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
if (vid.height != BASEVIDHEIGHT * vid.dup)
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 158);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 158);
|
||||||
V_DrawFill(0, y+50, vid.width, BASEVIDHEIGHT, V_SNAPTOLEFT|31);
|
V_DrawFill(0, y+50, vid.width, BASEVIDHEIGHT, V_SNAPTOLEFT|31);
|
||||||
|
|
||||||
|
@ -5952,7 +5950,7 @@ static void M_DrawLevelPlatterMenu(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw from top to bottom
|
// draw from top to bottom
|
||||||
while (y < (vid.height/vid.dupy))
|
while (y < (vid.height/vid.dup))
|
||||||
{
|
{
|
||||||
M_DrawLevelPlatterRow(iter, y);
|
M_DrawLevelPlatterRow(iter, y);
|
||||||
y += lsvseperation(iter);
|
y += lsvseperation(iter);
|
||||||
|
@ -7799,9 +7797,9 @@ static void M_DrawSoundTest(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
y = (BASEVIDWIDTH-(vid.width/vid.dupx))/2;
|
y = (BASEVIDWIDTH-(vid.width/vid.dup))/2;
|
||||||
|
|
||||||
V_DrawFill(y, 20, vid.width/vid.dupx, 24, 159);
|
V_DrawFill(y, 20, vid.width/vid.dup, 24, 159);
|
||||||
{
|
{
|
||||||
static fixed_t st_scroll = -FRACUNIT;
|
static fixed_t st_scroll = -FRACUNIT;
|
||||||
const char* titl;
|
const char* titl;
|
||||||
|
@ -8371,8 +8369,8 @@ static void M_DrawLoadGameData(void)
|
||||||
INT32 i, prev_i = 1, savetodraw, x, y, hsep = 90;
|
INT32 i, prev_i = 1, savetodraw, x, y, hsep = 90;
|
||||||
skin_t *charskin = NULL;
|
skin_t *charskin = NULL;
|
||||||
|
|
||||||
if (vid.width != BASEVIDWIDTH*vid.dupx)
|
if (vid.width != BASEVIDWIDTH*vid.dup)
|
||||||
hsep = (hsep*vid.width)/(BASEVIDWIDTH*vid.dupx);
|
hsep = (hsep*vid.width)/(BASEVIDWIDTH*vid.dup);
|
||||||
|
|
||||||
for (i = 2; prev_i; i = -(i + ((UINT32)i >> 31))) // draws from outwards in; 2, -2, 1, -1, 0
|
for (i = 2; prev_i; i = -(i + ((UINT32)i >> 31))) // draws from outwards in; 2, -2, 1, -1, 0
|
||||||
{
|
{
|
||||||
|
@ -9357,7 +9355,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
|
||||||
INT16 bgwidth = charbg->width;
|
INT16 bgwidth = charbg->width;
|
||||||
INT16 fgwidth = charfg->width;
|
INT16 fgwidth = charfg->width;
|
||||||
INT32 x, y;
|
INT32 x, y;
|
||||||
INT32 w = (vid.width/vid.dupx);
|
INT32 w = (vid.width/vid.dup);
|
||||||
|
|
||||||
if (abs(char_scroll) > FRACUNIT/4)
|
if (abs(char_scroll) > FRACUNIT/4)
|
||||||
char_scroll -= FixedMul((char_scroll>>2), renderdeltatics);
|
char_scroll -= FixedMul((char_scroll>>2), renderdeltatics);
|
||||||
|
@ -9393,7 +9391,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
|
||||||
// Background and borders
|
// Background and borders
|
||||||
V_DrawFill(0, 0, bgwidth, vid.height, V_SNAPTOTOP|colormap[101]);
|
V_DrawFill(0, 0, bgwidth, vid.height, V_SNAPTOTOP|colormap[101]);
|
||||||
{
|
{
|
||||||
INT32 sw = (BASEVIDWIDTH * vid.dupx);
|
INT32 sw = (BASEVIDWIDTH * vid.dup);
|
||||||
INT32 bw = (vid.width - sw) / 2;
|
INT32 bw = (vid.width - sw) / 2;
|
||||||
col = colormap[106];
|
col = colormap[106];
|
||||||
if (bw)
|
if (bw)
|
||||||
|
@ -10815,7 +10813,7 @@ void M_DrawMarathon(void)
|
||||||
const char *cvstring;
|
const char *cvstring;
|
||||||
char *work;
|
char *work;
|
||||||
angle_t fa;
|
angle_t fa;
|
||||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy), xspan = (vid.width/dupz), yspan = (vid.height/dupz), diffx = (xspan - BASEVIDWIDTH)/2, diffy = (yspan - BASEVIDHEIGHT)/2, maxy = BASEVIDHEIGHT + diffy;
|
INT32 xspan = (vid.width/vid.dup), yspan = (vid.height/vid.dup), diffx = (xspan - BASEVIDWIDTH)/2, diffy = (yspan - BASEVIDHEIGHT)/2, maxy = BASEVIDHEIGHT + diffy;
|
||||||
|
|
||||||
curbgxspeed = 0;
|
curbgxspeed = 0;
|
||||||
curbgyspeed = 18;
|
curbgyspeed = 18;
|
||||||
|
@ -10888,16 +10886,17 @@ void M_DrawMarathon(void)
|
||||||
INT32 trans = V_60TRANS+((cnt&~3)<<(V_ALPHASHIFT-2));
|
INT32 trans = V_60TRANS+((cnt&~3)<<(V_ALPHASHIFT-2));
|
||||||
INT32 height = fg->height / 2;
|
INT32 height = fg->height / 2;
|
||||||
char patchname[7] = "CEMGx0";
|
char patchname[7] = "CEMGx0";
|
||||||
|
INT32 dup;
|
||||||
|
|
||||||
dupz = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain.
|
dup = (w*7)/6; //(w*42*120)/(360*6); -- I don't know why this works but I'm not going to complain.
|
||||||
dupz = ((dupz>>FRACBITS) % height);
|
dup = ((dup>>FRACBITS) % height);
|
||||||
y = height/2;
|
y = height/2;
|
||||||
while (y+dupz >= -diffy)
|
while (y+dup >= -diffy)
|
||||||
y -= height;
|
y -= height;
|
||||||
while (y-2-dupz < maxy)
|
while (y-2-dup < maxy)
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch(((BASEVIDWIDTH-190)<<(FRACBITS-1)), (y-2-dupz)<<FRACBITS, FRACUNIT/2, trans, fg, NULL);
|
V_DrawFixedPatch(((BASEVIDWIDTH-190)<<(FRACBITS-1)), (y-2-dup)<<FRACBITS, FRACUNIT/2, trans, fg, NULL);
|
||||||
V_DrawFixedPatch(((BASEVIDWIDTH+190)<<(FRACBITS-1)), (y+dupz)<<FRACBITS, FRACUNIT/2, trans|V_FLIP, fg, NULL);
|
V_DrawFixedPatch(((BASEVIDWIDTH+190)<<(FRACBITS-1)), (y+dup)<<FRACBITS, FRACUNIT/2, trans|V_FLIP, fg, NULL);
|
||||||
y += height;
|
y += height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10915,16 +10914,16 @@ void M_DrawMarathon(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
height = 18; // prevents the need for the next line
|
height = 18; // prevents the need for the next line
|
||||||
//dupz = (w*height)/18;
|
//dup = (w*height)/18;
|
||||||
dupz = ((w>>FRACBITS) % height);
|
dup = ((w>>FRACBITS) % height);
|
||||||
y = dupz+(height/4);
|
y = dup+(height/4);
|
||||||
x = 105+dupz;
|
x = 105+dup;
|
||||||
while (y >= -diffy)
|
while (y >= -diffy)
|
||||||
{
|
{
|
||||||
x -= height;
|
x -= height;
|
||||||
y -= height;
|
y -= height;
|
||||||
}
|
}
|
||||||
while (y-dupz < maxy && x < (xspan/2))
|
while (y-dup < maxy && x < (xspan/2))
|
||||||
{
|
{
|
||||||
V_DrawFill((BASEVIDWIDTH/2)-x-height, -diffy, height, diffy+y+height, 153);
|
V_DrawFill((BASEVIDWIDTH/2)-x-height, -diffy, height, diffy+y+height, 153);
|
||||||
V_DrawFill((BASEVIDWIDTH/2)+x, (maxy-y)-height, height, height+y, 153);
|
V_DrawFill((BASEVIDWIDTH/2)+x, (maxy-y)-height, height, height+y, 153);
|
||||||
|
|
|
@ -989,7 +989,7 @@ static inline boolean M_PNGLib(void)
|
||||||
|
|
||||||
static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep png_buf)
|
static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep png_buf)
|
||||||
{
|
{
|
||||||
png_uint_16 downscale = apng_downscale ? vid.dupx : 1;
|
png_uint_16 downscale = apng_downscale ? vid.dup : 1;
|
||||||
|
|
||||||
png_uint_32 pitch = png_get_rowbytes(png_ptr, png_info_ptr);
|
png_uint_32 pitch = png_get_rowbytes(png_ptr, png_info_ptr);
|
||||||
PNG_CONST png_uint_32 width = vid.width / downscale;
|
PNG_CONST png_uint_32 width = vid.width / downscale;
|
||||||
|
@ -1055,7 +1055,7 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
|
||||||
|
|
||||||
apng_downscale = (!!cv_apng_downscale.value);
|
apng_downscale = (!!cv_apng_downscale.value);
|
||||||
|
|
||||||
downscale = apng_downscale ? vid.dupx : 1;
|
downscale = apng_downscale ? vid.dup : 1;
|
||||||
|
|
||||||
apng_FILE = fopen(filename,"wb+"); // + mode for reading
|
apng_FILE = fopen(filename,"wb+"); // + mode for reading
|
||||||
if (!apng_FILE)
|
if (!apng_FILE)
|
||||||
|
|
|
@ -75,6 +75,6 @@ void R_SetupSkyDraw(void)
|
||||||
*/
|
*/
|
||||||
void R_SetSkyScale(void)
|
void R_SetSkyScale(void)
|
||||||
{
|
{
|
||||||
fixed_t difference = vid.fdupx-(vid.dupx<<FRACBITS);
|
fixed_t difference = vid.fdup-(vid.dup<<FRACBITS);
|
||||||
skyscale = FixedDiv(fovtan, vid.fdupx+difference);
|
skyscale = FixedDiv(fovtan, vid.fdup+difference);
|
||||||
}
|
}
|
||||||
|
|
10
src/screen.c
10
src/screen.c
|
@ -494,7 +494,7 @@ void SCR_CalculateFPS(void)
|
||||||
void SCR_DisplayTicRate(void)
|
void SCR_DisplayTicRate(void)
|
||||||
{
|
{
|
||||||
INT32 ticcntcolor = 0;
|
INT32 ticcntcolor = 0;
|
||||||
const INT32 h = vid.height-(8*vid.dupy);
|
const INT32 h = vid.height-(8*vid.dup);
|
||||||
UINT32 cap = R_GetFramerateCap();
|
UINT32 cap = R_GetFramerateCap();
|
||||||
double fps = round(averageFPS);
|
double fps = round(averageFPS);
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ void SCR_DisplayTicRate(void)
|
||||||
|
|
||||||
width = V_StringWidth(drawnstr, V_NOSCALESTART);
|
width = V_StringWidth(drawnstr, V_NOSCALESTART);
|
||||||
|
|
||||||
V_DrawString(vid.width - ((7 * 8 * vid.dupx) + V_StringWidth("FPS: ", V_NOSCALESTART)), h,
|
V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("FPS: ", V_NOSCALESTART)), h,
|
||||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||||
V_DrawString(vid.width - width, h,
|
V_DrawString(vid.width - width, h,
|
||||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr);
|
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr);
|
||||||
|
@ -589,7 +589,7 @@ void SCR_ClosedCaptions(void)
|
||||||
|
|
||||||
if (closedcaptions[i].b)
|
if (closedcaptions[i].b)
|
||||||
{
|
{
|
||||||
y -= closedcaptions[i].b * vid.dupy;
|
y -= closedcaptions[i].b * vid.dup;
|
||||||
if (renderisnewtic)
|
if (renderisnewtic)
|
||||||
{
|
{
|
||||||
closedcaptions[i].b--;
|
closedcaptions[i].b--;
|
||||||
|
@ -639,9 +639,9 @@ void SCR_DisplayMarathonInfo(void)
|
||||||
#define PRIMEV1 13
|
#define PRIMEV1 13
|
||||||
#define PRIMEV2 17 // I can't believe it! I'm on TV!
|
#define PRIMEV2 17 // I can't believe it! I'm on TV!
|
||||||
antisplice[0] += (entertic - oldentertics)*PRIMEV2;
|
antisplice[0] += (entertic - oldentertics)*PRIMEV2;
|
||||||
antisplice[0] %= PRIMEV1*((vid.width/vid.dupx)+1);
|
antisplice[0] %= PRIMEV1*((vid.width/vid.dup)+1);
|
||||||
antisplice[1] += (entertic - oldentertics)*PRIMEV1;
|
antisplice[1] += (entertic - oldentertics)*PRIMEV1;
|
||||||
antisplice[1] %= PRIMEV1*((vid.width/vid.dupx)+1);
|
antisplice[1] %= PRIMEV1*((vid.width/vid.dup)+1);
|
||||||
str = va("%i:%02i:%02i.%02i",
|
str = va("%i:%02i:%02i.%02i",
|
||||||
G_TicsToHours(marathontime),
|
G_TicsToHours(marathontime),
|
||||||
G_TicsToMinutes(marathontime, false),
|
G_TicsToMinutes(marathontime, false),
|
||||||
|
|
12
src/screen.h
12
src/screen.h
|
@ -59,19 +59,19 @@ typedef struct viddef_s
|
||||||
} u;
|
} u;
|
||||||
INT32 recalc; // if true, recalc vid-based stuff
|
INT32 recalc; // if true, recalc vid-based stuff
|
||||||
UINT8 *direct; // linear frame buffer, or vga base mem.
|
UINT8 *direct; // linear frame buffer, or vga base mem.
|
||||||
INT32 dupx, dupy; // scale 1, 2, 3 value for menus & overlays
|
INT32 dup; // scale 1, 2, 3 value for menus & overlays
|
||||||
INT32/*fixed_t*/ fdupx, fdupy; // same as dupx, dupy, but exact value when aspect ratio isn't 320/200
|
INT32/*fixed_t*/ fdup; // same as dup, but exact value when aspect ratio isn't 320/200
|
||||||
INT32 bpp; // BYTES per pixel: 1 = 256color, 2 = highcolor
|
INT32 bpp; // BYTES per pixel: 1 = 256color, 2 = highcolor
|
||||||
|
|
||||||
INT32 baseratio; // Used to get the correct value for lighting walls
|
INT32 baseratio; // Used to get the correct value for lighting walls
|
||||||
|
|
||||||
// for Win32 version
|
// for Win32 version
|
||||||
DNWH WndParent; // handle of the application's window
|
DNWH WndParent; // handle of the application's window
|
||||||
UINT8 smalldupx, smalldupy; // factor for a little bit of scaling
|
UINT8 smalldup; // factor for a little bit of scaling
|
||||||
UINT8 meddupx, meddupy; // factor for moderate, but not full, scaling
|
UINT8 meddup; // factor for moderate, but not full, scaling
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
INT32/*fixed_t*/ fsmalldupx, fsmalldupy;
|
INT32/*fixed_t*/ fsmalldup;
|
||||||
INT32/*fixed_t*/ fmeddupx, fmeddupy;
|
INT32/*fixed_t*/ fmeddup;
|
||||||
INT32 glstate;
|
INT32 glstate;
|
||||||
#endif
|
#endif
|
||||||
} viddef_t;
|
} viddef_t;
|
||||||
|
|
|
@ -513,10 +513,10 @@ static void ST_drawDebugInfo(void)
|
||||||
|
|
||||||
#define VFLAGS V_MONOSPACE|V_SNAPTOTOP|V_SNAPTORIGHT
|
#define VFLAGS V_MONOSPACE|V_SNAPTOTOP|V_SNAPTORIGHT
|
||||||
|
|
||||||
if ((moviemode == MM_GIF && cv_gif_downscale.value) || vid.dupx == 1)
|
if ((moviemode == MM_GIF && cv_gif_downscale.value) || vid.dup == 1)
|
||||||
{
|
{
|
||||||
textfunc = V_DrawRightAlignedString;
|
textfunc = V_DrawRightAlignedString;
|
||||||
lowh = ((vid.height/vid.dupy) - 16);
|
lowh = ((vid.height/vid.dup) - 16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
507
src/v_video.c
507
src/v_video.c
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,7 @@ cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation,
|
||||||
// Allocates buffer screens, call before R_Init.
|
// Allocates buffer screens, call before R_Init.
|
||||||
void V_Init(void);
|
void V_Init(void);
|
||||||
|
|
||||||
// Recalculates the viddef (dupx, dupy, etc.) according to the current screen resolution.
|
// Recalculates the viddef (dup, fdup, etc.) according to the current screen resolution.
|
||||||
void V_Recalc(void);
|
void V_Recalc(void);
|
||||||
|
|
||||||
// Color look-up table
|
// Color look-up table
|
||||||
|
|
|
@ -536,7 +536,7 @@ void Y_IntermissionDrawer(void)
|
||||||
|
|
||||||
if (animatetic && (tic_t)intertic >= animatetic)
|
if (animatetic && (tic_t)intertic >= animatetic)
|
||||||
{
|
{
|
||||||
const INT32 scradjust = (vid.width/vid.dupx)>>3; // 40 for BASEVIDWIDTH
|
const INT32 scradjust = (vid.width/vid.dup)>>3; // 40 for BASEVIDWIDTH
|
||||||
INT32 animatetimer = (intertic - animatetic);
|
INT32 animatetimer = (intertic - animatetic);
|
||||||
if (animatetimer <= 16)
|
if (animatetimer <= 16)
|
||||||
{
|
{
|
||||||
|
@ -687,7 +687,7 @@ void Y_IntermissionDrawer(void)
|
||||||
|
|
||||||
if (intertic > 1)
|
if (intertic > 1)
|
||||||
{
|
{
|
||||||
if (stagefailed && data.spec.emeraldy < (vid.height/vid.dupy)+16)
|
if (stagefailed && data.spec.emeraldy < (vid.height/vid.dup)+16)
|
||||||
{
|
{
|
||||||
emeraldx += intertic - 6;
|
emeraldx += intertic - 6;
|
||||||
}
|
}
|
||||||
|
@ -1163,7 +1163,7 @@ void Y_Ticker(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (data.spec.emeraldy < (vid.height/vid.dupy)+16)
|
if (data.spec.emeraldy < (vid.height/vid.dup)+16)
|
||||||
{
|
{
|
||||||
data.spec.emeraldy += (++data.spec.emeraldmomy);
|
data.spec.emeraldy += (++data.spec.emeraldmomy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue