Merge branch 'master' of https://github.com/raa-eruanna/qzdoom into qzdoom

This commit is contained in:
Magnus Norddahl 2017-02-23 06:01:23 +01:00
commit 548aec01ec
13 changed files with 1973 additions and 1994 deletions

View File

@ -544,7 +544,6 @@ void FullGC()
void Barrier(DObject *pointing, DObject *pointed)
{
assert(pointed->GetClass() != nullptr);
assert(pointing == NULL || (pointing->IsBlack() && !pointing->IsDead()));
assert(pointed->IsWhite() && !pointed->IsDead());
assert(State != GCS_Finalize && State != GCS_Pause);

View File

@ -53,6 +53,9 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, gametype)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, norandomplayerclass)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, infoPages)
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] =

View File

@ -411,7 +411,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc)
else if (args[i] == TypeTextureID)
{
auto f = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
if (!f.isValid())
if (!f.Exists())
{
sc.ScriptError("Unknown texture %s", sc.String);
}

View File

@ -2821,6 +2821,8 @@ void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool alwa
"Unloading",
"Disconnect",
"Return",
"Event",
"Kill",
"Reopen"
};
DPrintf(DMSG_NOTIFY, "Starting all scripts of type %d (%s)\n", type,

View File

@ -568,16 +568,6 @@ FStrifeDialogueNode::~FStrifeDialogueNode ()
}
}
//============================================================================
//
// FStrifeDialogueReply :: ~FStrifeDialogueReply
//
//============================================================================
FStrifeDialogueReply::~FStrifeDialogueReply ()
{
}
//============================================================================
//
// FindNode

View File

@ -20,19 +20,19 @@ struct FStrifeDialogueItemCheck
struct FStrifeDialogueNode
{
~FStrifeDialogueNode ();
PClassActor *DropType;
PClassActor *DropType = nullptr;
TArray<FStrifeDialogueItemCheck> ItemCheck;
int ThisNodeNum; // location of this node in StrifeDialogues
int ItemCheckNode; // index into StrifeDialogues
int ThisNodeNum = 0; // location of this node in StrifeDialogues
int ItemCheckNode = 0; // index into StrifeDialogues
PClassActor *SpeakerType;
PClassActor *SpeakerType = nullptr;
FString SpeakerName;
FSoundID SpeakerVoice;
FString Backdrop;
FString Dialogue;
FString Goodbye; // must init to null for binary scripts to work as intended
FStrifeDialogueReply *Children;
FStrifeDialogueReply *Children = nullptr;
FName MenuClassName;
FString UserData;
};
@ -40,13 +40,11 @@ struct FStrifeDialogueNode
// FStrifeDialogueReply holds responses the player can give to the NPC
struct FStrifeDialogueReply
{
~FStrifeDialogueReply ();
FStrifeDialogueReply *Next;
PClassActor *GiveType;
int ActionSpecial;
int Args[5];
int PrintAmount;
FStrifeDialogueReply *Next = nullptr;
PClassActor *GiveType = nullptr;
int ActionSpecial = 0;
int Args[5] = {};
int PrintAmount = 0;
TArray<FStrifeDialogueItemCheck> ItemCheck;
TArray<FStrifeDialogueItemCheck> ItemCheckRequire;
TArray<FStrifeDialogueItemCheck> ItemCheckExclude;
@ -54,9 +52,9 @@ struct FStrifeDialogueReply
FString QuickYes;
FString QuickNo;
FString LogString;
int NextNode; // index into StrifeDialogues
int LogNumber;
bool NeedsGold;
int NextNode = 0; // index into StrifeDialogues
int LogNumber = 0;
bool NeedsGold = false;
};
extern TArray<FStrifeDialogueNode *> StrifeDialogues;

View File

