Conflicts:
	wadsrc/static/compatibility.txt
This commit is contained in:
Christoph Oelckers 2014-11-16 09:02:17 +01:00
commit c25325efa4
14 changed files with 98 additions and 57 deletions

View file

@ -1,6 +1,7 @@
cmake_minimum_required( VERSION 2.4 )
add_library( output_sdl MODULE output_sdl.c )
include_directories( ${FMOD_INCLUDE_DIR} ${SDL_INCLUDE_DIR} )
target_link_libraries( output_sdl SDL )
FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${ZDOOM_OUTPUT_DIR}/liboutput_sdl.so ]; then ln -sf output_sdl/liboutput_sdl.so ${ZDOOM_OUTPUT_DIR}/liboutput_sdl.so; fi" )
add_custom_command( TARGET output_sdl POST_BUILD

View file

@ -346,6 +346,7 @@ enum
MF7_FOILBUDDHA = 0x00000080, // Similar to FOILINVUL, foils buddha mode.
MF7_DONTTHRUST = 0x00000100, // Thrusting functions do not take, and do not give thrust (damage) to actors with this flag.
MF7_ALLOWPAIN = 0x00000200, // Invulnerable or immune (via damagefactors) actors can still react to taking damage even if they don't.
MF7_CAUSEPAIN = 0x00000400, // Damage sources with this flag can cause similar effects like ALLOWPAIN.
// --- mobj.renderflags ---

View file

@ -82,6 +82,7 @@ enum
CP_SETWALLYSCALE,
CP_SETTHINGZ,
CP_SETTAG,
CP_SETTHINGFLAGS,
};
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
@ -318,6 +319,15 @@ void ParseCompatibility()
sc.MustGetNumber();
CompatParams.Push(sc.Number);
}
else if (sc.Compare("setthingflags"))
{
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
CompatParams.Push(CP_SETTHINGFLAGS);
sc.MustGetNumber();
CompatParams.Push(sc.Number);
sc.MustGetNumber();
CompatParams.Push(sc.Number);
}
else
{
sc.UnGet();
@ -540,6 +550,15 @@ void SetCompatibilityParams()
i += 3;
break;
}
case CP_SETTHINGFLAGS:
{
if ((unsigned)CompatParams[i + 1] < MapThingsConverted.Size())
{
MapThingsConverted[CompatParams[i + 1]].flags = CompatParams[i + 2];
}
i += 3;
break;
}
}
}
}

View file

