- scrolling endings (e.g. Bunny and Demon) implemented.

SVN r2888 (finale)
This commit is contained in:
Christoph Oelckers 2010-10-03 18:06:34 +00:00
parent cc475bdd10
commit 7ef87064d7
4 changed files with 56 additions and 27 deletions

View file

@ -247,11 +247,6 @@ int DIntermissionScreenText::Responder (event_t *ev)
return Super::Responder(ev);
}
int DIntermissionScreenText::Ticker ()
{
return Super::Ticker();
}
void DIntermissionScreenText::Drawer ()
{
Super::Drawer();
@ -359,25 +354,67 @@ void DIntermissionScreenCast::Drawer ()
void DIntermissionScreenScroller::Init(FIntermissionAction *desc, bool first)
{
Super::Init(desc, first);
mFirstPic = mBackground;
mSecondPic = TexMan.CheckForTexture(static_cast<FIntermissionActionScroller*>(desc)->mSecondPic, FTexture::TEX_MiscPatch);
mScrollDelay = static_cast<FIntermissionActionScroller*>(desc)->mScrollDelay;
mScrollTime = static_cast<FIntermissionActionScroller*>(desc)->mScrollTime;
mScrollDir = static_cast<FIntermissionActionScroller*>(desc)->mScrollDir;
}
int DIntermissionScreenScroller::Responder (event_t *ev)
{
return Super::Responder(ev);
}
int DIntermissionScreenScroller::Ticker ()
{
return Super::Ticker();
}
void DIntermissionScreenScroller::Drawer ()
{
Super::Drawer();
FTexture *tex = TexMan[mFirstPic];
FTexture *tex2 = TexMan[mSecondPic];
if (mTicker >= mScrollDelay && mTicker < mScrollDelay + mScrollTime && tex != NULL && tex2 != NULL)
{
int fwidth = tex->GetScaledWidth();
int fheight = tex->GetScaledHeight();
double xpos1 = 0, ypos1 = 0, xpos2 = 0, ypos2 = 0;
switch (mScrollDir)
{
case SCROLL_Up:
ypos1 = double(mTicker - mScrollDelay) * fheight / mScrollTime;
ypos2 = ypos1 - fheight;
break;
case SCROLL_Down:
ypos1 = -double(mTicker - mScrollDelay) * fheight / mScrollTime;
ypos2 = ypos1 + fheight;
break;
case SCROLL_Left:
default:
xpos1 = double(mTicker - mScrollDelay) * fwidth / mScrollTime;
xpos2 = xpos1 - fwidth;
break;
case SCROLL_Right:
xpos1 = -double(mTicker - mScrollDelay) * fwidth / mScrollTime;
xpos2 = xpos1 + fwidth;
break;
}
screen->DrawTexture (tex, xpos1, ypos1,
DTA_VirtualWidth, fwidth,
DTA_VirtualHeight, fheight,
DTA_Masked, false,
TAG_DONE);
screen->DrawTexture (tex2, xpos2, ypos2,
DTA_VirtualWidth, fwidth,
DTA_VirtualHeight, fheight,
DTA_Masked, false,
TAG_DONE);
screen->FillBorder (NULL);
mBackground = mSecondPic;
}
else
{
Super::Drawer();
}
}

View file

@ -218,7 +218,6 @@ public:
DIntermissionScreenText() {}
virtual void Init(FIntermissionAction *desc, bool first);
virtual int Responder (event_t *ev);
virtual int Ticker ();
virtual void Drawer ();
};
@ -243,6 +242,7 @@ class DIntermissionScreenScroller : public DIntermissionScreen
{
DECLARE_CLASS (DIntermissionScreenScroller, DIntermissionScreen)
FTextureID mFirstPic;
FTextureID mSecondPic;
int mScrollDelay;
int mScrollTime;
@ -252,8 +252,6 @@ public:
DIntermissionScreenScroller() {}
virtual void Init(FIntermissionAction *desc, bool first);
virtual int Responder (event_t *ev);
virtual int Ticker ();
virtual void Drawer ();
};

View file

@ -638,7 +638,7 @@ FName FMapInfoParser::ParseEndGame()
{
FIntermissionActionScroller *bunny = new FIntermissionActionScroller;
bunny->mSecondPic = newSeq.PicName2;
bunny->mScrollDir = SCROLL_Right;
bunny->mScrollDir = SCROLL_Left;
bunny->mScrollDelay = 230;
bunny->mScrollTime = 640;
bunny->mDuration = 1130;

View file

@ -35,7 +35,7 @@ Intermission Inter_Bunny
{
Scroller
{
ScrollDirection = Right
ScrollDirection = Left
Background = "PFUB1"
Background2 = "PFUB2"
Music = "$MUSIC_BUNNY"
@ -56,42 +56,36 @@ Intermission TheEnd
}
Image
{
Draw = "END0", 108, 68
Draw = "END1", 108, 68
Time = -5
Sound = "weapons/pistol"
}
Image
{
Draw = "END0", 108, 68
Draw = "END2", 108, 68
Time = -5
Sound = "weapons/pistol"
}
Image
{
Draw = "END0", 108, 68
Draw = "END3", 108, 68
Time = -5
Sound = "weapons/pistol"
}
Image
{
Draw = "END0", 108, 68
Draw = "END4", 108, 68
Time = -5
Sound = "weapons/pistol"
}
Image
{
Draw = "END0", 108, 68
Draw = "END5", 108, 68
Time = -5
Sound = "weapons/pistol"
}
Image
{
Draw = "END0", 108, 68
Draw = "END6", 108, 68
Time = -5
Sound = "weapons/pistol"