- fixed: fullscreen images with texture scaling used the unscaled size for

positioning. To avoid future problems with them I added a new DTA_Fullscreen
  option for DrawTexture.


SVN r1983 (trunk)
This commit is contained in:
Christoph Oelckers 2009-11-15 14:33:35 +00:00
parent 6161702703
commit 3a198a29dc
6 changed files with 34 additions and 29 deletions

View File

@ -1,4 +1,7 @@
November 15, 2009 (Changes by Graf Zahl)
- fixed: fullscreen images with texture scaling used the unscaled size for
positioning. To avoid future problems with them I added a new DTA_Fullscreen
option for DrawTexture.
- fixed: The sky baseline position needs to take texture scaling into account.
November 14, 2009

View File

@ -953,8 +953,7 @@ void D_PageDrawer (void)
if (Page != NULL)
{
screen->DrawTexture (Page, 0, 0,
DTA_VirtualWidth, Page->GetWidth(),
DTA_VirtualHeight, Page->GetHeight(),
DTA_Fullscreen, true,
DTA_Masked, false,
DTA_BilinearFilter, true,
TAG_DONE);

View File

@ -809,8 +809,8 @@ void F_DemonScroll ()
int yval;
FTexture *final1 = TexMan(tex1);
FTexture *final2 = TexMan(tex2);
int fwidth = final1->GetWidth();
int fheight = final1->GetHeight();
int fwidth = final1->GetScaledWidth();
int fheight = final1->GetScaledHeight();
if (FinaleCount < 70)
{
@ -884,10 +884,7 @@ void F_DrawUnderwater(void)
// intentional fall-through
case 2:
pic = TexMan("E2END");
screen->DrawTexture (pic, 0, 0,
DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(),
TAG_DONE);
screen->DrawTexture (pic, 0, 0, DTA_Fullscreen, true, TAG_DONE);
screen->FillBorder (NULL);
paused = false;
menuactive = MENU_Off;
@ -907,10 +904,7 @@ void F_DrawUnderwater(void)
screen->UpdatePalette ();
pic = TexMan("TITLE");
screen->DrawTexture (pic, 0, 0,
DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(),
TAG_DONE);
screen->DrawTexture (pic, 0, 0, DTA_Fullscreen, true, TAG_DONE);
screen->FillBorder (NULL);
NoWipe = 0;
break;
@ -960,8 +954,8 @@ void F_BunnyScroll (void)
V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
tex = TexMan(tex1);
fwidth = tex->GetWidth();
fheight = tex->GetHeight();
fwidth = tex->GetScaledWidth();
fheight = tex->GetScaledHeight();
scrolled = clamp (((signed)FinaleCount-230)*fwidth/640, 0, fwidth);
@ -1315,25 +1309,24 @@ void F_Drawer (void)
if (picname != NULL)
{
FTexture *pic = TexMan[picname];
screen->DrawTexture (pic, 0, 0,
DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(),
TAG_DONE);
screen->DrawTexture (pic, 0, 0, DTA_Fullscreen, true, TAG_DONE);
screen->FillBorder (NULL);
if (FinaleStage >= 14)
{ // Chess pic, draw the correct character graphic
double w = pic->GetScaledWidthDouble();
double h = pic->GetScaledHeightDouble();
if (multiplayer)
{
screen->DrawTexture (TexMan["CHESSALL"], 20, 0,
DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(), TAG_DONE);
DTA_VirtualWidth, w,
DTA_VirtualHeight, h, TAG_DONE);
}
else if (players[consoleplayer].CurrentPlayerClass > 0)
{
picname = players[consoleplayer].CurrentPlayerClass == 1 ? "CHESSC" : "CHESSM";
screen->DrawTexture (TexMan[picname], 60, 0,
DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(), TAG_DONE);
DTA_VirtualWidth, w,
DTA_VirtualHeight, h, TAG_DONE);
}
}
}

View File

@ -491,6 +491,16 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
parms->virtHeight = va_arg(tags, double);
break;
case DTA_Fullscreen:
boolval = va_arg(tags, INTBOOL);
if (boolval)
{
parms->x = parms->y = 0;
parms->virtWidth = img->GetScaledWidthDouble();
parms->virtHeight = img->GetScaledHeightDouble();
}
break;
case DTA_Alpha:
parms->alpha = MIN<fixed_t>(FRACUNIT, va_arg (tags, fixed_t));
break;

View File

@ -103,6 +103,7 @@ enum
DTA_BilinearFilter, // bool: apply bilinear filtering to the image
DTA_SpecialColormap,// pointer to FSpecialColormapParameters (likely to be forever hardware-only)
DTA_ColormapStyle, // pointer to FColormapStyle (hardware-only)
DTA_Fullscreen, // Draw image fullscreen (same as DTA_VirtualWidth/Height with graphics size.)
// floating point duplicates of some of the above:
DTA_DestWidthF,

View File

@ -595,8 +595,8 @@ void WI_updateAnimatedBack()
void WI_drawBackground()
{
unsigned int i;
int animwidth=320; // For a flat fill or clear background scale animations to 320x200
int animheight=200;
double animwidth=320; // For a flat fill or clear background scale animations to 320x200
double animheight=200;
if (background)
{
@ -606,11 +606,10 @@ void WI_drawBackground()
// scale all animations below to fit the size of the base pic
// The base pic is always scaled to fit the screen so this allows
// placing the animations precisely where they belong on the base pic
animwidth = background->GetWidth();
animheight = background->GetHeight();
animwidth = background->GetScaledWidth();
animheight = background->GetScaledHeight();
screen->FillBorder (NULL);
screen->DrawTexture(background, 0, 0, DTA_VirtualWidth, animwidth,
DTA_VirtualHeight, animheight, TAG_DONE);
screen->DrawTexture(background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
}
else
{
@ -666,7 +665,7 @@ void WI_drawBackground()
}
if (a->ctr >= 0)
screen->DrawTexture(a->p[a->ctr], a->loc.x, a->loc.y,
DTA_VirtualWidth, animwidth, DTA_VirtualHeight, animheight, TAG_DONE);
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
}
}