@ -833,15 +833,23 @@ void D_Display ()
}
}
// draw pause pic
if (paused && menuactive == MENU_Off)
if ((paused || pauseext) && menuactive == MENU_Off)
{
FTexture *tex;
int x;
FString pstring = "By ";
tex = TexMan(gameinfo.PauseSign);
x = (SCREENWIDTH - tex->GetScaledWidth() * CleanXfac)/2 +
tex->GetScaledLeftOffset() * CleanXfac;
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
if (paused && multiplayer)
{
pstring += players[paused - 1].userinfo.GetName();
screen->DrawText(SmallFont, CR_RED,
(screen->GetWidth() - SmallFont->StringWidth(pstring)*CleanXfac) / 2,
(tex->GetScaledHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
}
}
// [RH] Draw icon, if any

View file

@ -939,7 +939,7 @@ void NetUpdate (void)
newtics = nowtime - gametime;
gametime = nowtime;
if (newtics <= 0) // nothing new to update
if (newtics <= 0 || pauseext) // nothing new to update or window paused
{
GetPackets ();
return;

View file

@ -109,6 +109,7 @@ enum EMenuState
extern bool automapactive; // In AutoMap mode?
extern EMenuState menuactive; // Menu overlayed?
extern int paused; // Game Pause?
extern bool pauseext;
extern bool viewactive;

View file

@ -141,6 +141,7 @@ gameaction_t gameaction;
gamestate_t gamestate = GS_STARTUP;
int paused;
bool pauseext;
bool sendpause; // send a pause event next tic
bool sendsave; // send a save event next tic
bool sendturn180; // [RH] send a 180 degree turn next tic
@ -1152,13 +1153,13 @@ void G_Ticker ()
// If the user alt-tabbed away, paused gets set to -1. In this case,
// we do not want to read more demo commands until paused is no
// longer negative.
if (demoplayback && paused >= 0)
if (demoplayback)
{
G_ReadDemoTiccmd (cmd, i);
}
else
{
memcpy (cmd, newcmd, sizeof(ticcmd_t));
memcpy(cmd, newcmd, sizeof(ticcmd_t));
}
// check for turbo cheats

View file

@ -970,13 +970,13 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
}
return -1;
}
if ((target->flags2 & MF2_INVULNERABLE) && damage < TELEFRAG_DAMAGE && !(flags & DMG_FORCED))
if ((target->flags2 & MF2_INVULNERABLE) && (damage < TELEFRAG_DAMAGE) && (!(flags & DMG_FORCED)))
{ // actor is invulnerable
if (target->player == NULL)
{
if (inflictor == NULL || (!(inflictor->flags3 & MF3_FOILINVUL) && !(flags & DMG_FOILINVUL)))
{
if (target->flags7 & MF7_ALLOWPAIN)
if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
{
invulpain = true; //This returns -1 later.
fakeDamage = damage;
@ -991,7 +991,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
// Players are optionally excluded from getting thrust by damage.
if (static_cast<APlayerPawn *>(target)->PlayerFlags & PPF_NOTHRUSTWHENINVUL)
{
if (target->flags7 & MF7_ALLOWPAIN)
if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
plrDontThrust = 1;
else
return -1;
@ -999,7 +999,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
}
}
if ((target->flags7 & MF7_ALLOWPAIN) && (damage < TELEFRAG_DAMAGE))
if (((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN))) && (damage < TELEFRAG_DAMAGE))
{
//Intentionally do not jump to fakepain because the damage hasn't been dished out yet.
//Once it's dished out, THEN we can disregard damage factors affecting pain chances.
@ -1059,7 +1059,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (damage == -1)
{
if (target->flags7 & MF7_ALLOWPAIN) //Hold off ending the function before we can deal the pain chances.
if ((target->flags7 & MF7_ALLOWPAIN) || (inflictor->flags7 & MF7_CAUSEPAIN)) //Hold off ending the function before we can deal the pain chances.
goto fakepain;
return -1;
}
@ -1089,7 +1089,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{
goto dopain;
}
else if (target->flags7 & MF7_ALLOWPAIN)
else if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
goto fakepain;
return -1;
@ -1099,7 +1099,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (!(flags & DMG_NO_FACTOR))
{
damage = FixedMul(damage, target->DamageFactor);
if (damage >= 0)
if (damage > 0)
{
damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->ActorInfo->DamageFactors);
}
@ -1109,7 +1109,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{
goto dopain;
}
else if (target->flags7 & MF7_ALLOWPAIN)
else if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
goto fakepain;
return -1;
@ -1120,7 +1120,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
}
if (damage == -1)
{
if (target->flags7 & MF7_ALLOWPAIN)
if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
goto fakepain;
return -1;
@ -1243,12 +1243,16 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{
// check the real player, not a voodoo doll here for invulnerability effects
if ((damage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE))) ||
(player->cheats & CF_GODMODE2) || (player->mo->flags5 & MF5_NODAMAGE))
(player->cheats & CF_GODMODE))) ||
(player->cheats & CF_GODMODE2) || (player->mo->flags5 & MF5_NODAMAGE))
//Absolutely no hurting if NODAMAGE is involved. Same for GODMODE2.
{ // player is invulnerable, so don't hurt him
if (player->mo->flags7 & MF7_ALLOWPAIN)
{
if (((!(player->cheats & CF_GODMODE)) && (!(player->cheats & CF_GODMODE2)) && (!(player->mo->flags5 & MF5_NOPAIN))) &&
(((player->mo->flags7 & MF7_ALLOWPAIN) || (player->mo->flags5 & MF5_NODAMAGE)) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN))))
//Make sure no godmodes and NOPAIN flags are found first.
//Then, check to see if the player has NODAMAGE or ALLOWPAIN, or inflictor has CAUSEPAIN.
{
invulpain = true;
fakeDamage = damage;
goto fakepain;
@ -1270,8 +1274,8 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{
// If MF6_FORCEPAIN is set, make the player enter the pain state.
if (!(target->flags5 & MF5_NOPAIN) && inflictor != NULL &&
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS) &&
(!(player->mo->flags2 & MF2_INVULNERABLE)))
(inflictor->flags6 & MF6_FORCEPAIN) && !(inflictor->flags5 & MF5_PAINLESS)
&& (!(player->mo->flags2 & MF2_INVULNERABLE)) && (!(player->cheats & CF_GODMODE)) && (!(player->cheats & CF_GODMODE2)))
{
goto dopain;
}
@ -1302,7 +1306,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
// telefrag him right? ;) (Unfortunately the damage is "absorbed" by armor,
// but telefragging should still do enough damage to kill the player)
// Ignore players that are already dead.
if (((player->cheats & CF_BUDDHA2) || ((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA) && damage < TELEFRAG_DAMAGE)) && player->playerstate != PST_DEAD)
if ((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && (damage < TELEFRAG_DAMAGE)) && (player->playerstate != PST_DEAD))
{
// If this is a voodoo doll we need to handle the real player as well.
player->mo->health = target->health = player->health = 1;
@ -1335,7 +1339,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
damage = newdam;
if (damage <= 0)
{
if (target->flags7 & MF7_ALLOWPAIN)
if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
goto fakepain;
else
return damage;
@ -1366,7 +1370,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (target->health <= 0)
{
if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && (!(inflictor->flags3 & MF7_FOILBUDDHA) && !(flags & DMG_FOILBUDDHA)))
if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && ((inflictor == NULL || !(inflictor->flags3 & MF7_FOILBUDDHA)) && !(flags & DMG_FOILBUDDHA)))
{ //FOILBUDDHA or Telefrag damage must kill it.
target->health = 1;
}
@ -1426,10 +1430,14 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
}
fakepain: //Needed so we can skip the rest of the above, but still obey the original rules.
if (target->flags7 & MF7_ALLOWPAIN && (fakeDamage != damage))
//CAUSEPAIN can always attempt to trigger the chances of pain.
//ALLOWPAIN can do the same, only if the (unfiltered aka fake) damage is greater than 0.
if ((((target->flags7 & MF7_ALLOWPAIN) && (fakeDamage > 0))
|| ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN))) && (fakeDamage != damage))
{
holdDamage = damage;
damage = fakeDamage;
holdDamage = damage; //Store the modified damage away after factors are taken into account.
damage = fakeDamage; //Retrieve the original damage.
}
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
@ -1446,8 +1454,8 @@ fakepain: //Needed so we can skip the rest of the above, but still obey the orig
}
}
if ((damage >= target->PainThreshold && pr_damagemobj() < painchance) ||
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)))
if ((((damage >= target->PainThreshold)) && (pr_damagemobj() < painchance))
|| (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)))
{
dopain:
if (mod == NAME_Electric)
@ -1484,6 +1492,7 @@ dopain:
}
}
}
//ALLOWPAIN and CAUSEPAIN can still trigger infighting, even if no pain state is worked out.
target->reactiontime = 0; // we're awake now...
if (source)
{
@ -1526,9 +1535,9 @@ dopain:
{
return -1; //NOW we return -1!
}
else if (target->flags7 & MF7_ALLOWPAIN)
else if ((target->flags7 & MF7_ALLOWPAIN) || ((inflictor != NULL) && (inflictor->flags7 & MF7_CAUSEPAIN)))
{
return holdDamage;
return holdDamage; //This is the calculated damage after all is said and done.
}
return damage;
}

