mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
c88bf3108c
6 changed files with 126 additions and 101 deletions
|
@ -331,6 +331,8 @@ enum
|
||||||
MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles.
|
MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles.
|
||||||
MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove
|
MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove
|
||||||
MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim.
|
MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim.
|
||||||
|
MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup.
|
||||||
|
MF6_RELATIVETOFLOOR = 0x80000000, // [RC] Make flying actors be affected by lifts.
|
||||||
|
|
||||||
// --- mobj.renderflags ---
|
// --- mobj.renderflags ---
|
||||||
|
|
||||||
|
|
176
src/am_map.cpp
176
src/am_map.cpp
|
@ -2616,114 +2616,116 @@ void AM_drawThings ()
|
||||||
t = sectors[i].thinglist;
|
t = sectors[i].thinglist;
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
p.x = t->x >> FRACTOMAPBITS;
|
if (am_cheat > 0 || !(t->flags6 & MF6_NOTONAUTOMAP))
|
||||||
p.y = t->y >> FRACTOMAPBITS;
|
|
||||||
|
|
||||||
if (am_showthingsprites > 0 && t->sprite > 0)
|
|
||||||
{
|
{
|
||||||
FTexture *texture = NULL;
|
p.x = t->x >> FRACTOMAPBITS;
|
||||||
spriteframe_t *frame;
|
p.y = t->y >> FRACTOMAPBITS;
|
||||||
angle_t rotation = 0;
|
|
||||||
|
|
||||||
// try all modes backwards until a valid texture has been found.
|
if (am_showthingsprites > 0 && t->sprite > 0)
|
||||||
for(int show = am_showthingsprites; show > 0 && texture == NULL; show--)
|
|
||||||
{
|
{
|
||||||
const spritedef_t& sprite = sprites[t->sprite];
|
FTexture *texture = NULL;
|
||||||
const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0);
|
spriteframe_t *frame;
|
||||||
|
angle_t rotation = 0;
|
||||||
|
|
||||||
|
// try all modes backwards until a valid texture has been found.
|
||||||
|
for(int show = am_showthingsprites; show > 0 && texture == NULL; show--)
|
||||||
|
{
|
||||||
|
const spritedef_t& sprite = sprites[t->sprite];
|
||||||
|
const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0);
|
||||||
|
|
||||||
|
frame = &SpriteFrames[spriteIndex];
|
||||||
|
angle_t angle = ANGLE_270 - t->angle;
|
||||||
|
if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16);
|
||||||
|
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||||
|
{
|
||||||
|
angle += players[consoleplayer].camera->angle - ANGLE_90;
|
||||||
|
}
|
||||||
|
rotation = angle >> 28;
|
||||||
|
|
||||||
|
const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0];
|
||||||
|
texture = TexMan(textureID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found.
|
||||||
|
|
||||||
|
const fixed_t spriteScale = 10 * scale_mtof;
|
||||||
|
|
||||||
|
DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)),
|
||||||
|
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
drawTriangle:
|
||||||
|
angle = t->angle;
|
||||||
|
|
||||||
frame = &SpriteFrames[spriteIndex];
|
|
||||||
angle_t angle = ANGLE_270 - t->angle;
|
|
||||||
if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16);
|
|
||||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||||
{
|
{
|
||||||
angle += players[consoleplayer].camera->angle - ANGLE_90;
|
AM_rotatePoint (&p.x, &p.y);
|
||||||
|
angle += ANG90 - players[consoleplayer].camera->angle;
|
||||||
}
|
}
|
||||||
rotation = angle >> 28;
|
|
||||||
|
|
||||||
const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0];
|
color = AMColors[AMColors.ThingColor];
|
||||||
texture = TexMan(textureID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found.
|
// use separate colors for special thing types
|
||||||
|
if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE))
|
||||||
const fixed_t spriteScale = 10 * scale_mtof;
|
|
||||||
|
|
||||||
DrawMarker (texture, p.x, p.y, 0, !!(frame->Flip & (1 << rotation)),
|
|
||||||
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
drawTriangle:
|
|
||||||
angle = t->angle;
|
|
||||||
|
|
||||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
|
||||||
{
|
|
||||||
AM_rotatePoint (&p.x, &p.y);
|
|
||||||
angle += ANG90 - players[consoleplayer].camera->angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
color = AMColors[AMColors.ThingColor];
|
|
||||||
|
|
||||||
// use separate colors for special thing types
|
|
||||||
if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE))
|
|
||||||
{
|
|
||||||
if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_Friend];
|
|
||||||
else color = AMColors[AMColors.ThingColor_Monster];
|
|
||||||
}
|
|
||||||
else if (t->flags&MF_SPECIAL)
|
|
||||||
{
|
|
||||||
// Find the key's own color.
|
|
||||||
// Only works correctly if single-key locks have lower numbers than any-key locks.
|
|
||||||
// That is the case for all default keys, however.
|
|
||||||
if (t->IsKindOf(RUNTIME_CLASS(AKey)))
|
|
||||||
{
|
{
|
||||||
if (G_SkillProperty(SKILLP_EasyKey))
|
if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_Friend];
|
||||||
|
else color = AMColors[AMColors.ThingColor_Monster];
|
||||||
|
}
|
||||||
|
else if (t->flags&MF_SPECIAL)
|
||||||
|
{
|
||||||
|
// Find the key's own color.
|
||||||
|
// Only works correctly if single-key locks have lower numbers than any-key locks.
|
||||||
|
// That is the case for all default keys, however.
|
||||||
|
if (t->IsKindOf(RUNTIME_CLASS(AKey)))
|
||||||
{
|
{
|
||||||
// Already drawn by AM_drawKeys(), so don't draw again
|
if (G_SkillProperty(SKILLP_EasyKey))
|
||||||
color.Index = -1;
|
{
|
||||||
}
|
// Already drawn by AM_drawKeys(), so don't draw again
|
||||||
else if (am_showkeys)
|
color.Index = -1;
|
||||||
{
|
}
|
||||||
int P_GetMapColorForKey (AInventory * key);
|
else if (am_showkeys)
|
||||||
int c = P_GetMapColorForKey(static_cast<AKey *>(t));
|
{
|
||||||
|
int P_GetMapColorForKey (AInventory * key);
|
||||||
|
int c = P_GetMapColorForKey(static_cast<AKey *>(t));
|
||||||
|
|
||||||
if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c));
|
if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c));
|
||||||
else color = AMColors[AMColors.ThingColor_CountItem];
|
else color = AMColors[AMColors.ThingColor_CountItem];
|
||||||
AM_drawLineCharacter(&CheatKey[0], CheatKey.Size(), 0, 0, color, p.x, p.y);
|
AM_drawLineCharacter(&CheatKey[0], CheatKey.Size(), 0, 0, color, p.x, p.y);
|
||||||
color.Index = -1;
|
color.Index = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = AMColors[AMColors.ThingColor_Item];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (t->flags&MF_COUNTITEM)
|
||||||
|
color = AMColors[AMColors.ThingColor_CountItem];
|
||||||
else
|
else
|
||||||
{
|
|
||||||
color = AMColors[AMColors.ThingColor_Item];
|
color = AMColors[AMColors.ThingColor_Item];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (t->flags&MF_COUNTITEM)
|
|
||||||
color = AMColors[AMColors.ThingColor_CountItem];
|
|
||||||
else
|
|
||||||
color = AMColors[AMColors.ThingColor_Item];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (color.Index != -1)
|
if (color.Index != -1)
|
||||||
{
|
|
||||||
AM_drawLineCharacter
|
|
||||||
(thintriangle_guy, NUMTHINTRIANGLEGUYLINES,
|
|
||||||
16<<MAPBITS, angle, color, p.x, p.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (am_cheat == 3 || am_cheat == 6)
|
|
||||||
{
|
|
||||||
static const mline_t box[4] =
|
|
||||||
{
|
{
|
||||||
{ { -MAPUNIT, -MAPUNIT }, { MAPUNIT, -MAPUNIT } },
|
AM_drawLineCharacter
|
||||||
{ { MAPUNIT, -MAPUNIT }, { MAPUNIT, MAPUNIT } },
|
(thintriangle_guy, NUMTHINTRIANGLEGUYLINES,
|
||||||
{ { MAPUNIT, MAPUNIT }, { -MAPUNIT, MAPUNIT } },
|
16<<MAPBITS, angle, color, p.x, p.y);
|
||||||
{ { -MAPUNIT, MAPUNIT }, { -MAPUNIT, -MAPUNIT } },
|
}
|
||||||
};
|
|
||||||
|
|
||||||
AM_drawLineCharacter (box, 4, t->radius >> FRACTOMAPBITS, angle - t->angle, color, p.x, p.y);
|
if (am_cheat == 3 || am_cheat == 6)
|
||||||
|
{
|
||||||
|
static const mline_t box[4] =
|
||||||
|
{
|
||||||
|
{ { -MAPUNIT, -MAPUNIT }, { MAPUNIT, -MAPUNIT } },
|
||||||
|
{ { MAPUNIT, -MAPUNIT }, { MAPUNIT, MAPUNIT } },
|
||||||
|
{ { MAPUNIT, MAPUNIT }, { -MAPUNIT, MAPUNIT } },
|
||||||
|
{ { -MAPUNIT, MAPUNIT }, { -MAPUNIT, -MAPUNIT } },
|
||||||
|
};
|
||||||
|
|
||||||
|
AM_drawLineCharacter (box, 4, t->radius >> FRACTOMAPBITS, angle - t->angle, color, p.x, p.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t = t->snext;
|
t = t->snext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1697,7 +1697,7 @@ void APowerRegeneration::DoEffect()
|
||||||
{
|
{
|
||||||
if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0)
|
if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0)
|
||||||
{
|
{
|
||||||
if (P_GiveBody(Owner, 5))
|
if (P_GiveBody(Owner, Strength))
|
||||||
{
|
{
|
||||||
S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM );
|
S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM );
|
||||||
}
|
}
|
||||||
|
|
|
@ -5047,6 +5047,15 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos)
|
||||||
P_CheckFakeFloorTriggers (thing, oldz);
|
P_CheckFakeFloorTriggers (thing, oldz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((thing->z != oldfloorz && !(thing->flags & MF_NOLIFTDROP)))
|
||||||
|
{
|
||||||
|
fixed_t oldz = thing->z;
|
||||||
|
if ((thing->flags & MF_NOGRAVITY) && (thing->flags6 & MF6_RELATIVETOFLOOR))
|
||||||
|
{
|
||||||
|
thing->z = thing->z - oldfloorz + thing->floorz;
|
||||||
|
P_CheckFakeFloorTriggers (thing, oldz);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -5058,6 +5067,7 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos)
|
||||||
void PIT_FloorRaise (AActor *thing, FChangePosition *cpos)
|
void PIT_FloorRaise (AActor *thing, FChangePosition *cpos)
|
||||||
{
|
{
|
||||||
fixed_t oldfloorz = thing->floorz;
|
fixed_t oldfloorz = thing->floorz;
|
||||||
|
fixed_t oldz = thing->z;
|
||||||
|
|
||||||
P_AdjustFloorCeil (thing, cpos);
|
P_AdjustFloorCeil (thing, cpos);
|
||||||
|
|
||||||
|
@ -5072,22 +5082,30 @@ void PIT_FloorRaise (AActor *thing, FChangePosition *cpos)
|
||||||
return; // do not move bridge things
|
return; // do not move bridge things
|
||||||
}
|
}
|
||||||
intersectors.Clear ();
|
intersectors.Clear ();
|
||||||
fixed_t oldz = thing->z;
|
|
||||||
thing->z = thing->floorz;
|
thing->z = thing->floorz;
|
||||||
switch (P_PushUp (thing, cpos))
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if((thing->flags & MF_NOGRAVITY) && (thing->flags6 & MF6_RELATIVETOFLOOR))
|
||||||
{
|
{
|
||||||
default:
|
intersectors.Clear ();
|
||||||
P_CheckFakeFloorTriggers (thing, oldz);
|
thing->z = thing->z - oldfloorz + thing->floorz;
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
P_DoCrunch (thing, cpos);
|
|
||||||
P_CheckFakeFloorTriggers (thing, oldz);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
P_DoCrunch (thing, cpos);
|
|
||||||
thing->z = oldz;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else return;
|
||||||
|
}
|
||||||
|
switch (P_PushUp (thing, cpos))
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
P_CheckFakeFloorTriggers (thing, oldz);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
P_DoCrunch (thing, cpos);
|
||||||
|
P_CheckFakeFloorTriggers (thing, oldz);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
P_DoCrunch (thing, cpos);
|
||||||
|
thing->z = oldz;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,8 @@ static FFlagDef ActorFlags[]=
|
||||||
DEFINE_FLAG(MF6, DOHARMSPECIES, AActor, flags6),
|
DEFINE_FLAG(MF6, DOHARMSPECIES, AActor, flags6),
|
||||||
DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6),
|
DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6),
|
||||||
DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6),
|
DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6),
|
||||||
|
DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6),
|
||||||
|
DEFINE_FLAG(MF6, RELATIVETOFLOOR, AActor, flags6),
|
||||||
|
|
||||||
// Effect flags
|
// Effect flags
|
||||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||||
|
|
|
@ -300,6 +300,7 @@ ACTOR PowerDrain : Powerup native
|
||||||
ACTOR PowerRegeneration : Powerup native
|
ACTOR PowerRegeneration : Powerup native
|
||||||
{
|
{
|
||||||
Powerup.Duration -120
|
Powerup.Duration -120
|
||||||
|
Powerup.Strength 5
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTOR PowerHighJump : Powerup native {}
|
ACTOR PowerHighJump : Powerup native {}
|
||||||
|
|
Loading…
Reference in a new issue