mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Merge branch 'master' of https://github.com/raa-eruanna/qzdoom into qzdoom
This commit is contained in:
commit
548aec01ec
13 changed files with 1973 additions and 1994 deletions
|
@ -544,7 +544,6 @@ void FullGC()
|
||||||
|
|
||||||
void Barrier(DObject *pointing, DObject *pointed)
|
void Barrier(DObject *pointing, DObject *pointed)
|
||||||
{
|
{
|
||||||
assert(pointed->GetClass() != nullptr);
|
|
||||||
assert(pointing == NULL || (pointing->IsBlack() && !pointing->IsDead()));
|
assert(pointing == NULL || (pointing->IsBlack() && !pointing->IsDead()));
|
||||||
assert(pointed->IsWhite() && !pointed->IsDead());
|
assert(pointed->IsWhite() && !pointed->IsDead());
|
||||||
assert(State != GCS_Finalize && State != GCS_Pause);
|
assert(State != GCS_Finalize && State != GCS_Pause);
|
||||||
|
|
|
@ -53,6 +53,9 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, gametype)
|
||||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, norandomplayerclass)
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, norandomplayerclass)
|
||||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, infoPages)
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, infoPages)
|
||||||
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mBackButton)
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mBackButton)
|
||||||
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mStatscreenMapNameFont)
|
||||||
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mStatscreenEnteringFont)
|
||||||
|
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mStatscreenFinishedFont)
|
||||||
|
|
||||||
|
|
||||||
const char *GameNames[17] =
|
const char *GameNames[17] =
|
||||||
|
|
|
@ -411,7 +411,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc)
|
||||||
else if (args[i] == TypeTextureID)
|
else if (args[i] == TypeTextureID)
|
||||||
{
|
{
|
||||||
auto f = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
auto f = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
||||||
if (!f.isValid())
|
if (!f.Exists())
|
||||||
{
|
{
|
||||||
sc.ScriptError("Unknown texture %s", sc.String);
|
sc.ScriptError("Unknown texture %s", sc.String);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2821,6 +2821,8 @@ void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool alwa
|
||||||
"Unloading",
|
"Unloading",
|
||||||
"Disconnect",
|
"Disconnect",
|
||||||
"Return",
|
"Return",
|
||||||
|
"Event",
|
||||||
|
"Kill",
|
||||||
"Reopen"
|
"Reopen"
|
||||||
};
|
};
|
||||||
DPrintf(DMSG_NOTIFY, "Starting all scripts of type %d (%s)\n", type,
|
DPrintf(DMSG_NOTIFY, "Starting all scripts of type %d (%s)\n", type,
|
||||||
|
|
|
@ -568,16 +568,6 @@ FStrifeDialogueNode::~FStrifeDialogueNode ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
|
||||||
//
|
|
||||||
// FStrifeDialogueReply :: ~FStrifeDialogueReply
|
|
||||||
//
|
|
||||||
//============================================================================
|
|
||||||
|
|
||||||
FStrifeDialogueReply::~FStrifeDialogueReply ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
// FindNode
|
// FindNode
|
||||||
|
|
|
@ -20,19 +20,19 @@ struct FStrifeDialogueItemCheck
|
||||||
struct FStrifeDialogueNode
|
struct FStrifeDialogueNode
|
||||||
{
|
{
|
||||||
~FStrifeDialogueNode ();
|
~FStrifeDialogueNode ();
|
||||||
PClassActor *DropType;
|
PClassActor *DropType = nullptr;
|
||||||
TArray<FStrifeDialogueItemCheck> ItemCheck;
|
TArray<FStrifeDialogueItemCheck> ItemCheck;
|
||||||
int ThisNodeNum; // location of this node in StrifeDialogues
|
int ThisNodeNum = 0; // location of this node in StrifeDialogues
|
||||||
int ItemCheckNode; // index into StrifeDialogues
|
int ItemCheckNode = 0; // index into StrifeDialogues
|
||||||
|
|
||||||
PClassActor *SpeakerType;
|
PClassActor *SpeakerType = nullptr;
|
||||||
FString SpeakerName;
|
FString SpeakerName;
|
||||||
FSoundID SpeakerVoice;
|
FSoundID SpeakerVoice;
|
||||||
FString Backdrop;
|
FString Backdrop;
|
||||||
FString Dialogue;
|
FString Dialogue;
|
||||||
FString Goodbye; // must init to null for binary scripts to work as intended
|
FString Goodbye; // must init to null for binary scripts to work as intended
|
||||||
|
|
||||||
FStrifeDialogueReply *Children;
|
FStrifeDialogueReply *Children = nullptr;
|
||||||
FName MenuClassName;
|
FName MenuClassName;
|
||||||
FString UserData;
|
FString UserData;
|
||||||
};
|
};
|
||||||
|
@ -40,13 +40,11 @@ struct FStrifeDialogueNode
|
||||||
// FStrifeDialogueReply holds responses the player can give to the NPC
|
// FStrifeDialogueReply holds responses the player can give to the NPC
|
||||||
struct FStrifeDialogueReply
|
struct FStrifeDialogueReply
|
||||||
{
|
{
|
||||||
~FStrifeDialogueReply ();
|
FStrifeDialogueReply *Next = nullptr;
|
||||||
|
PClassActor *GiveType = nullptr;
|
||||||
FStrifeDialogueReply *Next;
|
int ActionSpecial = 0;
|
||||||
PClassActor *GiveType;
|
int Args[5] = {};
|
||||||
int ActionSpecial;
|
int PrintAmount = 0;
|
||||||
int Args[5];
|
|
||||||
int PrintAmount;
|
|
||||||
TArray<FStrifeDialogueItemCheck> ItemCheck;
|
TArray<FStrifeDialogueItemCheck> ItemCheck;
|
||||||
TArray<FStrifeDialogueItemCheck> ItemCheckRequire;
|
TArray<FStrifeDialogueItemCheck> ItemCheckRequire;
|
||||||
TArray<FStrifeDialogueItemCheck> ItemCheckExclude;
|
TArray<FStrifeDialogueItemCheck> ItemCheckExclude;
|
||||||
|
@ -54,9 +52,9 @@ struct FStrifeDialogueReply
|
||||||
FString QuickYes;
|
FString QuickYes;
|
||||||
FString QuickNo;
|
FString QuickNo;
|
||||||
FString LogString;
|
FString LogString;
|
||||||
int NextNode; // index into StrifeDialogues
|
int NextNode = 0; // index into StrifeDialogues
|
||||||
int LogNumber;
|
int LogNumber = 0;
|
||||||
bool NeedsGold;
|
bool NeedsGold = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern TArray<FStrifeDialogueNode *> StrifeDialogues;
|
extern TArray<FStrifeDialogueNode *> StrifeDialogues;
|
||||||
|
|
|
@ -121,7 +121,6 @@ class USDFParser : public UDMFParserBase
|
||||||
bool ParseChoice(FStrifeDialogueReply **&replyptr)
|
bool ParseChoice(FStrifeDialogueReply **&replyptr)
|
||||||
{
|
{
|
||||||
FStrifeDialogueReply *reply = new FStrifeDialogueReply;
|
FStrifeDialogueReply *reply = new FStrifeDialogueReply;
|
||||||
memset(reply, 0, sizeof(*reply));
|
|
||||||
|
|
||||||
reply->Next = *replyptr;
|
reply->Next = *replyptr;
|
||||||
*replyptr = reply;
|
*replyptr = reply;
|
||||||
|
@ -293,8 +292,6 @@ class USDFParser : public UDMFParserBase
|
||||||
{
|
{
|
||||||
FStrifeDialogueNode *node = new FStrifeDialogueNode;
|
FStrifeDialogueNode *node = new FStrifeDialogueNode;
|
||||||
FStrifeDialogueReply **replyptr = &node->Children;
|
FStrifeDialogueReply **replyptr = &node->Children;
|
||||||
memset(node, 0, sizeof(*node));
|
|
||||||
//node->ItemCheckCount[0] = node->ItemCheckCount[1] = node->ItemCheckCount[2] = -1;
|
|
||||||
|
|
||||||
node->ThisNodeNum = StrifeDialogues.Push(node);
|
node->ThisNodeNum = StrifeDialogues.Push(node);
|
||||||
node->ItemCheckNode = -1;
|
node->ItemCheckNode = -1;
|
||||||
|
|
|
@ -315,9 +315,7 @@ do_stop:
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
#ifdef DYNLIGHT
|
|
||||||
AddStateLight(&state, sc.String);
|
AddStateLight(&state, sc.String);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
while (sc.CheckString(","));
|
while (sc.CheckString(","));
|
||||||
sc.MustGetStringName(")");
|
sc.MustGetStringName(")");
|
||||||
|
|
|
@ -2562,7 +2562,7 @@ void ZCCCompiler::CompileStates()
|
||||||
state.Misc1 = IntConstFromNode(sl->Offset, c->Type());
|
state.Misc1 = IntConstFromNode(sl->Offset, c->Type());
|
||||||
state.Misc2 = IntConstFromNode(static_cast<ZCC_Expression *>(sl->Offset->SiblingNext), c->Type());
|
state.Misc2 = IntConstFromNode(static_cast<ZCC_Expression *>(sl->Offset->SiblingNext), c->Type());
|
||||||
}
|
}
|
||||||
#ifdef DYNLIGHT
|
|
||||||
if (sl->Lights != nullptr)
|
if (sl->Lights != nullptr)
|
||||||
{
|
{
|
||||||
auto l = sl->Lights;
|
auto l = sl->Lights;
|
||||||
|
@ -2572,7 +2572,6 @@ void ZCCCompiler::CompileStates()
|
||||||
l = static_cast<decltype(l)>(l->SiblingNext);
|
l = static_cast<decltype(l)>(l->SiblingNext);
|
||||||
} while (l != sl->Lights);
|
} while (l != sl->Lights);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sl->Action != nullptr)
|
if (sl->Action != nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,8 +87,6 @@ const char *GetVersionString();
|
||||||
// SVN revision ever got.
|
// SVN revision ever got.
|
||||||
#define SAVEVER 4550
|
#define SAVEVER 4550
|
||||||
|
|
||||||
#define DYNLIGHT
|
|
||||||
|
|
||||||
// This is so that derivates can use the same savegame versions without worrying about engine compatibility
|
// This is so that derivates can use the same savegame versions without worrying about engine compatibility
|
||||||
#define GAMESIG "QZDOOM"
|
#define GAMESIG "QZDOOM"
|
||||||
#define BASEWAD "qzdoom.pk3"
|
#define BASEWAD "qzdoom.pk3"
|
||||||
|
|
452
src/wi_stuff.cpp
452
src/wi_stuff.cpp
|
@ -54,171 +54,35 @@
|
||||||
#include "cmdlib.h"
|
#include "cmdlib.h"
|
||||||
#include "g_levellocals.h"
|
#include "g_levellocals.h"
|
||||||
|
|
||||||
// States for the intermission
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
NoState = -1,
|
|
||||||
StatCount,
|
|
||||||
ShowNextLoc,
|
|
||||||
LeavingIntermission
|
|
||||||
} stateenum_t;
|
|
||||||
|
|
||||||
CVAR(Bool, wi_percents, true, CVAR_ARCHIVE)
|
CVAR(Bool, wi_percents, true, CVAR_ARCHIVE)
|
||||||
CVAR(Bool, wi_showtotaltime, true, CVAR_ARCHIVE)
|
CVAR(Bool, wi_showtotaltime, true, CVAR_ARCHIVE)
|
||||||
CVAR(Bool, wi_noautostartmap, false, CVAR_USERINFO | CVAR_ARCHIVE)
|
CVAR(Bool, wi_noautostartmap, false, CVAR_USERINFO | CVAR_ARCHIVE)
|
||||||
CVAR(Int, wi_autoadvance, 0, CVAR_SERVERINFO)
|
CVAR(Int, wi_autoadvance, 0, CVAR_SERVERINFO)
|
||||||
|
|
||||||
|
|
||||||
void WI_loadData ();
|
static const char *WI_Cmd[] = {
|
||||||
void WI_unloadData ();
|
"Background",
|
||||||
|
"Splat",
|
||||||
|
"Pointer",
|
||||||
|
"Spots",
|
||||||
|
|
||||||
// GLOBAL LOCATIONS
|
"IfEntering",
|
||||||
#define WI_TITLEY 2
|
"IfNotEntering",
|
||||||
#define WI_SPACINGY 33
|
"IfVisited",
|
||||||
|
"IfNotVisited",
|
||||||
|
"IfLeaving",
|
||||||
|
"IfNotLeaving",
|
||||||
|
"IfTravelling",
|
||||||
|
"IfNotTravelling",
|
||||||
|
|
||||||
// SINGPLE-PLAYER STUFF
|
"Animation",
|
||||||
#define SP_STATSX 50
|
"Pic",
|
||||||
#define SP_STATSY 50
|
|
||||||
|
|
||||||
#define SP_TIMEX 8
|
"NoAutostartMap",
|
||||||
#define SP_TIMEY (200-32)
|
|
||||||
|
|
||||||
|
NULL
|
||||||
// NET GAME STUFF
|
|
||||||
#define NG_STATSY 50
|
|
||||||
#define NG_STATSX (32 + star->GetScaledWidth()/2 + 32*!dofrags)
|
|
||||||
|
|
||||||
#define NG_SPACINGX 64
|
|
||||||
|
|
||||||
|
|
||||||
// DEATHMATCH STUFF
|
|
||||||
#define DM_MATRIXX 42
|
|
||||||
#define DM_MATRIXY 68
|
|
||||||
|
|
||||||
#define DM_SPACINGX 40
|
|
||||||
|
|
||||||
#define DM_TOTALSX 269
|
|
||||||
|
|
||||||
#define DM_KILLERSX 10
|
|
||||||
#define DM_KILLERSY 100
|
|
||||||
#define DM_VICTIMSX 5
|
|
||||||
#define DM_VICTIMSY 50
|
|
||||||
|
|
||||||
// These animation variables, structures, etc. are used for the
|
|
||||||
// DOOM/Ultimate DOOM intermission screen animations. This is
|
|
||||||
// totally different from any sprite or texture/flat animations
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
ANIM_ALWAYS, // determined by patch entry
|
|
||||||
ANIM_PIC, // continuous
|
|
||||||
|
|
||||||
// condition bitflags
|
|
||||||
ANIM_IFVISITED=8,
|
|
||||||
ANIM_IFNOTVISITED=16,
|
|
||||||
ANIM_IFENTERING=32,
|
|
||||||
ANIM_IFNOTENTERING=64,
|
|
||||||
ANIM_IFLEAVING=128,
|
|
||||||
ANIM_IFNOTLEAVING=256,
|
|
||||||
ANIM_IFTRAVELLING=512,
|
|
||||||
ANIM_IFNOTTRAVELLING=1024,
|
|
||||||
|
|
||||||
ANIM_TYPE=7,
|
|
||||||
ANIM_CONDITION=~7,
|
|
||||||
|
|
||||||
} animenum_t;
|
|
||||||
|
|
||||||
struct yahpt_t
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lnode_t
|
|
||||||
{
|
|
||||||
int x; // x/y coordinate pair structure
|
|
||||||
int y;
|
|
||||||
char level[9];
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
#define FACEBACKOFS 4
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Animation.
|
|
||||||
// There is another anim_t used in p_spec.
|
|
||||||
// (which is why I have renamed this one!)
|
|
||||||
//
|
|
||||||
|
|
||||||
#define MAX_ANIMATION_FRAMES 20
|
|
||||||
struct in_anim_t
|
|
||||||
{
|
|
||||||
int type; // Made an int so I can use '|'
|
|
||||||
int period; // period in tics between animations
|
|
||||||
int nanims; // number of animation frames
|
|
||||||
yahpt_t loc; // location of animation
|
|
||||||
int data; // ALWAYS: n/a, RANDOM: period deviation (<256)
|
|
||||||
FTexture * p[MAX_ANIMATION_FRAMES]; // actual graphics for frames of animations
|
|
||||||
|
|
||||||
// following must be initialized to zero before use!
|
|
||||||
int nexttic; // next value of bcnt (used in conjunction with period)
|
|
||||||
int ctr; // next frame number to animate
|
|
||||||
int state; // used by RANDOM and LEVEL when animating
|
|
||||||
|
|
||||||
char levelname[9];
|
|
||||||
char levelname2[9];
|
|
||||||
};
|
|
||||||
|
|
||||||
static TArray<lnode_t> lnodes;
|
|
||||||
static TArray<in_anim_t> anims;
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// GENERAL DATA
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// Locally used stuff.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
// States for single-player
|
|
||||||
#define SP_KILLS 0
|
|
||||||
#define SP_ITEMS 2
|
|
||||||
#define SP_SECRET 4
|
|
||||||
#define SP_FRAGS 6
|
|
||||||
#define SP_TIME 8
|
|
||||||
#define SP_PAR ST_TIME
|
|
||||||
|
|
||||||
#define SP_PAUSE 1
|
|
||||||
|
|
||||||
#define SHOWNEXTLOCDELAY 4 // in seconds
|
|
||||||
|
|
||||||
static int acceleratestage; // used to accelerate or skip a stage
|
|
||||||
static bool playerready[MAXPLAYERS];
|
|
||||||
static int me; // wbs->pnum
|
|
||||||
static stateenum_t state; // specifies current state
|
|
||||||
static wbstartstruct_t *wbs; // contains information passed into intermission
|
|
||||||
static wbplayerstruct_t*plrs; // wbs->plyr[]
|
|
||||||
static int cnt; // used for general timing
|
|
||||||
static int bcnt; // used for timing of background animation
|
|
||||||
static int cnt_kills[MAXPLAYERS];
|
|
||||||
static int cnt_items[MAXPLAYERS];
|
|
||||||
static int cnt_secret[MAXPLAYERS];
|
|
||||||
static int cnt_frags[MAXPLAYERS];
|
|
||||||
static int cnt_deaths[MAXPLAYERS];
|
|
||||||
static int cnt_time;
|
|
||||||
static int cnt_total_time;
|
|
||||||
static int cnt_par;
|
|
||||||
static int cnt_pause;
|
|
||||||
static int total_frags;
|
|
||||||
static int total_deaths;
|
|
||||||
static bool noautostartmap;
|
|
||||||
static int dofrags;
|
|
||||||
static int ng_state;
|
|
||||||
|
|
||||||
//
|
|
||||||
// GRAPHICS
|
|
||||||
//
|
|
||||||
|
|
||||||
struct FPatchInfo
|
struct FPatchInfo
|
||||||
{
|
{
|
||||||
|
@ -247,65 +111,182 @@ struct FPatchInfo
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static FPatchInfo mapname;
|
|
||||||
static FPatchInfo finished;
|
|
||||||
static FPatchInfo entering;
|
|
||||||
|
|
||||||
static TArray<FTexture *> yah; // You Are Here graphic
|
|
||||||
static FTexture* splat; // splat
|
class FIntermissionScreen
|
||||||
static FTexture* sp_secret; // "secret"
|
{
|
||||||
static FTexture* kills; // "Kills", "Scrt", "Items", "Frags"
|
public:
|
||||||
static FTexture* secret;
|
// States for the intermission
|
||||||
static FTexture* items;
|
enum EState
|
||||||
static FTexture* frags;
|
{
|
||||||
static FTexture* timepic; // Time sucks.
|
NoState = -1,
|
||||||
static FTexture* par;
|
StatCount,
|
||||||
static FTexture* sucks;
|
ShowNextLoc,
|
||||||
static FTexture* killers; // "killers", "victims"
|
LeavingIntermission
|
||||||
static FTexture* victims;
|
};
|
||||||
static FTexture* total; // "Total", your face, your dead face
|
|
||||||
//static FTexture* star;
|
|
||||||
//static FTexture* bstar;
|
enum EValues
|
||||||
static FTexture* p; // Player graphic
|
{
|
||||||
static FTexture* lnames[2]; // Name graphics of each level (centered)
|
// GLOBAL LOCATIONS
|
||||||
|
WI_TITLEY = 2,
|
||||||
|
|
||||||
|
// SINGPLE-PLAYER STUFF
|
||||||
|
SP_STATSX = 50,
|
||||||
|
SP_STATSY = 50,
|
||||||
|
|
||||||
|
SP_TIMEX = 8,
|
||||||
|
SP_TIMEY = (200 - 32),
|
||||||
|
|
||||||
|
// NET GAME STUFF
|
||||||
|
NG_STATSY = 50,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// These animation variables, structures, etc. are used for the
|
||||||
|
// DOOM/Ultimate DOOM intermission screen animations. This is
|
||||||
|
// totally different from any sprite or texture/flat animations
|
||||||
|
enum EAnim
|
||||||
|
{
|
||||||
|
ANIM_ALWAYS, // determined by patch entry
|
||||||
|
ANIM_PIC, // continuous
|
||||||
|
|
||||||
|
// condition bitflags
|
||||||
|
ANIM_IFVISITED = 8,
|
||||||
|
ANIM_IFNOTVISITED = 16,
|
||||||
|
ANIM_IFENTERING = 32,
|
||||||
|
ANIM_IFNOTENTERING = 64,
|
||||||
|
ANIM_IFLEAVING = 128,
|
||||||
|
ANIM_IFNOTLEAVING = 256,
|
||||||
|
ANIM_IFTRAVELLING = 512,
|
||||||
|
ANIM_IFNOTTRAVELLING = 1024,
|
||||||
|
|
||||||
|
ANIM_TYPE = 7,
|
||||||
|
ANIM_CONDITION = ~7,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// States for single-player
|
||||||
|
enum ESPState
|
||||||
|
{
|
||||||
|
SP_KILLS = 0,
|
||||||
|
SP_ITEMS = 2,
|
||||||
|
SP_SECRET = 4,
|
||||||
|
SP_FRAGS = 6,
|
||||||
|
SP_TIME = 8,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int SHOWNEXTLOCDELAY = 4; // in seconds
|
||||||
|
|
||||||
|
struct yahpt_t
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct lnode_t
|
||||||
|
{
|
||||||
|
int x; // x/y coordinate pair structure
|
||||||
|
int y;
|
||||||
|
char level[9];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Animation.
|
||||||
|
// There is another anim_t used in p_spec.
|
||||||
|
// (which is why I have renamed this one!)
|
||||||
|
//
|
||||||
|
|
||||||
|
struct in_anim_t
|
||||||
|
{
|
||||||
|
int type; // Made an int so I can use '|'
|
||||||
|
int period; // period in tics between animations
|
||||||
|
yahpt_t loc; // location of animation
|
||||||
|
int data; // ALWAYS: n/a, RANDOM: period deviation (<256)
|
||||||
|
TArray<FTexture*> frames; // actual graphics for frames of animations
|
||||||
|
|
||||||
|
// following must be initialized to zero before use!
|
||||||
|
int nexttic; // next value of bcnt (used in conjunction with period)
|
||||||
|
int ctr; // next frame number to animate
|
||||||
|
int state; // used by RANDOM and LEVEL when animating
|
||||||
|
|
||||||
|
FString LevelName;
|
||||||
|
FString LevelName2;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
type = period = loc.x = loc.y = data = nexttic = ctr = state = 0;
|
||||||
|
LevelName = "";
|
||||||
|
LevelName2 = "";
|
||||||
|
frames.Clear();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TArray<lnode_t> lnodes;
|
||||||
|
TArray<in_anim_t> anims;
|
||||||
|
|
||||||
|
int acceleratestage; // used to accelerate or skip a stage
|
||||||
|
bool playerready[MAXPLAYERS];
|
||||||
|
int me; // wbs->pnum
|
||||||
|
EState state; // specifies current state
|
||||||
|
wbstartstruct_t *wbs; // contains information passed into intermission
|
||||||
|
wbplayerstruct_t*plrs; // wbs->plyr[]
|
||||||
|
int cnt; // used for general timing
|
||||||
|
int bcnt; // used for timing of background animation
|
||||||
|
int cnt_kills[MAXPLAYERS];
|
||||||
|
int cnt_items[MAXPLAYERS];
|
||||||
|
int cnt_secret[MAXPLAYERS];
|
||||||
|
int cnt_frags[MAXPLAYERS];
|
||||||
|
int cnt_deaths[MAXPLAYERS];
|
||||||
|
int cnt_time;
|
||||||
|
int cnt_total_time;
|
||||||
|
int cnt_par;
|
||||||
|
int cnt_pause;
|
||||||
|
int total_frags;
|
||||||
|
int total_deaths;
|
||||||
|
bool noautostartmap;
|
||||||
|
int dofrags;
|
||||||
|
int ng_state;
|
||||||
|
|
||||||
|
//
|
||||||
|
// GRAPHICS
|
||||||
|
//
|
||||||
|
|
||||||
|
FPatchInfo mapname;
|
||||||
|
FPatchInfo finished;
|
||||||
|
FPatchInfo entering;
|
||||||
|
|
||||||
|
TArray<FTexture *> yah; // You Are Here graphic
|
||||||
|
FTexture* splat; // splat
|
||||||
|
FTexture* sp_secret; // "secret"
|
||||||
|
FTexture* kills; // "Kills", "Scrt", "Items", "Frags"
|
||||||
|
FTexture* secret;
|
||||||
|
FTexture* items;
|
||||||
|
FTexture* frags;
|
||||||
|
FTexture* timepic; // Time sucks.
|
||||||
|
FTexture* par;
|
||||||
|
FTexture* sucks;
|
||||||
|
FTexture* killers; // "killers", "victims"
|
||||||
|
FTexture* victims;
|
||||||
|
FTexture* total; // "Total", your face, your dead face
|
||||||
|
FTexture* p; // Player graphic
|
||||||
|
FTexture* lnames[2]; // Name graphics of each level (centered)
|
||||||
|
|
||||||
// [RH] Info to dynamically generate the level name graphics
|
// [RH] Info to dynamically generate the level name graphics
|
||||||
static FString lnametexts[2];
|
FString lnametexts[2];
|
||||||
|
|
||||||
static FTexture *background;
|
FTexture *background;
|
||||||
|
|
||||||
|
bool snl_pointeron = false;
|
||||||
|
|
||||||
|
int player_deaths[MAXPLAYERS];
|
||||||
|
int sp_state;
|
||||||
|
|
||||||
//
|
//
|
||||||
// CODE
|
// CODE
|
||||||
//
|
//
|
||||||
|
|
||||||
// ====================================================================
|
|
||||||
//
|
|
||||||
// Background script commands
|
|
||||||
//
|
|
||||||
// ====================================================================
|
|
||||||
|
|
||||||
static const char *WI_Cmd[]={
|
|
||||||
"Background",
|
|
||||||
"Splat",
|
|
||||||
"Pointer",
|
|
||||||
"Spots",
|
|
||||||
|
|
||||||
"IfEntering",
|
|
||||||
"IfNotEntering",
|
|
||||||
"IfVisited",
|
|
||||||
"IfNotVisited",
|
|
||||||
"IfLeaving",
|
|
||||||
"IfNotLeaving",
|
|
||||||
"IfTravelling",
|
|
||||||
"IfNotTravelling",
|
|
||||||
|
|
||||||
"Animation",
|
|
||||||
"Pic",
|
|
||||||
|
|
||||||
"NoAutostartMap",
|
|
||||||
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
//
|
//
|
||||||
|
@ -439,7 +420,7 @@ void WI_LoadBackground(bool isenterpic)
|
||||||
FScanner sc(lumpnum);
|
FScanner sc(lumpnum);
|
||||||
while (sc.GetString())
|
while (sc.GetString())
|
||||||
{
|
{
|
||||||
memset(&an,0,sizeof(an));
|
an.Reset();
|
||||||
int caseval = sc.MustMatchString(WI_Cmd);
|
int caseval = sc.MustMatchString(WI_Cmd);
|
||||||
switch(caseval)
|
switch(caseval)
|
||||||
{
|
{
|
||||||
|
@ -504,15 +485,13 @@ void WI_LoadBackground(bool isenterpic)
|
||||||
case 10: // IfTravelling
|
case 10: // IfTravelling
|
||||||
an.type = ANIM_IFTRAVELLING;
|
an.type = ANIM_IFTRAVELLING;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
strncpy(an.levelname2, sc.String, 8);
|
an.LevelName2 = sc.String;
|
||||||
an.levelname2[8] = 0;
|
|
||||||
goto readanimation;
|
goto readanimation;
|
||||||
|
|
||||||
case 11: // IfNotTravelling
|
case 11: // IfNotTravelling
|
||||||
an.type = ANIM_IFTRAVELLING;
|
an.type = ANIM_IFTRAVELLING;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
strncpy(an.levelname2, sc.String, 8);
|
an.LevelName2 = sc.String;
|
||||||
an.levelname2[8] = 0;
|
|
||||||
goto readanimation;
|
goto readanimation;
|
||||||
|
|
||||||
case 14: // NoAutostartMap
|
case 14: // NoAutostartMap
|
||||||
|
@ -521,8 +500,7 @@ void WI_LoadBackground(bool isenterpic)
|
||||||
|
|
||||||
readanimation:
|
readanimation:
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
strncpy(an.levelname, sc.String, 8);
|
an.LevelName = sc.String;
|
||||||
an.levelname[8] = 0;
|
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
caseval=sc.MustMatchString(WI_Cmd);
|
caseval=sc.MustMatchString(WI_Cmd);
|
||||||
|
|
||||||
|
@ -552,15 +530,14 @@ void WI_LoadBackground(bool isenterpic)
|
||||||
if (!sc.CheckString("{"))
|
if (!sc.CheckString("{"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
an.p[an.nanims++] = TexMan[sc.String];
|
an.frames.Push(TexMan[sc.String]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (!sc.CheckString("}"))
|
while (!sc.CheckString("}"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
if (an.nanims<MAX_ANIMATION_FRAMES)
|
an.frames.Push(TexMan[sc.String]);
|
||||||
an.p[an.nanims++] = TexMan[sc.String];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
an.ctr = -1;
|
an.ctr = -1;
|
||||||
|
@ -574,7 +551,8 @@ void WI_LoadBackground(bool isenterpic)
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
an.loc.y = sc.Number;
|
an.loc.y = sc.Number;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
an.p[0] = TexMan[sc.String];
|
an.frames.Reserve(1); // allocate exactly one element
|
||||||
|
an.frames[0] = TexMan[sc.String];
|
||||||
anims.Push(an);
|
anims.Push(an);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -612,7 +590,7 @@ void WI_updateAnimatedBack()
|
||||||
case ANIM_ALWAYS:
|
case ANIM_ALWAYS:
|
||||||
if (bcnt >= a->nexttic)
|
if (bcnt >= a->nexttic)
|
||||||
{
|
{
|
||||||
if (++a->ctr >= a->nanims)
|
if (++a->ctr >= (int)a->frames.Size())
|
||||||
{
|
{
|
||||||
if (a->data==0) a->ctr = 0;
|
if (a->data==0) a->ctr = 0;
|
||||||
else a->ctr--;
|
else a->ctr--;
|
||||||
|
@ -672,42 +650,42 @@ void WI_drawBackground()
|
||||||
switch (a->type & ANIM_CONDITION)
|
switch (a->type & ANIM_CONDITION)
|
||||||
{
|
{
|
||||||
case ANIM_IFVISITED:
|
case ANIM_IFVISITED:
|
||||||
li = FindLevelInfo(a->levelname);
|
li = FindLevelInfo(a->LevelName);
|
||||||
if (li == NULL || !(li->flags & LEVEL_VISITED)) continue;
|
if (li == NULL || !(li->flags & LEVEL_VISITED)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFNOTVISITED:
|
case ANIM_IFNOTVISITED:
|
||||||
li = FindLevelInfo(a->levelname);
|
li = FindLevelInfo(a->LevelName);
|
||||||
if (li == NULL || (li->flags & LEVEL_VISITED)) continue;
|
if (li == NULL || (li->flags & LEVEL_VISITED)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// StatCount means 'leaving' - everything else means 'entering'!
|
// StatCount means 'leaving' - everything else means 'entering'!
|
||||||
case ANIM_IFENTERING:
|
case ANIM_IFENTERING:
|
||||||
if (state == StatCount || strnicmp(a->levelname, wbs->next, 8)) continue;
|
if (state == StatCount || strnicmp(a->LevelName, wbs->next, 8)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFNOTENTERING:
|
case ANIM_IFNOTENTERING:
|
||||||
if (state != StatCount && !strnicmp(a->levelname, wbs->next, 8)) continue;
|
if (state != StatCount && !strnicmp(a->LevelName, wbs->next, 8)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFLEAVING:
|
case ANIM_IFLEAVING:
|
||||||
if (state != StatCount || strnicmp(a->levelname, wbs->current, 8)) continue;
|
if (state != StatCount || strnicmp(a->LevelName, wbs->current, 8)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFNOTLEAVING:
|
case ANIM_IFNOTLEAVING:
|
||||||
if (state == StatCount && !strnicmp(a->levelname, wbs->current, 8)) continue;
|
if (state == StatCount && !strnicmp(a->LevelName, wbs->current, 8)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFTRAVELLING:
|
case ANIM_IFTRAVELLING:
|
||||||
if (strnicmp(a->levelname2, wbs->current, 8) || strnicmp(a->levelname, wbs->next, 8)) continue;
|
if (strnicmp(a->LevelName2, wbs->current, 8) || strnicmp(a->LevelName, wbs->next, 8)) continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIM_IFNOTTRAVELLING:
|
case ANIM_IFNOTTRAVELLING:
|
||||||
if (!strnicmp(a->levelname2, wbs->current, 8) && !strnicmp(a->levelname, wbs->next, 8)) continue;
|
if (!strnicmp(a->LevelName2, wbs->current, 8) && !strnicmp(a->LevelName, wbs->next, 8)) continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (a->ctr >= 0)
|
if (a->ctr >= 0)
|
||||||
screen->DrawTexture(a->p[a->ctr], a->loc.x, a->loc.y,
|
screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y,
|
||||||
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
|
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -719,7 +697,7 @@ void WI_drawBackground()
|
||||||
//
|
//
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
static int WI_DrawCharPatch (FFont *font, int charcode, int x, int y, EColorRange translation=CR_UNTRANSLATED, bool nomove=false)
|
int WI_DrawCharPatch (FFont *font, int charcode, int x, int y, EColorRange translation=CR_UNTRANSLATED, bool nomove=false)
|
||||||
{
|
{
|
||||||
int width;
|
int width;
|
||||||
font->GetChar(charcode, &width);
|
font->GetChar(charcode, &width);
|
||||||
|
@ -1143,7 +1121,6 @@ void WI_updateNoState ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool snl_pointeron = false;
|
|
||||||
|
|
||||||
void WI_initShowNextLoc ()
|
void WI_initShowNextLoc ()
|
||||||
{
|
{
|
||||||
|
@ -1225,7 +1202,6 @@ int WI_fragSum (int playernum)
|
||||||
return frags;
|
return frags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int player_deaths[MAXPLAYERS];
|
|
||||||
|
|
||||||
void WI_initDeathmatchStats (void)
|
void WI_initDeathmatchStats (void)
|
||||||
{
|
{
|
||||||
|
@ -1795,7 +1771,6 @@ void WI_drawNetgameStats ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sp_state;
|
|
||||||
|
|
||||||
void WI_initStats ()
|
void WI_initStats ()
|
||||||
{
|
{
|
||||||
|
@ -2184,3 +2159,24 @@ void WI_Start (wbstartstruct_t *wbstartstruct)
|
||||||
S_StopAllChannels ();
|
S_StopAllChannels ();
|
||||||
SN_StopAllSequences ();
|
SN_StopAllSequences ();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static FIntermissionScreen WI_Screen;
|
||||||
|
|
||||||
|
void WI_Ticker()
|
||||||
|
{
|
||||||
|
WI_Screen.WI_Ticker();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called by main loop,
|
||||||
|
// draws the intermission directly into the screen buffer.
|
||||||
|
void WI_Drawer()
|
||||||
|
{
|
||||||
|
WI_Screen.WI_Drawer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup for an intermission screen.
|
||||||
|
void WI_Start(wbstartstruct_t *wbstartstruct)
|
||||||
|
{
|
||||||
|
WI_Screen.WI_Start(wbstartstruct);
|
||||||
|
}
|
||||||
|
|
|
@ -290,6 +290,12 @@ struct CVar native
|
||||||
native int ResetToDefault();
|
native int ResetToDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct GIFont
|
||||||
|
{
|
||||||
|
Name fontname;
|
||||||
|
Name color;
|
||||||
|
};
|
||||||
|
|
||||||
struct GameInfoStruct native
|
struct GameInfoStruct native
|
||||||
{
|
{
|
||||||
// will be extended as needed.
|
// will be extended as needed.
|
||||||
|
@ -301,6 +307,9 @@ struct GameInfoStruct native
|
||||||
native bool norandomplayerclass;
|
native bool norandomplayerclass;
|
||||||
native Array<Name> infoPages;
|
native Array<Name> infoPages;
|
||||||
native String mBackButton;
|
native String mBackButton;
|
||||||
|
native GIFont mStatscreenMapNameFont;
|
||||||
|
native GIFont mStatscreenEnteringFont;
|
||||||
|
native GIFont mStatscreenFinishedFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Object native
|
class Object native
|
||||||
|
|
|
@ -2651,16 +2651,6 @@ flickerlight LGNTAIL
|
||||||
chance 0.8
|
chance 0.8
|
||||||
}
|
}
|
||||||
|
|
||||||
object StrifeZap1
|
|
||||||
{
|
|
||||||
frame ZAP1A { light ARROWZAP1 }
|
|
||||||
frame ZAP1B { light ARROWZAP2 }
|
|
||||||
frame ZAP1C { light ARROWZAP3 }
|
|
||||||
frame ZAP1D { light ARROWZAP4 }
|
|
||||||
frame ZAP1E { light ARROWZAP5 }
|
|
||||||
frame ZAP1F { light ARROWZAP6 }
|
|
||||||
}
|
|
||||||
|
|
||||||
object SpectralLightningBase
|
object SpectralLightningBase
|
||||||
{
|
{
|
||||||
frame ZAP1A { light ARROWZAP1 }
|
frame ZAP1A { light ARROWZAP1 }
|
||||||
|
|
Loading…
Reference in a new issue