View file

@ -736,11 +736,9 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
else
{ // Find the point on the line closest to the actor's center, and use
// that to calculate openings
float dx = (float)ld->dx;
float dy = (float)ld->dy;
fixed_t r = (fixed_t)(((float)(tm.x - ld->v1->x) * dx +
(float)(tm.y - ld->v1->y) * dy) /
(dx*dx + dy*dy) * 16777216.f);
SQWORD r_den = (SQWORD(ld->dx)*ld->dx + SQWORD(ld->dy)*ld->dy) / (1 << 24);
SQWORD r_num = ((SQWORD(tm.x - ld->v1->x)*ld->dx) + (SQWORD(tm.y - ld->v1->y)*ld->dy));
fixed_t r = (fixed_t)(r_num / r_den);
/* Printf ("%d:%d: %d (%d %d %d %d) (%d %d %d %d)\n", level.time, ld-lines, r,
ld->frontsector->floorplane.a,
ld->frontsector->floorplane.b,
@ -3695,7 +3693,7 @@ AActor *P_LineAttack(AActor *t1, angle_t angle, fixed_t distance,
// [GZ] If MF6_FORCEPAIN is set, we need to call P_DamageMobj even if damage is 0!
// Note: The puff may not yet be spawned here so we must check the class defaults, not the actor.
int newdam = damage;
if (damage || (puffDefaults != NULL && puffDefaults->flags6 & MF6_FORCEPAIN))
if (damage || (puffDefaults != NULL && ((puffDefaults->flags6 & MF6_FORCEPAIN) || (puffDefaults->flags7 & MF7_CAUSEPAIN))))
{
int dmgflags = DMG_INFLICTOR_IS_PUFF | pflag;
// Allow MF5_PIERCEARMOR on a weapon as well.

View file

@ -1783,21 +1783,13 @@ void S_SetSoundPaused (int state)
{
if (state)
{
if (paused <= 0)
if (paused == 0)
{
S_ResumeSound(true);
if (GSnd != NULL)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
}
if (!netgame
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
paused = 0;
}
}
}
else
@ -1811,16 +1803,16 @@ void S_SetSoundPaused (int state)
SoundRenderer::INACTIVE_Complete :
SoundRenderer::INACTIVE_Mute);
}
if (!netgame
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
paused = -1;
}
}
}
if (!netgame
#ifdef _DEBUG
&& !demoplayback
#endif
)
{
pauseext = !state;
}
}
//==========================================================================

View file

@ -1384,6 +1384,7 @@ enum
CPF_DAGGER = 2,
CPF_PULLIN = 4,
CPF_NORANDOMPUFFZ = 8,
CPF_NOTURN = 16,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
@ -1424,7 +1425,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
// turn to face target
if (linetarget)
{
if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN))
@ -1435,10 +1435,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
}
self->angle = R_PointToAngle2 (self->x,
self->y,
linetarget->x,
linetarget->y);
if (!(flags & CPF_NOTURN))
{
// turn to face target
self->angle = R_PointToAngle2 (self->x,
self->y,
linetarget->x,
linetarget->y);
}
if (flags & CPF_PULLIN) self->flags |= MF_JUSTATTACKED;
if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget);

View file

@ -246,6 +246,7 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF7, FOILBUDDHA, AActor, flags7),
DEFINE_FLAG(MF7, DONTTHRUST, AActor, flags7),
DEFINE_FLAG(MF7, ALLOWPAIN, AActor, flags7),
DEFINE_FLAG(MF7, CAUSEPAIN, AActor, flags7),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),

View file

@ -175,6 +175,7 @@ const int CPF_USEAMMO = 1;
const int CPF_DAGGER = 2;
const int CPF_PULLIN = 4;
const int CPF_NORANDOMPUFFZ = 8;
const int CPF_NOTURN = 16;
// Flags for A_CustomMissile
const int FPF_AIMATANGLE = 1;

View file

@ -390,6 +390,11 @@ B9DFF13207EACAC675C71D82624D0007 // XtheaterIII map01
DisablePushWindowCheck
}
A53AE580A4AF2B5D0B0893F86914781E // TNT: Evilution map31
{
setthingflags 470 2016
}
712BB4CFBD0753178CA0C6814BE4C288 // map12 BTSX_E1 - patch some rendering glitches that are problematic to detect
{
setsectortag 545 32000