@ -121,7 +121,6 @@ class USDFParser : public UDMFParserBase
bool ParseChoice(FStrifeDialogueReply **&replyptr)
{
FStrifeDialogueReply *reply = new FStrifeDialogueReply;
memset(reply, 0, sizeof(*reply));
reply->Next = *replyptr;
*replyptr = reply;
@ -293,8 +292,6 @@ class USDFParser : public UDMFParserBase
{
FStrifeDialogueNode *node = new FStrifeDialogueNode;
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->ItemCheckNode = -1;

View File

@ -315,9 +315,7 @@ do_stop:
do
{
sc.MustGetString();
#ifdef DYNLIGHT
AddStateLight(&state, sc.String);
#endif
}
while (sc.CheckString(","));
sc.MustGetStringName(")");

View File

@ -2562,7 +2562,7 @@ void ZCCCompiler::CompileStates()
state.Misc1 = IntConstFromNode(sl->Offset, c->Type());
state.Misc2 = IntConstFromNode(static_cast<ZCC_Expression *>(sl->Offset->SiblingNext), c->Type());
}
#ifdef DYNLIGHT
if (sl->Lights != nullptr)
{
auto l = sl->Lights;
@ -2572,7 +2572,6 @@ void ZCCCompiler::CompileStates()
l = static_cast<decltype(l)>(l->SiblingNext);
} while (l != sl->Lights);
}
#endif
if (sl->Action != nullptr)
{

View File

@ -87,8 +87,6 @@ const char *GetVersionString();
// SVN revision ever got.
#define SAVEVER 4550
#define DYNLIGHT
// This is so that derivates can use the same savegame versions without worrying about engine compatibility
#define GAMESIG "QZDOOM"
#define BASEWAD "qzdoom.pk3"

View File

@ -54,171 +54,35 @@
#include "cmdlib.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_showtotaltime, true, CVAR_ARCHIVE)
CVAR(Bool, wi_noautostartmap, false, CVAR_USERINFO | CVAR_ARCHIVE)
CVAR(Int, wi_autoadvance, 0, CVAR_SERVERINFO)
void WI_loadData ();
void WI_unloadData ();
static const char *WI_Cmd[] = {
"Background",
"Splat",
"Pointer",
"Spots",
// GLOBAL LOCATIONS
#define WI_TITLEY 2
#define WI_SPACINGY 33
"IfEntering",
"IfNotEntering",
"IfVisited",
"IfNotVisited",
"IfLeaving",
"IfNotLeaving",
"IfTravelling",
"IfNotTravelling",
// SINGPLE-PLAYER STUFF
#define SP_STATSX 50
#define SP_STATSY 50
"Animation",
"Pic",
#define SP_TIMEX 8
#define SP_TIMEY (200-32)
"NoAutostartMap",
// 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;
NULL
};
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
{
@ -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
static FTexture* sp_secret; // "secret"
static FTexture* kills; // "Kills", "Scrt", "Items", "Frags"
static FTexture* secret;
static FTexture* items;
static FTexture* frags;
static FTexture* timepic; // Time sucks.
static FTexture* par;
static FTexture* sucks;
static FTexture* killers; // "killers", "victims"
static FTexture* victims;
static FTexture* total; // "Total", your face, your dead face
//static FTexture* star;
//static FTexture* bstar;
static FTexture* p; // Player graphic
static FTexture* lnames[2]; // Name graphics of each level (centered)
class FIntermissionScreen
{
public:
// States for the intermission
enum EState
{
NoState = -1,
StatCount,
ShowNextLoc,
LeavingIntermission
};
enum EValues
{
// 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
static FString lnametexts[2];
FString lnametexts[2];
static FTexture *background;
FTexture *background;
bool snl_pointeron = false;
int player_deaths[MAXPLAYERS];
int sp_state;
//
// 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);
while (sc.GetString())
{
memset(&an,0,sizeof(an));
an.Reset();
int caseval = sc.MustMatchString(WI_Cmd);
switch(caseval)
{
@ -504,15 +485,13 @@ void WI_LoadBackground(bool isenterpic)
case 10: // IfTravelling
an.type = ANIM_IFTRAVELLING;
sc.MustGetString();
strncpy(an.levelname2, sc.String, 8);
an.levelname2[8] = 0;
an.LevelName2 = sc.String;
goto readanimation;
case 11: // IfNotTravelling
an.type = ANIM_IFTRAVELLING;
sc.MustGetString();
strncpy(an.levelname2, sc.String, 8);
an.levelname2[8] = 0;
an.LevelName2 = sc.String;
goto readanimation;
case 14: // NoAutostartMap
@ -521,8 +500,7 @@ void WI_LoadBackground(bool isenterpic)
readanimation:
sc.MustGetString();
strncpy(an.levelname, sc.String, 8);
an.levelname[8] = 0;
an.LevelName = sc.String;
sc.MustGetString();
caseval=sc.MustMatchString(WI_Cmd);
@ -552,15 +530,14 @@ void WI_LoadBackground(bool isenterpic)
if (!sc.CheckString("{"))
{
sc.MustGetString();
an.p[an.nanims++] = TexMan[sc.String];
an.frames.Push(TexMan[sc.String]);
}
else
{
while (!sc.CheckString("}"))
{
sc.MustGetString();
if (an.nanims<MAX_ANIMATION_FRAMES)
an.p[an.nanims++] = TexMan[sc.String];
an.frames.Push(TexMan[sc.String]);
}
}
an.ctr = -1;
@ -574,7 +551,8 @@ void WI_LoadBackground(bool isenterpic)
sc.MustGetNumber();
an.loc.y = sc.Number;
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);
break;
@ -612,7 +590,7 @@ void WI_updateAnimatedBack()
case ANIM_ALWAYS:
if (bcnt >= a->nexttic)
{
if (++a->ctr >= a->nanims)
if (++a->ctr >= (int)a->frames.Size())
{
if (a->data==0) a->ctr = 0;
else a->ctr--;
@ -672,42 +650,42 @@ void WI_drawBackground()
switch (a->type & ANIM_CONDITION)
{
case ANIM_IFVISITED:
li = FindLevelInfo(a->levelname);
li = FindLevelInfo(a->LevelName);
if (li == NULL || !(li->flags & LEVEL_VISITED)) continue;
break;
case ANIM_IFNOTVISITED:
li = FindLevelInfo(a->levelname);
li = FindLevelInfo(a->LevelName);
if (li == NULL || (li->flags & LEVEL_VISITED)) continue;
break;
// StatCount means 'leaving' - everything else means 'entering'!
case ANIM_IFENTERING:
if (state == StatCount || strnicmp(a->levelname, wbs->next, 8)) continue;
if (state == StatCount || strnicmp(a->LevelName, wbs->next, 8)) continue;
break;
case ANIM_IFNOTENTERING:
if (state != StatCount && !strnicmp(a->levelname, wbs->next, 8)) continue;
if (state != StatCount && !strnicmp(a->LevelName, wbs->next, 8)) continue;
break;
case ANIM_IFLEAVING:
if (state != StatCount || strnicmp(a->levelname, wbs->current, 8)) continue;
if (state != StatCount || strnicmp(a->LevelName, wbs->current, 8)) continue;
break;
case ANIM_IFNOTLEAVING:
if (state == StatCount && !strnicmp(a->levelname, wbs->current, 8)) continue;
if (state == StatCount && !strnicmp(a->LevelName, wbs->current, 8)) continue;
break;
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;
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;
}
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);
}
}
@ -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;
font->GetChar(charcode, &width);
@ -1143,7 +1121,6 @@ void WI_updateNoState ()
}
}
static bool snl_pointeron = false;
void WI_initShowNextLoc ()
{
@ -1225,7 +1202,6 @@ int WI_fragSum (int playernum)
return frags;
}
static int player_deaths[MAXPLAYERS];
void WI_initDeathmatchStats (void)
{
@ -1795,7 +1771,6 @@ void WI_drawNetgameStats ()
}
}
static int sp_state;
void WI_initStats ()
{
@ -2184,3 +2159,24 @@ void WI_Start (wbstartstruct_t *wbstartstruct)
S_StopAllChannels ();
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);
}

View File

@ -290,6 +290,12 @@ struct CVar native
native int ResetToDefault();
}
struct GIFont
{
Name fontname;
Name color;
};
struct GameInfoStruct native
{
// will be extended as needed.
@ -301,6 +307,9 @@ struct GameInfoStruct native
native bool norandomplayerclass;
native Array<Name> infoPages;
native String mBackButton;
native GIFont mStatscreenMapNameFont;
native GIFont mStatscreenEnteringFont;
native GIFont mStatscreenFinishedFont;
}
class Object native

View File

@ -2651,16 +2651,6 @@ flickerlight LGNTAIL
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
{
frame ZAP1A { light ARROWZAP1 }