Merge branch 'master' into GLEW_VERSION

This commit is contained in:
Christoph Oelckers 2014-04-18 12:16:12 +02:00
commit c7354c571f
19 changed files with 117 additions and 60 deletions

View file

@ -1008,6 +1008,7 @@ public:
bool SetState (FState *newstate, bool nofunction=false); bool SetState (FState *newstate, bool nofunction=false);
virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true); virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true);
bool isFast(); bool isFast();
bool isSlow();
void SetIdle(); void SetIdle();
void ClearCounters(); void ClearCounters();

View file

@ -441,12 +441,25 @@ CCMD (exec)
} }
} }
CCMD (logfile) void execLogfile(const char *fn)
{
if ((Logfile = fopen(fn, "w")))
{ {
const char *timestr = myasctime(); const char *timestr = myasctime();
Printf("Log started: %s\n", timestr);
}
else
{
Printf("Could not start log\n");
}
}
CCMD (logfile)
{
if (Logfile) if (Logfile)
{ {
const char *timestr = myasctime();
Printf("Log stopped: %s\n", timestr); Printf("Log stopped: %s\n", timestr);
fclose (Logfile); fclose (Logfile);
Logfile = NULL; Logfile = NULL;
@ -454,14 +467,7 @@ CCMD (logfile)
if (argv.argc() >= 2) if (argv.argc() >= 2)
{ {
if ( (Logfile = fopen (argv[1], "w")) ) execLogfile(argv[1]);
{
Printf ("Log started: %s\n", timestr);
}
else
{
Printf ("Could not start log\n");
}
} }
} }

View file

@ -168,4 +168,6 @@ extern unsigned int MakeKey (const char *s);
extern unsigned int MakeKey (const char *s, size_t len); extern unsigned int MakeKey (const char *s, size_t len);
extern unsigned int SuperFastHash (const char *data, size_t len); extern unsigned int SuperFastHash (const char *data, size_t len);
void execLogfile(const char *fn);
#endif //__C_DISPATCH_H__ #endif //__C_DISPATCH_H__

View file

@ -2223,6 +2223,13 @@ void D_DoomMain (void)
FString *args; FString *args;
int argcount; int argcount;
// +logfile gets checked too late to catch the full startup log in the logfile so do some extra check for it here.
FString logfile = Args->TakeValue("+logfile");
if (logfile != NULL)
{
execLogfile(logfile);
}
D_DoomInit(); D_DoomInit();
PClass::StaticInit (); PClass::StaticInit ();
atterm(FinalGC); atterm(FinalGC);

View file

@ -554,6 +554,7 @@ enum ESkillProperty
SKILLP_NoPain, SKILLP_NoPain,
SKILLP_ArmorFactor, SKILLP_ArmorFactor,
SKILLP_EasyKey, SKILLP_EasyKey,
SKILLP_SlowMonsters,
}; };
int G_SkillProperty(ESkillProperty prop); int G_SkillProperty(ESkillProperty prop);
const char * G_SkillName(); const char * G_SkillName();
@ -568,6 +569,7 @@ struct FSkillInfo
fixed_t AmmoFactor, DoubleAmmoFactor, DropAmmoFactor; fixed_t AmmoFactor, DoubleAmmoFactor, DropAmmoFactor;
fixed_t DamageFactor; fixed_t DamageFactor;
bool FastMonsters; bool FastMonsters;
bool SlowMonsters;
bool DisableCheats; bool DisableCheats;
bool AutoUseHealth; bool AutoUseHealth;

View file

