mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-16 16:01:06 +00:00
Merge branch 'master' of https://github.com/coelckers/gzdoom
This commit is contained in:
commit
473f880d11
14 changed files with 56 additions and 19 deletions
|
@ -1743,7 +1743,8 @@ static void G_QueueBody (AActor *body)
|
|||
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
|
||||
void G_DoReborn (int playernum, bool freshbot)
|
||||
{
|
||||
if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn)
|
||||
if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
|
||||
!G_SkillProperty(SKILLP_PlayerRespawn))
|
||||
{
|
||||
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()))
|
||||
{ // Load game from the last point it was saved
|
||||
|
|
|
@ -1952,6 +1952,23 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, SetInterMusic)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
float FLevelLocals::PixelStretch()
|
||||
{
|
||||
return level.info->pixelstretch;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FLevelLocals, GetPixelStretch)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
|
||||
ACTION_RETURN_FLOAT(self->PixelStretch());
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -538,6 +538,7 @@ enum ESkillProperty
|
|||
SKILLP_EasyKey,
|
||||
SKILLP_SlowMonsters,
|
||||
SKILLP_Infight,
|
||||
SKILLP_PlayerRespawn,
|
||||
};
|
||||
enum EFSkillProperty // floating point properties
|
||||
{
|
||||
|
@ -595,6 +596,7 @@ struct FSkillInfo
|
|||
double FriendlyHealth;
|
||||
bool NoPain;
|
||||
int Infighting;
|
||||
bool PlayerRespawn;
|
||||
|
||||
FSkillInfo() {}
|
||||
FSkillInfo(const FSkillInfo &other)
|
||||
|
|
|
@ -46,6 +46,7 @@ struct FLevelLocals
|
|||
void Tick ();
|
||||
void AddScroller (int secnum);
|
||||
void SetInterMusic(const char *nextmap);
|
||||
float PixelStretch();
|
||||
|
||||
uint8_t md5[16]; // for savegame validation. If the MD5 does not match the savegame won't be loaded.
|
||||
int time; // time in the hub
|
||||
|
|
|
@ -50,15 +50,17 @@ DFlashFader::DFlashFader ()
|
|||
|
||||
DFlashFader::DFlashFader (float r1, float g1, float b1, float a1,
|
||||
float r2, float g2, float b2, float a2,
|
||||
float time, AActor *who)
|
||||
float time, AActor *who, bool terminate)
|
||||
: TotalTics ((int)(time*TICRATE)), StartTic (level.time), ForWho (who)
|
||||
{
|
||||
Blends[0][0]=r1; Blends[0][1]=g1; Blends[0][2]=b1; Blends[0][3]=a1;
|
||||
Blends[1][0]=r2; Blends[1][1]=g2; Blends[1][2]=b2; Blends[1][3]=a2;
|
||||
Terminate = terminate;
|
||||
}
|
||||
|
||||
void DFlashFader::OnDestroy ()
|
||||
{
|
||||
if (Terminate) Blends[1][3] = 0.f; // Needed in order to cancel out the secondary fade.
|
||||
SetBlend (1.f);
|
||||
Super::OnDestroy();
|
||||
}
|
||||
|
|
|
@ -84,19 +84,20 @@ class DFlashFader : public DThinker
|
|||
public:
|
||||
DFlashFader (float r1, float g1, float b1, float a1,
|
||||
float r2, float g2, float b2, float a2,
|
||||
float time, AActor *who);
|
||||
float time, AActor *who, bool terminate = false);
|
||||
void OnDestroy() override;
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick ();
|
||||
AActor *WhoFor() { return ForWho; }
|
||||
void Cancel ();
|
||||
|
||||
|
||||
protected:
|
||||
float Blends[2][4];
|
||||
int TotalTics;
|
||||
int StartTic;
|
||||
TObjPtr<AActor*> ForWho;
|
||||
|
||||
bool Terminate;
|
||||
void SetBlend (float time);
|
||||
DFlashFader ();
|
||||
};
|
||||
|
|
|
@ -89,6 +89,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.FriendlyHealth = 1.;
|
||||
skill.NoPain = false;
|
||||
skill.Infighting = 0;
|
||||
skill.PlayerRespawn = false;
|
||||
|
||||
sc.MustGetString();
|
||||
skill.Name = sc.String;
|
||||
|
@ -155,6 +156,10 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
skill.NoMenu = true;
|
||||
}
|
||||
else if (sc.Compare ("playerrespawn"))
|
||||
{
|
||||
skill.PlayerRespawn = true;
|
||||
}
|
||||
else if (sc.Compare("respawntime"))
|
||||
{
|
||||
ParseAssign();
|
||||
|
@ -397,6 +402,9 @@ int G_SkillProperty(ESkillProperty prop)
|
|||
if (AllSkills[gameskill].Infighting == LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (AllSkills[gameskill].Infighting == LEVEL2_NOINFIGHTING) return -1;
|
||||
return infighting;
|
||||
|
||||
case SKILLP_PlayerRespawn:
|
||||
return AllSkills[gameskill].PlayerRespawn;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -550,6 +558,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
|
|||
Infighting = other.Infighting;
|
||||
ArmorFactor = other.ArmorFactor;
|
||||
HealthFactor = other.HealthFactor;
|
||||
PlayerRespawn = other.PlayerRespawn;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,19 +50,19 @@ void QuadStereo::checkInitialRenderContextState()
|
|||
{
|
||||
// Keep trying until we see at least one good OpenGL context to render to
|
||||
static bool bDecentContextWasFound = false;
|
||||
if (!bDecentContextWasFound) {
|
||||
// I'm using a "random" OpenGL call (glGetFramebufferAttachmentParameteriv)
|
||||
// that appears to correlate with whether the context is ready
|
||||
GLint attachmentType = GL_NONE;
|
||||
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &attachmentType);
|
||||
if (attachmentType != GL_NONE) // Finally, a useful OpenGL context
|
||||
static int contextCheckCount = 0;
|
||||
if ( (! bDecentContextWasFound) && (contextCheckCount < 200) )
|
||||
{
|
||||
contextCheckCount += 1;
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); // This question is about the main screen display context
|
||||
GLboolean supportsStereo, supportsBuffered;
|
||||
glGetBooleanv(GL_DOUBLEBUFFER, &supportsBuffered);
|
||||
if (supportsBuffered) // Finally, a useful OpenGL context
|
||||
{
|
||||
// This block will be executed exactly ONCE during a game run
|
||||
bDecentContextWasFound = true; // now we can stop checking every frame...
|
||||
// Now check whether this context supports hardware stereo
|
||||
GLboolean supportsStereo, supportsBuffered;
|
||||
glGetBooleanv(GL_STEREO, &supportsStereo);
|
||||
glGetBooleanv(GL_DOUBLEBUFFER, &supportsBuffered);
|
||||
bQuadStereoSupported = supportsStereo && supportsBuffered;
|
||||
leftEye.bQuadStereoSupported = bQuadStereoSupported;
|
||||
rightEye.bQuadStereoSupported = bQuadStereoSupported;
|
||||
|
|
|
@ -3575,17 +3575,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetBlend)
|
|||
PARAM_FLOAT (alpha);
|
||||
PARAM_INT (tics);
|
||||
PARAM_COLOR_DEF (color2);
|
||||
PARAM_FLOAT_DEF (alpha2);
|
||||
|
||||
if (color == MAKEARGB(255,255,255,255))
|
||||
color = 0;
|
||||
if (color2 == MAKEARGB(255,255,255,255))
|
||||
color2 = 0;
|
||||
if (color2.a == 0)
|
||||
color2 = color;
|
||||
// if (color2.a == 0)
|
||||
// color2 = color;
|
||||
|
||||
Create<DFlashFader>(color.r/255.f, color.g/255.f, color.b/255.f, float(alpha),
|
||||
color2.r/255.f, color2.g/255.f, color2.b/255.f, 0.f,
|
||||
float(tics)/TICRATE, self);
|
||||
color2.r/255.f, color2.g/255.f, color2.b/255.f, float(alpha2),
|
||||
float(tics)/TICRATE, self, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -5648,7 +5648,8 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
{ // Give all cards in death match mode.
|
||||
p->mo->GiveDeathmatchInventory ();
|
||||
}
|
||||
else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn) && state == PST_REBORN && oldactor != NULL)
|
||||
else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn ||
|
||||
!!G_SkillProperty(SKILLP_PlayerRespawn)) && state == PST_REBORN && oldactor != NULL)
|
||||
{ // Special inventory handling for respawning in coop
|
||||
p->mo->FilterCoopRespawnInventory (oldactor);
|
||||
}
|
||||
|
|
|
@ -2725,7 +2725,7 @@ GLPREFMNU_AMBLIGHT = "Ambient light level";
|
|||
GLPREFMNU_RENDERQUALITY = "Rendering quality";
|
||||
GLPREFMNU_MENUBLUR = "Menu Blur";
|
||||
GLPREFMNU_VRMODE = "Stereo 3D VR";
|
||||
GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo";
|
||||
GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo (Requires Restart)";
|
||||
GLPREFMNU_MULTISAMPLE = "Multisample";
|
||||
GLPREFMNU_TONEMAP = "Tonemap Mode";
|
||||
GLPREFMNU_BLOOM = "Bloom effect";
|
||||
|
|
|
@ -1030,7 +1030,7 @@ class Actor : Thinker native
|
|||
native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, double size = 1, double angle = 0, double xoff = 0, double yoff = 0, double zoff = 0, double velx = 0, double vely = 0, double velz = 0, double accelx = 0, double accely = 0, double accelz = 0, double startalphaf = 1, double fadestepf = -1, double sizestep = 0);
|
||||
native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);
|
||||
native void A_DropInventory(class<Inventory> itemtype, int amount = -1);
|
||||
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0);
|
||||
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0, double alpha2 = 0.);
|
||||
deprecated("2.3") native void A_ChangeFlag(string flagname, bool value);
|
||||
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
|
||||
native void A_RaiseMaster(int flags = 0);
|
||||
|
|
|
@ -547,6 +547,7 @@ struct LevelLocals native
|
|||
native static void WorldDone();
|
||||
native static void RemoveAllBots(bool fromlist);
|
||||
native void SetInterMusic(String nextmap);
|
||||
native double GetPixelStretch();
|
||||
native String FormatMapName(int mapnamecolor);
|
||||
native bool IsJumpingAllowed() const;
|
||||
native bool IsCrouchingAllowed() const;
|
||||
|
|
|
@ -962,6 +962,7 @@ enum ESkillProperty
|
|||
SKILLP_EasyKey,
|
||||
SKILLP_SlowMonsters,
|
||||
SKILLP_Infight,
|
||||
SKILLP_PlayerRespawn,
|
||||
};
|
||||
enum EFSkillProperty // floating point properties
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue