- add option to force all wipe styles.

- start of intermission controller implementation.


SVN r2884 (finale)
This commit is contained in:
Christoph Oelckers 2010-10-02 23:20:54 +00:00
parent f2659cf357
commit f452657b48
5 changed files with 99 additions and 24 deletions

View file

@ -677,13 +677,23 @@ void D_Display ()
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE && gamestate != GS_TITLELEVEL)
{ // save the current screen if about to wipe
BorderNeedRefresh = screen->GetPageCount ();
if (wipegamestate != GS_FORCEWIPEFADE)
switch (wipegamestate)
{
default:
wipe = screen->WipeStartScreen (wipetype);
}
else
{
break;
case GS_FORCEWIPEFADE:
wipe = screen->WipeStartScreen (wipe_Fade);
break;
case GS_FORCEWIPEBURN:
wipe = screen->WipeStartScreen (wipe_Burn);
break;
case GS_FORCEWIPEMELT:
wipe = screen->WipeStartScreen (wipe_Melt);
break;
}
wipegamestate = gamestate;
}

View file

@ -76,7 +76,9 @@ typedef enum
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
GS_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2
GS_FORCEWIPEFADE = -2,
GS_FORCEWIPEBURN = -3,
GS_FORCEWIPEMELT = -4
} gamestate_t;
extern gamestate_t gamestate;

View file

@ -38,6 +38,7 @@
#include "gi.h"
#include "v_video.h"
#include "v_palette.h"
#include "d_main.h"
#include "intermission/intermission.h"
FIntermissionDescriptorList IntermissionDescriptors;
@ -49,6 +50,7 @@ IMPLEMENT_CLASS(DIntermissionScreenCast)
IMPLEMENT_CLASS(DIntermissionScreenScroller)
IMPLEMENT_CLASS(DIntermissionController)
extern int NoWipe;
//==========================================================================
//
//
@ -91,6 +93,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
}
screen->UpdatePalette ();
mPaletteChanged = true;
NoWipe = 1;
}
mOverlays.Resize(desc->mOverlays.Size());
for (unsigned i=0; i < mOverlays.Size(); i++)
@ -128,6 +131,7 @@ void DIntermissionScreen::Destroy()
palette[i] = GPalette.BaseColors[i];
}
screen->UpdatePalette ();
NoWipe = 0;
}
}
@ -247,9 +251,65 @@ void DIntermissionScreenScroller::Drawer ()
}
//==========================================================================
//
//
//
//==========================================================================
DIntermissionController::DIntermissionController(FIntermissionDescriptor *Desc, bool DeleteDesc)
{
mDesc = Desc;
mDeleteDesc = DeleteDesc;
mIndex = 0;
mCounter = -1; // NextPage during next tick
}
bool DIntermissionController::NextPage ()
{
while ((unsigned)mIndex < mDesc->mActions.Size())
{
FIntermissionAction *action = mDesc->mActions[mIndex++];
if (action->mClass == WIPER_ID)
{
wipegamestate = static_cast<FIntermissionActionWiper*>(action)->mWipeType;
}
else if (action->mClass == TITLE_ID)
{
Destroy();
D_StartTitle ();
return false;
}
else
{
// create page here
}
}
return false;
}
bool DIntermissionController::Responder (event_t *ev)
{
return false;
}
void DIntermissionController::Ticker ()
{
}
void DIntermissionController::Drawer ()
{
}
void DIntermissionController::Destroy ()
{
if (mDeleteDesc) delete mDesc;
mDesc = NULL;
}
static FIntermissionDescriptor DefaultIntermission;
// Called by main loop.

View file

@ -1,6 +1,7 @@
#ifndef __INTERMISSION_H
#define __INTERMISSION_H
#include "doomdef.h"
#include "dobject.h"
#include "m_fixed.h"
#include "textures/textures.h"
@ -45,14 +46,6 @@ enum EFadeType
FADE_Out,
};
enum EWipeType
{
WIPE_Default,
WIPE_Cross,
WIPE_Melt,
WIPE_Burn
};
enum EScrollDir
{
SCROLL_Left,
@ -102,7 +95,7 @@ struct FIntermissionActionWiper : public FIntermissionAction
{
typedef FIntermissionAction Super;
EWipeType mWipeType;
gamestate_t mWipeType;
FIntermissionActionWiper();
virtual bool ParseKey(FScanner &sc);
@ -252,15 +245,21 @@ class DIntermissionController : public DObject
{
DECLARE_CLASS (DIntermissionController, DObject)
FIntermissionDescriptor *mDesc;
bool mDeleteDesc;
int mIndex;
int mCounter;
bool NextPage();
public:
static DIntermissionController *CurrentIntermission;
DIntermissionController() {}
DIntermissionController(FIntermissionDescriptor *mDesc = NULL, bool mDeleteDesc = false);
bool Responder (event_t *ev);
void Ticker ();
void Drawer ();
void Close();
void Destroy();
};

View file

@ -204,7 +204,7 @@ FIntermissionActionWiper::FIntermissionActionWiper()
{
mSize = sizeof(FIntermissionActionWiper);
mClass = WIPER_ID;
mWipeType = WIPE_Default;
mWipeType = GS_FORCEWIPE;
}
bool FIntermissionActionWiper::ParseKey(FScanner &sc)
@ -212,14 +212,14 @@ bool FIntermissionActionWiper::ParseKey(FScanner &sc)
struct WipeType
{
const char *Name;
EWipeType Type;
gamestate_t Type;
}
const FT[] = {
{ "Crossfade", WIPE_Cross },
{ "Melt", WIPE_Melt },
{ "Burn", WIPE_Burn },
{ "Default", WIPE_Default },
{ NULL, WIPE_Default }
{ "Crossfade", GS_FORCEWIPEFADE },
{ "Melt", GS_FORCEWIPEMELT },
{ "Burn", GS_FORCEWIPEBURN },
{ "Default", GS_FORCEWIPE },
{ NULL, GS_FORCEWIPE }
};
if (sc.Compare("WipeType"))
@ -785,6 +785,10 @@ void F_StartFinale (const char *music, int musicorder, int cdtrack, unsigned int
textscreen->mLink = ending? endsequence : NAME_None;
FIntermissionDescriptor *desc = new FIntermissionDescriptor;
desc->mActions.Push(textscreen);
FIntermissionActionWiper *wiper = new FIntermissionActionWiper;
desc->mActions.Push(wiper);
F_StartIntermission(desc, true);
}
else if (ending)