@ -64,6 +64,7 @@ void FMapInfoParser::ParseSkill ()
skill.DropAmmoFactor = -1; skill.DropAmmoFactor = -1;
skill.DamageFactor = FRACUNIT; skill.DamageFactor = FRACUNIT;
skill.FastMonsters = false; skill.FastMonsters = false;
skill.SlowMonsters = false;
skill.DisableCheats = false; skill.DisableCheats = false;
skill.EasyBossBrain = false; skill.EasyBossBrain = false;
skill.EasyKey = false; skill.EasyKey = false;
@ -118,6 +119,10 @@ void FMapInfoParser::ParseSkill ()
{ {
skill.FastMonsters = true; skill.FastMonsters = true;
} }
else if (sc.Compare ("slowmonsters"))
{
skill.SlowMonsters = true;
}
else if (sc.Compare ("disablecheats")) else if (sc.Compare ("disablecheats"))
{ {
skill.DisableCheats = true; skill.DisableCheats = true;
@ -336,6 +341,9 @@ int G_SkillProperty(ESkillProperty prop)
case SKILLP_FastMonsters: case SKILLP_FastMonsters:
return AllSkills[gameskill].FastMonsters || (dmflags & DF_FAST_MONSTERS); return AllSkills[gameskill].FastMonsters || (dmflags & DF_FAST_MONSTERS);
case SKILLP_SlowMonsters:
return AllSkills[gameskill].SlowMonsters;
case SKILLP_Respawn: case SKILLP_Respawn:
if (dmflags & DF_MONSTERS_RESPAWN && AllSkills[gameskill].RespawnCounter==0) if (dmflags & DF_MONSTERS_RESPAWN && AllSkills[gameskill].RespawnCounter==0)
return TICRATE * gameinfo.defaultrespawntime; return TICRATE * gameinfo.defaultrespawntime;
@ -433,6 +441,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
DropAmmoFactor = other.DropAmmoFactor; DropAmmoFactor = other.DropAmmoFactor;
DamageFactor = other.DamageFactor; DamageFactor = other.DamageFactor;
FastMonsters = other.FastMonsters; FastMonsters = other.FastMonsters;
SlowMonsters = other.SlowMonsters;
DisableCheats = other.DisableCheats; DisableCheats = other.DisableCheats;
AutoUseHealth = other.AutoUseHealth; AutoUseHealth = other.AutoUseHealth;
EasyBossBrain = other.EasyBossBrain; EasyBossBrain = other.EasyBossBrain;

View file

@ -77,6 +77,7 @@ struct FState
BYTE Fast:1; BYTE Fast:1;
BYTE NoDelay:1; // Spawn states executes its action normally BYTE NoDelay:1; // Spawn states executes its action normally
BYTE CanRaise:1; // Allows a monster to be resurrected without waiting for an infinate frame BYTE CanRaise:1; // Allows a monster to be resurrected without waiting for an infinate frame
BYTE Slow:1; // Inverse of fast
int ParameterIndex; int ParameterIndex;
inline int GetFrame() const inline int GetFrame() const

View file

@ -1542,7 +1542,6 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params)
bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params) bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
{ {
int c; int c;
int stop;
int pnum; int pnum;
player_t* player; player_t* player;
bool chasegoal = params? (!(params->flags & LOF_DONTCHASEGOAL)) : true; bool chasegoal = params? (!(params->flags & LOF_DONTCHASEGOAL)) : true;
@ -1615,9 +1614,11 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
{ {
pnum = actor->LastLookPlayerNumber; pnum = actor->LastLookPlayerNumber;
} }
stop = (pnum - 1) & (MAXPLAYERS-1);
for (;;) for (;;)
{
// [ED850] Each and every player should only ever be checked once.
if (c++ < MAXPLAYERS)
{ {
pnum = (pnum + 1) & (MAXPLAYERS - 1); pnum = (pnum + 1) & (MAXPLAYERS - 1);
if (!playeringame[pnum]) if (!playeringame[pnum])
@ -1627,8 +1628,8 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
{ {
actor->LastLookPlayerNumber = pnum; actor->LastLookPlayerNumber = pnum;
} }
}
if (++c == MAXPLAYERS-1 || pnum == stop) else
{ {
// done looking // done looking
if (actor->target == NULL) if (actor->target == NULL)
@ -1692,11 +1693,11 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
&& P_AproxDistance (player->mo->velx, player->mo->vely) && P_AproxDistance (player->mo->velx, player->mo->vely)
< 5*FRACUNIT) < 5*FRACUNIT)
{ // Player is sneaking - can't detect { // Player is sneaking - can't detect
return false; continue;
} }
if (pr_lookforplayers() < 225) if (pr_lookforplayers() < 225)
{ // Player isn't sneaking, but still didn't detect { // Player isn't sneaking, but still didn't detect
return false; continue;
} }
} }
} }

View file

@ -405,7 +405,7 @@ bool AActor::InStateSequence(FState * newstate, FState * basestate)
// //
// Get the actual duration of the next state // Get the actual duration of the next state
// We are using a state flag now to indicate a state that should be // We are using a state flag now to indicate a state that should be
// accelerated in Fast mode. // accelerated in Fast mode or slowed in Slow mode.
// //
//========================================================================== //==========================================================================
@ -416,6 +416,10 @@ int AActor::GetTics(FState * newstate)
{ {
return tics - (tics>>1); return tics - (tics>>1);
} }
else if (isSlow() && newstate->Slow)
{
return tics<<1;
}
return tics; return tics;
} }
@ -4082,6 +4086,11 @@ bool AActor::isFast()
return !!G_SkillProperty(SKILLP_FastMonsters); return !!G_SkillProperty(SKILLP_FastMonsters);
} }
bool AActor::isSlow()
{
return !!G_SkillProperty(SKILLP_SlowMonsters);
}
void AActor::Activate (AActor *activator) void AActor::Activate (AActor *activator)
{ {
if ((flags3 & MF3_ISMONSTER) && (health > 0 || (flags & MF_ICECORPSE))) if ((flags3 & MF3_ISMONSTER) && (health > 0 || (flags & MF_ICECORPSE)))
@ -4795,10 +4804,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
// Set various UDMF options // Set various UDMF options
if (mthing->alpha != -1) if (mthing->alpha != -1)
{
DPrintf("Setting alpha to %f", FIXED2FLOAT(mthing->alpha));
mobj->alpha = mthing->alpha; mobj->alpha = mthing->alpha;
}
if (mthing->RenderStyle != STYLE_Count) if (mthing->RenderStyle != STYLE_Count)
mobj->RenderStyle = (ERenderStyle)mthing->RenderStyle; mobj->RenderStyle = (ERenderStyle)mthing->RenderStyle;
if (mthing->scaleX) if (mthing->scaleX)

View file

@ -1764,6 +1764,9 @@ void P_LoadThings (MapData * map)
mti[i].Conversation = 0; mti[i].Conversation = 0;
mti[i].SkillFilter = MakeSkill(flags); mti[i].SkillFilter = MakeSkill(flags);
mti[i].ClassFilter = 0xffff; // Doom map format doesn't have class flags so spawn for all player classes mti[i].ClassFilter = 0xffff; // Doom map format doesn't have class flags so spawn for all player classes
mti[i].RenderStyle = STYLE_Count;
mti[i].alpha = -1;
mti[i].health = 1;
flags &= ~MTF_SKILLMASK; flags &= ~MTF_SKILLMASK;
mti[i].flags = (short)((flags & 0xf) | 0x7e0); mti[i].flags = (short)((flags & 0xf) | 0x7e0);
if (gameinfo.gametype == GAME_Strife) if (gameinfo.gametype == GAME_Strife)
@ -1837,6 +1840,10 @@ void P_LoadThings2 (MapData * map)
mti[i].flags &= ~(MTF_SKILLMASK|MTF_CLASS_MASK); mti[i].flags &= ~(MTF_SKILLMASK|MTF_CLASS_MASK);
mti[i].Conversation = 0; mti[i].Conversation = 0;
mti[i].gravity = FRACUNIT; mti[i].gravity = FRACUNIT;
mti[i].RenderStyle = STYLE_Count;
mti[i].alpha = -1;
mti[i].health = 1;
mti[i].fillcolor = mti[i].scaleX = mti[i].scaleY = mti[i].score = 0;
} }
delete[] mtp; delete[] mtp;
} }

View file

@ -275,6 +275,11 @@ do_stop:
state.Fast = true; state.Fast = true;
continue; continue;
} }
if (sc.Compare("SLOW"))
{
state.Slow = true;
continue;
}
if (sc.Compare("NODELAY")) if (sc.Compare("NODELAY"))
{ {
if (bag.statedef.GetStateLabelIndex(NAME_Spawn) == bag.statedef.GetStateCount()) if (bag.statedef.GetStateLabelIndex(NAME_Spawn) == bag.statedef.GetStateCount())

View file

@ -581,6 +581,18 @@ void I_DetectOS(void)
osname = "Server 2008 R2"; osname = "Server 2008 R2";
} }
} }
else if (info.dwMinorVersion == 2)
{
// Microsoft broke this API for 8.1 so without jumping through hoops it won't be possible anymore to detect never versions aside from the build number, especially for older compilers.
if (info.wProductType == VER_NT_WORKSTATION)
{
osname = "8 (or higher)";
}
else
{
osname = "Server 2012 (or higher)";
}
}
} }
break; break;

View file

@ -39,16 +39,16 @@ ACTOR Acolyte : StrifeHumanoid
AGRD ABCDABCD 5 A_Wander AGRD ABCDABCD 5 A_Wander
Loop Loop
See: See:
AGRD A 6 A_AcolyteBits AGRD A 6 Fast Slow A_AcolyteBits
AGRD BCD 6 A_Chase AGRD BCD 6 Fast Slow A_Chase
Loop Loop
Missile: Missile:
AGRD E 8 A_FaceTarget AGRD E 8 Fast Slow A_FaceTarget
AGRD FE 4 A_ShootGun AGRD FE 4 Fast Slow A_ShootGun
AGRD F 6 A_ShootGun AGRD F 6 Fast Slow A_ShootGun
Goto See Goto See
Pain: Pain:
AGRD O 8 A_Pain AGRD O 8 Fast Slow A_Pain
Goto See Goto See
Death: Death:
AGRD G 4 AGRD G 4
@ -170,8 +170,8 @@ ACTOR AcolyteShadow : Acolyte 58
AGRD A 6 A_BeShadowyFoe AGRD A 6 A_BeShadowyFoe
Goto Super::See+1 Goto Super::See+1
Pain: Pain:
AGRD O 0 A_SetShadow AGRD O 0 Fast Slow A_SetShadow
AGRD O 8 A_Pain AGRD O 8 Fast Slow A_Pain
Goto See Goto See
} }
} }

