mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-03 08:01:04 +00:00
- add option to force all wipe styles.
- start of intermission controller implementation. SVN r2884 (finale)
This commit is contained in:
parent
f2659cf357
commit
f452657b48
5 changed files with 99 additions and 24 deletions
|
@ -677,13 +677,23 @@ void D_Display ()
|
||||||
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE && gamestate != GS_TITLELEVEL)
|
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE && gamestate != GS_TITLELEVEL)
|
||||||
{ // save the current screen if about to wipe
|
{ // save the current screen if about to wipe
|
||||||
BorderNeedRefresh = screen->GetPageCount ();
|
BorderNeedRefresh = screen->GetPageCount ();
|
||||||
if (wipegamestate != GS_FORCEWIPEFADE)
|
switch (wipegamestate)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
wipe = screen->WipeStartScreen (wipetype);
|
wipe = screen->WipeStartScreen (wipetype);
|
||||||
}
|
break;
|
||||||
else
|
|
||||||
{
|
case GS_FORCEWIPEFADE:
|
||||||
wipe = screen->WipeStartScreen (wipe_Fade);
|
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;
|
wipegamestate = gamestate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,9 @@ typedef enum
|
||||||
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
|
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
|
||||||
|
|
||||||
GS_FORCEWIPE = -1,
|
GS_FORCEWIPE = -1,
|
||||||
GS_FORCEWIPEFADE = -2
|
GS_FORCEWIPEFADE = -2,
|
||||||
|
GS_FORCEWIPEBURN = -3,
|
||||||
|
GS_FORCEWIPEMELT = -4
|
||||||
} gamestate_t;
|
} gamestate_t;
|
||||||
|
|
||||||
extern gamestate_t gamestate;
|
extern gamestate_t gamestate;
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "gi.h"
|
#include "gi.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "v_palette.h"
|
#include "v_palette.h"
|
||||||
|
#include "d_main.h"
|
||||||
#include "intermission/intermission.h"
|
#include "intermission/intermission.h"
|
||||||
|
|
||||||
FIntermissionDescriptorList IntermissionDescriptors;
|
FIntermissionDescriptorList IntermissionDescriptors;
|
||||||
|
@ -49,6 +50,7 @@ IMPLEMENT_CLASS(DIntermissionScreenCast)
|
||||||
IMPLEMENT_CLASS(DIntermissionScreenScroller)
|
IMPLEMENT_CLASS(DIntermissionScreenScroller)
|
||||||
IMPLEMENT_CLASS(DIntermissionController)
|
IMPLEMENT_CLASS(DIntermissionController)
|
||||||
|
|
||||||
|
extern int NoWipe;
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -91,6 +93,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
|
||||||
}
|
}
|
||||||
screen->UpdatePalette ();
|
screen->UpdatePalette ();
|
||||||
mPaletteChanged = true;
|
mPaletteChanged = true;
|
||||||
|
NoWipe = 1;
|
||||||
}
|
}
|
||||||
mOverlays.Resize(desc->mOverlays.Size());
|
mOverlays.Resize(desc->mOverlays.Size());
|
||||||
for (unsigned i=0; i < mOverlays.Size(); i++)
|
for (unsigned i=0; i < mOverlays.Size(); i++)
|
||||||
|
@ -128,6 +131,7 @@ void DIntermissionScreen::Destroy()
|
||||||
palette[i] = GPalette.BaseColors[i];
|
palette[i] = GPalette.BaseColors[i];
|
||||||
}
|
}
|
||||||
screen->UpdatePalette ();
|
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.
|
// Called by main loop.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef __INTERMISSION_H
|
#ifndef __INTERMISSION_H
|
||||||
#define __INTERMISSION_H
|
#define __INTERMISSION_H
|
||||||
|
|
||||||
|
#include "doomdef.h"
|
||||||
#include "dobject.h"
|
#include "dobject.h"
|
||||||
#include "m_fixed.h"
|
#include "m_fixed.h"
|
||||||
#include "textures/textures.h"
|
#include "textures/textures.h"
|
||||||
|
@ -45,14 +46,6 @@ enum EFadeType
|
||||||
FADE_Out,
|
FADE_Out,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EWipeType
|
|
||||||
{
|
|
||||||
WIPE_Default,
|
|
||||||
WIPE_Cross,
|
|
||||||
WIPE_Melt,
|
|
||||||
WIPE_Burn
|
|
||||||
};
|
|
||||||
|
|
||||||
enum EScrollDir
|
enum EScrollDir
|
||||||
{
|
{
|
||||||
SCROLL_Left,
|
SCROLL_Left,
|
||||||
|
@ -102,7 +95,7 @@ struct FIntermissionActionWiper : public FIntermissionAction
|
||||||
{
|
{
|
||||||
typedef FIntermissionAction Super;
|
typedef FIntermissionAction Super;
|
||||||
|
|
||||||
EWipeType mWipeType;
|
gamestate_t mWipeType;
|
||||||
|
|
||||||
FIntermissionActionWiper();
|
FIntermissionActionWiper();
|
||||||
virtual bool ParseKey(FScanner &sc);
|
virtual bool ParseKey(FScanner &sc);
|
||||||
|
@ -252,15 +245,21 @@ class DIntermissionController : public DObject
|
||||||
{
|
{
|
||||||
DECLARE_CLASS (DIntermissionController, DObject)
|
DECLARE_CLASS (DIntermissionController, DObject)
|
||||||
|
|
||||||
|
FIntermissionDescriptor *mDesc;
|
||||||
|
bool mDeleteDesc;
|
||||||
|
int mIndex;
|
||||||
|
int mCounter;
|
||||||
|
|
||||||
|
bool NextPage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DIntermissionController *CurrentIntermission;
|
static DIntermissionController *CurrentIntermission;
|
||||||
|
|
||||||
DIntermissionController() {}
|
DIntermissionController(FIntermissionDescriptor *mDesc = NULL, bool mDeleteDesc = false);
|
||||||
bool Responder (event_t *ev);
|
bool Responder (event_t *ev);
|
||||||
void Ticker ();
|
void Ticker ();
|
||||||
void Drawer ();
|
void Drawer ();
|
||||||
void Close();
|
void Destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ FIntermissionActionWiper::FIntermissionActionWiper()
|
||||||
{
|
{
|
||||||
mSize = sizeof(FIntermissionActionWiper);
|
mSize = sizeof(FIntermissionActionWiper);
|
||||||
mClass = WIPER_ID;
|
mClass = WIPER_ID;
|
||||||
mWipeType = WIPE_Default;
|
mWipeType = GS_FORCEWIPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FIntermissionActionWiper::ParseKey(FScanner &sc)
|
bool FIntermissionActionWiper::ParseKey(FScanner &sc)
|
||||||
|
@ -212,14 +212,14 @@ bool FIntermissionActionWiper::ParseKey(FScanner &sc)
|
||||||
struct WipeType
|
struct WipeType
|
||||||
{
|
{
|
||||||
const char *Name;
|
const char *Name;
|
||||||
EWipeType Type;
|
gamestate_t Type;
|
||||||
}
|
}
|
||||||
const FT[] = {
|
const FT[] = {
|
||||||
{ "Crossfade", WIPE_Cross },
|
{ "Crossfade", GS_FORCEWIPEFADE },
|
||||||
{ "Melt", WIPE_Melt },
|
{ "Melt", GS_FORCEWIPEMELT },
|
||||||
{ "Burn", WIPE_Burn },
|
{ "Burn", GS_FORCEWIPEBURN },
|
||||||
{ "Default", WIPE_Default },
|
{ "Default", GS_FORCEWIPE },
|
||||||
{ NULL, WIPE_Default }
|
{ NULL, GS_FORCEWIPE }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sc.Compare("WipeType"))
|
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;
|
textscreen->mLink = ending? endsequence : NAME_None;
|
||||||
FIntermissionDescriptor *desc = new FIntermissionDescriptor;
|
FIntermissionDescriptor *desc = new FIntermissionDescriptor;
|
||||||
desc->mActions.Push(textscreen);
|
desc->mActions.Push(textscreen);
|
||||||
|
|
||||||
|
FIntermissionActionWiper *wiper = new FIntermissionActionWiper;
|
||||||
|
desc->mActions.Push(wiper);
|
||||||
|
|
||||||
F_StartIntermission(desc, true);
|
F_StartIntermission(desc, true);
|
||||||
}
|
}
|
||||||
else if (ending)
|
else if (ending)
|
||||||
|
|
Loading…
Reference in a new issue