diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 9a6fa74449..d313f5553a 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -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(desc)->mSecondPic, FTexture::TEX_MiscPatch); mScrollDelay = static_cast(desc)->mScrollDelay; mScrollTime = static_cast(desc)->mScrollTime; mScrollDir = static_cast(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(); + } } diff --git a/src/intermission/intermission.h b/src/intermission/intermission.h index d54d26fbea..23fa3d7f2f 100644 --- a/src/intermission/intermission.h +++ b/src/intermission/intermission.h @@ -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 (); }; diff --git a/src/intermission/intermission_parse.cpp b/src/intermission/intermission_parse.cpp index 342d635d49..84ba9ec6f1 100644 --- a/src/intermission/intermission_parse.cpp +++ b/src/intermission/intermission_parse.cpp @@ -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; diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index c7838dcb8e..f1f51f6d46 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -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"