View file

@ -42,19 +42,16 @@ ACTOR Crusader 3005
ROB2 AABBCCDD 3 A_Chase ROB2 AABBCCDD 3 A_Chase
Loop Loop
Missile: Missile:
ROB2 E 3 A_FaceTarget ROB2 E 3 Slow A_FaceTarget
ROB2 F 2 Bright A_CrusaderChoose ROB2 F 2 Slow Bright A_CrusaderChoose
ROB2 E 2 Bright A_CrusaderSweepLeft ROB2 E 2 Slow Bright A_CrusaderSweepLeft
ROB2 F 3 Bright A_CrusaderSweepLeft ROB2 F 3 Slow Bright A_CrusaderSweepLeft
ROB2 E 2 Bright A_CrusaderSweepLeft ROB2 EF 2 Slow Bright A_CrusaderSweepLeft
ROB2 F 2 Bright A_CrusaderSweepLeft ROB2 EFE 2 Slow Bright A_CrusaderSweepRight
ROB2 E 2 Bright A_CrusaderSweepRight ROB2 F 2 Slow A_CrusaderRefire
ROB2 F 2 Bright A_CrusaderSweepRight
ROB2 E 2 Bright A_CrusaderSweepRight
ROB2 F 2 A_CrusaderRefire
Loop Loop
Pain: Pain:
ROB2 D 1 A_Pain ROB2 D 1 Slow A_Pain
Goto See Goto See
Death: Death:
ROB2 G 3 A_Scream ROB2 G 3 A_Scream

View file

@ -32,16 +32,16 @@ ACTOR Reaver 3001
ROB1 BBCCDDEE 3 A_Chase ROB1 BBCCDDEE 3 A_Chase
Loop Loop
Melee: Melee:
ROB1 H 6 A_FaceTarget ROB1 H 6 Slow A_FaceTarget
ROB1 I 8 A_CustomMeleeAttack(random[ReaverMelee](1,8)*3, "reaver/blade") ROB1 I 8 Slow A_CustomMeleeAttack(random[ReaverMelee](1,8)*3, "reaver/blade")
ROB1 H 6 ROB1 H 6 Slow
Goto See Goto See
Missile: Missile:
ROB1 F 8 A_FaceTarget ROB1 F 8 Slow A_FaceTarget
ROB1 G 11 BRIGHT A_ReaverRanged ROB1 G 11 Slow BRIGHT A_ReaverRanged
Goto See Goto See
Pain: Pain:
ROB1 A 2 ROB1 A 2 Slow
ROB1 A 2 A_Pain ROB1 A 2 A_Pain
Goto See Goto See
Death: Death:

View file

@ -45,14 +45,14 @@ ACTOR Stalker 186
STLK J 10 A_Look STLK J 10 A_Look
Loop Loop
See: See:
STLK A 1 A_StalkerChaseDecide STLK A 1 Slow A_StalkerChaseDecide
STLK ABB 3 A_Chase STLK ABB 3 Slow A_Chase
STLK C 3 A_StalkerWalk STLK C 3 Slow A_StalkerWalk
STLK C 3 A_Chase STLK C 3 Slow A_Chase
Loop Loop
Melee: Melee:
STLK J 3 A_FaceTarget STLK J 3 Slow A_FaceTarget
STLK K 3 A_StalkerAttack STLK K 3 Slow A_StalkerAttack
SeeFloor: SeeFloor:
STLK J 3 A_StalkerWalk STLK J 3 A_StalkerWalk
STLK KK 3 A_Chase STLK KK 3 A_Chase

View file

@ -1786,8 +1786,8 @@ ACTOR CeilingTurret 27
Loop Loop
Missile: Missile:
Pain: Pain:
TURT B 4 A_ShootGun TURT B 4 Slow A_ShootGun
TURT D 3 A_SentinelRefire TURT D 3 Slow A_SentinelRefire
TURT A 4 A_SentinelRefire TURT A 4 A_SentinelRefire
Loop Loop
Death: Death:

View file

@ -238,6 +238,7 @@ skill baby
AmmoFactor = 2 AmmoFactor = 2
DamageFactor = 0.5 DamageFactor = 0.5
EasyBossBrain EasyBossBrain
SlowMonsters
SpawnFilter = Baby SpawnFilter = Baby
PicName = "M_JKILL" PicName = "M_JKILL"
Name = "$SSKILL_BABY" Name = "$SSKILL_BABY"

View file

@ -240,5 +240,5 @@ enum
// //
ML_PASSTHROUGH = -1, ML_PASSTHROUGH = -1,
ML_TRANSLUCENT = -2, ML_TRANSLUCENT = -2,
ML_TRANSPARENT = -3, ML_TRANSPARENT = -3
} }