2008-01-27 11:25:03 +00:00
|
|
|
/*
|
|
|
|
** a_decals.cpp
|
|
|
|
** Implements the actor that represents decals in the level
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 1998-2006 Randy Heit
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "actor.h"
|
|
|
|
#include "a_sharedglobal.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "p_trace.h"
|
|
|
|
#include "decallib.h"
|
|
|
|
#include "statnums.h"
|
|
|
|
#include "c_dispatch.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "d_net.h"
|
|
|
|
#include "colormatcher.h"
|
|
|
|
#include "v_palette.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
static fixed_t DecalWidth, DecalLeft, DecalRight;
|
|
|
|
static fixed_t SpreadZ;
|
|
|
|
static const DBaseDecal *SpreadSource;
|
|
|
|
static const FDecalTemplate *SpreadTemplate;
|
|
|
|
static TArray<side_t *> SpreadStack;
|
|
|
|
|
|
|
|
static int ImpactCount;
|
|
|
|
|
|
|
|
CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE)
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
IMPLEMENT_POINTY_CLASS (DBaseDecal)
|
|
|
|
DECLARE_POINTER(WallNext)
|
|
|
|
END_POINTERS
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
IMPLEMENT_CLASS (DImpactDecal)
|
|
|
|
|
|
|
|
DBaseDecal::DBaseDecal ()
|
|
|
|
: DThinker(STAT_DECAL),
|
|
|
|
WallNext(0), WallPrev(0), LeftDistance(0), Z(0), ScaleX(FRACUNIT), ScaleY(FRACUNIT), Alpha(FRACUNIT),
|
2008-06-28 13:29:59 +00:00
|
|
|
AlphaColor(0), Translation(0), RenderFlags(0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
RenderStyle = STYLE_None;
|
2008-06-28 13:29:59 +00:00
|
|
|
PicNum.SetInvalid();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal::DBaseDecal (fixed_t z)
|
|
|
|
: DThinker(STAT_DECAL),
|
|
|
|
WallNext(0), WallPrev(0), LeftDistance(0), Z(z), ScaleX(FRACUNIT), ScaleY(FRACUNIT), Alpha(FRACUNIT),
|
2008-06-28 13:29:59 +00:00
|
|
|
AlphaColor(0), Translation(0), RenderFlags(0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
RenderStyle = STYLE_None;
|
2008-06-28 13:29:59 +00:00
|
|
|
PicNum.SetInvalid();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal::DBaseDecal (int statnum, fixed_t z)
|
|
|
|
: DThinker(statnum),
|
|
|
|
WallNext(0), WallPrev(0), LeftDistance(0), Z(z), ScaleX(FRACUNIT), ScaleY(FRACUNIT), Alpha(FRACUNIT),
|
2008-06-28 13:29:59 +00:00
|
|
|
AlphaColor(0), Translation(0), RenderFlags(0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
RenderStyle = STYLE_None;
|
2008-06-28 13:29:59 +00:00
|
|
|
PicNum.SetInvalid();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal::DBaseDecal (const AActor *basis)
|
|
|
|
: DThinker(STAT_DECAL),
|
|
|
|
WallNext(0), WallPrev(0), LeftDistance(0), Z(basis->z), ScaleX(basis->scaleX), ScaleY(basis->scaleY),
|
2008-01-27 15:34:47 +00:00
|
|
|
Alpha(basis->alpha), AlphaColor(basis->fillcolor), Translation(basis->Translation), PicNum(basis->picnum),
|
2008-01-27 11:25:03 +00:00
|
|
|
RenderFlags(basis->renderflags), RenderStyle(basis->RenderStyle)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal::DBaseDecal (const DBaseDecal *basis)
|
|
|
|
: DThinker(STAT_DECAL),
|
|
|
|
WallNext(0), WallPrev(0), LeftDistance(basis->LeftDistance), Z(basis->Z), ScaleX(basis->ScaleX),
|
|
|
|
ScaleY(basis->ScaleY), Alpha(basis->Alpha), AlphaColor(basis->AlphaColor), Translation(basis->Translation),
|
|
|
|
PicNum(basis->PicNum), RenderFlags(basis->RenderFlags), RenderStyle(basis->RenderStyle)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::Destroy ()
|
|
|
|
{
|
|
|
|
Remove ();
|
|
|
|
Super::Destroy ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::Remove ()
|
|
|
|
{
|
|
|
|
DBaseDecal **prev = WallPrev;
|
|
|
|
DBaseDecal *next = WallNext;
|
|
|
|
if (prev && (*prev = next))
|
|
|
|
next->WallPrev = prev;
|
|
|
|
WallPrev = NULL;
|
|
|
|
WallNext = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::Serialize (FArchive &arc)
|
|
|
|
{
|
|
|
|
Super::Serialize (arc);
|
|
|
|
arc << LeftDistance
|
|
|
|
<< Z
|
|
|
|
<< ScaleX << ScaleY
|
|
|
|
<< Alpha
|
|
|
|
<< AlphaColor
|
|
|
|
<< Translation
|
|
|
|
<< PicNum
|
|
|
|
<< RenderFlags
|
|
|
|
<< RenderStyle
|
|
|
|
<< Sector;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::SerializeChain (FArchive &arc, DBaseDecal **first)
|
|
|
|
{
|
|
|
|
DWORD numInChain;
|
|
|
|
DBaseDecal *fresh;
|
|
|
|
DBaseDecal **firstptr = first;
|
|
|
|
|
|
|
|
if (arc.IsLoading ())
|
|
|
|
{
|
|
|
|
numInChain = arc.ReadCount ();
|
|
|
|
|
|
|
|
while (numInChain--)
|
|
|
|
{
|
|
|
|
arc << fresh;
|
|
|
|
*firstptr = fresh;
|
|
|
|
fresh->WallPrev = firstptr;
|
|
|
|
firstptr = &fresh->WallNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
numInChain = 0;
|
|
|
|
fresh = *firstptr;
|
|
|
|
while (fresh != NULL)
|
|
|
|
{
|
|
|
|
fresh = fresh->WallNext;
|
|
|
|
++numInChain;
|
|
|
|
}
|
|
|
|
arc.WriteCount (numInChain);
|
|
|
|
fresh = *firstptr;
|
|
|
|
while (numInChain--)
|
|
|
|
{
|
|
|
|
arc << fresh;
|
|
|
|
fresh = fresh->WallNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::GetXY (side_t *wall, fixed_t &ox, fixed_t &oy) const
|
|
|
|
{
|
2009-09-06 18:30:07 +00:00
|
|
|
line_t *line = wall->linedef;
|
2008-01-27 11:25:03 +00:00
|
|
|
vertex_t *v1, *v2;
|
|
|
|
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
v1 = line->v1;
|
|
|
|
v2 = line->v2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v1 = line->v2;
|
|
|
|
v2 = line->v1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fixed_t dx = v2->x - v1->x;
|
|
|
|
fixed_t dy = v2->y - v1->y;
|
|
|
|
|
|
|
|
ox = v1->x + MulScale30 (LeftDistance, dx);
|
|
|
|
oy = v1->y + MulScale30 (LeftDistance, dy);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::SetShade (DWORD rgb)
|
|
|
|
{
|
|
|
|
PalEntry *entry = (PalEntry *)&rgb;
|
|
|
|
AlphaColor = rgb | (ColorMatcher.Pick (entry->r, entry->g, entry->b) << 24);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::SetShade (int r, int g, int b)
|
|
|
|
{
|
|
|
|
AlphaColor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns the texture the decal stuck to.
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
FTextureID DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor *ffloor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Stick the decal at the end of the chain so it appears on top
|
|
|
|
DBaseDecal *next, **prev;
|
|
|
|
|
|
|
|
prev = &wall->AttachedDecals;
|
|
|
|
while (*prev != NULL)
|
|
|
|
{
|
|
|
|
next = *prev;
|
|
|
|
prev = &next->WallNext;
|
|
|
|
}
|
|
|
|
|
|
|
|
*prev = this;
|
|
|
|
WallNext = NULL;
|
|
|
|
WallPrev = prev;
|
|
|
|
/*
|
|
|
|
WallNext = wall->AttachedDecals;
|
|
|
|
WallPrev = &wall->AttachedDecals;
|
|
|
|
if (WallNext)
|
|
|
|
WallNext->WallPrev = &WallNext;
|
|
|
|
wall->AttachedDecals = this;
|
|
|
|
*/
|
|
|
|
sector_t *front, *back;
|
|
|
|
line_t *line;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID tex;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-09-06 18:30:07 +00:00
|
|
|
line = wall->linedef;
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
front = line->frontsector;
|
|
|
|
back = line->backsector;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
front = line->backsector;
|
|
|
|
back = line->frontsector;
|
|
|
|
}
|
|
|
|
if (back == NULL)
|
|
|
|
{
|
|
|
|
RenderFlags |= RF_RELMID;
|
|
|
|
if (line->flags & ML_DONTPEGBOTTOM)
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= front->GetPlaneTexZ(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
2008-03-21 21:15:56 +00:00
|
|
|
tex = wall->GetTexture(side_t::mid);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (back->floorplane.ZatPoint (x, y) >= Z)
|
|
|
|
{
|
|
|
|
RenderFlags |= RF_RELLOWER|RF_CLIPLOWER;
|
|
|
|
if (line->flags & ML_DONTPEGBOTTOM)
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= back->GetPlaneTexZ(sector_t::floor);
|
2008-03-21 21:15:56 +00:00
|
|
|
tex = wall->GetTexture(side_t::bottom);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (back->ceilingplane.ZatPoint (x, y) <= Z)
|
|
|
|
{
|
|
|
|
RenderFlags |= RF_RELUPPER|RF_CLIPUPPER;
|
|
|
|
if (line->flags & ML_DONTPEGTOP)
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= back->GetPlaneTexZ(sector_t::ceiling);
|
2008-03-21 21:15:56 +00:00
|
|
|
tex = wall->GetTexture(side_t::top);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-01-04 15:56:30 +00:00
|
|
|
#ifdef _3DFLOORS
|
2008-01-27 11:25:03 +00:00
|
|
|
else if (ffloor) // this is a 3d-floor segment - do this only if we know which one!
|
|
|
|
{
|
|
|
|
Sector=ffloor->model;
|
|
|
|
RenderFlags |= RF_RELMID|RF_CLIPMID;
|
|
|
|
if (line->flags & ML_DONTPEGBOTTOM)
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= Sector->GetPlaneTexZ(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-08-22 07:36:50 +00:00
|
|
|
Z -= Sector->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (ffloor->flags & FF_UPPERTEXTURE)
|
|
|
|
{
|
2008-03-21 21:15:56 +00:00
|
|
|
tex = wall->GetTexture(side_t::top);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (ffloor->flags & FF_LOWERTEXTURE)
|
|
|
|
{
|
2008-03-21 21:15:56 +00:00
|
|
|
tex = wall->GetTexture(side_t::bottom);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-09-06 21:11:24 +00:00
|
|
|
tex = ffloor->master->sidedef[0]->GetTexture(side_t::mid);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
2009-01-04 15:56:30 +00:00
|
|
|
#endif
|
2008-06-28 13:29:59 +00:00
|
|
|
else return FNullTextureID();
|
2008-01-27 11:25:03 +00:00
|
|
|
CalcFracPos (wall, x, y);
|
|
|
|
|
2009-12-25 12:10:12 +00:00
|
|
|
FTexture *texture = TexMan[tex];
|
|
|
|
|
|
|
|
if (texture == NULL || texture->bNoDecals)
|
|
|
|
{
|
|
|
|
return FNullTextureID();
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
return tex;
|
|
|
|
}
|
|
|
|
|
|
|
|
fixed_t DBaseDecal::GetRealZ (const side_t *wall) const
|
|
|
|
{
|
2009-09-06 18:30:07 +00:00
|
|
|
const line_t *line = wall->linedef;
|
2008-01-27 11:25:03 +00:00
|
|
|
const sector_t *front, *back;
|
|
|
|
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
front = line->frontsector;
|
|
|
|
back = line->backsector;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
front = line->backsector;
|
|
|
|
back = line->frontsector;
|
|
|
|
}
|
|
|
|
if (back == NULL)
|
|
|
|
{
|
|
|
|
back = front;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (RenderFlags & RF_RELMASK)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return Z;
|
|
|
|
case RF_RELUPPER:
|
2008-09-15 23:47:00 +00:00
|
|
|
if (line->flags & ML_DONTPEGTOP)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + back->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
case RF_RELLOWER:
|
2008-09-15 23:47:00 +00:00
|
|
|
if (line->flags & ML_DONTPEGBOTTOM)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + back->GetPlaneTexZ(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
case RF_RELMID:
|
2008-09-15 23:47:00 +00:00
|
|
|
if (line->flags & ML_DONTPEGBOTTOM)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + front->GetPlaneTexZ(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::CalcFracPos (side_t *wall, fixed_t x, fixed_t y)
|
|
|
|
{
|
2009-10-01 21:04:23 +00:00
|
|
|
line_t *line = wall->linedef;
|
2008-01-27 11:25:03 +00:00
|
|
|
vertex_t *v1, *v2;
|
|
|
|
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
v1 = line->v1;
|
|
|
|
v2 = line->v2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v1 = line->v2;
|
|
|
|
v2 = line->v1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fixed_t dx = v2->x - v1->x;
|
|
|
|
fixed_t dy = v2->y - v1->y;
|
|
|
|
|
|
|
|
if (abs(dx) > abs(dy))
|
|
|
|
{
|
|
|
|
LeftDistance = SafeDivScale30 (x - v1->x, dx);
|
|
|
|
}
|
|
|
|
else if (dy != 0)
|
|
|
|
{
|
|
|
|
LeftDistance = SafeDivScale30 (y - v1->y, dy);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LeftDistance = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void GetWallStuff (side_t *wall, vertex_t *&v1, fixed_t &ldx, fixed_t &ldy)
|
|
|
|
{
|
2009-10-01 21:04:23 +00:00
|
|
|
line_t *line = wall->linedef;
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
v1 = line->v1;
|
|
|
|
ldx = line->dx;
|
|
|
|
ldy = line->dy;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
v1 = line->v2;
|
|
|
|
ldx = -line->dx;
|
|
|
|
ldy = -line->dy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static fixed_t Length (fixed_t dx, fixed_t dy)
|
|
|
|
{
|
|
|
|
return (fixed_t)sqrtf ((float)dx*(float)dx+(float)dy*(float)dy);
|
|
|
|
}
|
|
|
|
|
|
|
|
static side_t *NextWall (const side_t *wall)
|
|
|
|
{
|
2009-10-01 21:04:23 +00:00
|
|
|
line_t *line = wall->linedef;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[0] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-09-06 21:11:24 +00:00
|
|
|
if (line->sidedef[1] != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-09-06 21:11:24 +00:00
|
|
|
return line->sidedef[1];
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
2009-09-06 21:11:24 +00:00
|
|
|
else if (line->sidedef[1] == wall)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-09-06 21:11:24 +00:00
|
|
|
return line->sidedef[0];
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
void DBaseDecal::SpreadLeft (fixed_t r, vertex_t *v1, side_t *feelwall, F3DFloor *ffloor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t ldx, ldy;
|
|
|
|
|
|
|
|
SpreadStack.Push (feelwall);
|
|
|
|
|
|
|
|
while (r < 0 && feelwall->LeftSide != NO_SIDE)
|
|
|
|
{
|
|
|
|
fixed_t startr = r;
|
|
|
|
|
|
|
|
fixed_t x = v1->x;
|
|
|
|
fixed_t y = v1->y;
|
|
|
|
|
|
|
|
feelwall = &sides[feelwall->LeftSide];
|
|
|
|
GetWallStuff (feelwall, v1, ldx, ldy);
|
|
|
|
fixed_t wallsize = Length (ldx, ldy);
|
|
|
|
r += DecalLeft;
|
|
|
|
x += Scale (r, ldx, wallsize);
|
|
|
|
y += Scale (r, ldy, wallsize);
|
|
|
|
r = wallsize + startr;
|
|
|
|
SpreadSource->CloneSelf (SpreadTemplate, x, y, SpreadZ, feelwall, ffloor);
|
|
|
|
SpreadStack.Push (feelwall);
|
|
|
|
|
|
|
|
side_t *nextwall = NextWall (feelwall);
|
|
|
|
if (nextwall != NULL && nextwall->LeftSide != NO_SIDE)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = SpreadStack.Size(); i-- > 0; )
|
|
|
|
{
|
|
|
|
if (SpreadStack[i] == nextwall)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == -1)
|
|
|
|
{
|
|
|
|
vertex_t *v2;
|
|
|
|
|
|
|
|
GetWallStuff (nextwall, v2, ldx, ldy);
|
|
|
|
SpreadLeft (startr, v2, nextwall, ffloor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
void DBaseDecal::SpreadRight (fixed_t r, side_t *feelwall, fixed_t wallsize, F3DFloor *ffloor)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
vertex_t *v1;
|
|
|
|
fixed_t x, y, ldx, ldy;
|
|
|
|
|
|
|
|
SpreadStack.Push (feelwall);
|
|
|
|
|
|
|
|
while (r > wallsize && feelwall->RightSide != NO_SIDE)
|
|
|
|
{
|
|
|
|
feelwall = &sides[feelwall->RightSide];
|
|
|
|
|
|
|
|
side_t *nextwall = NextWall (feelwall);
|
|
|
|
if (nextwall != NULL && nextwall->LeftSide != NO_SIDE)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = SpreadStack.Size(); i-- > 0; )
|
|
|
|
{
|
|
|
|
if (SpreadStack[i] == nextwall)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == -1)
|
|
|
|
{
|
|
|
|
SpreadRight (r, nextwall, wallsize, ffloor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
r = DecalWidth - r + wallsize - DecalLeft;
|
|
|
|
GetWallStuff (feelwall, v1, ldx, ldy);
|
|
|
|
x = v1->x;
|
|
|
|
y = v1->y;
|
|
|
|
wallsize = Length (ldx, ldy);
|
|
|
|
x -= Scale (r, ldx, wallsize);
|
|
|
|
y -= Scale (r, ldy, wallsize);
|
|
|
|
r = DecalRight - r;
|
|
|
|
SpreadSource->CloneSelf (SpreadTemplate, x, y, SpreadZ, feelwall, ffloor);
|
|
|
|
SpreadStack.Push (feelwall);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DBaseDecal::Spread (const FDecalTemplate *tpl, side_t *wall, fixed_t x, fixed_t y, fixed_t z, F3DFloor * ffloor)
|
|
|
|
{
|
|
|
|
FTexture *tex;
|
|
|
|
vertex_t *v1;
|
|
|
|
fixed_t rorg, ldx, ldy;
|
|
|
|
|
|
|
|
GetWallStuff (wall, v1, ldx, ldy);
|
|
|
|
rorg = Length (x - v1->x, y - v1->y);
|
|
|
|
|
|
|
|
tex = TexMan[PicNum];
|
|
|
|
int dwidth = tex->GetWidth ();
|
|
|
|
|
|
|
|
DecalWidth = dwidth * ScaleX;
|
|
|
|
DecalLeft = tex->LeftOffset * ScaleX;
|
|
|
|
DecalRight = DecalWidth - DecalLeft;
|
|
|
|
SpreadSource = this;
|
|
|
|
SpreadTemplate = tpl;
|
|
|
|
SpreadZ = z;
|
|
|
|
|
|
|
|
// Try spreading left first
|
Update to ZDoom r1705:
- ZDoom now disables the input method editor, since it has no east-Asian
support, and having it open a composition window when you're only expecting
a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
from being thrusted while taking damage. (Non-players were already
unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
maintains its own FOV scale independent from any other weapons the player
may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
the CMakeLists.txt checks for xinput.h and disables it if it cannot
be found. (And much to my surprise, I accidentally discovered that if you
have the DirectX SDK installed, those headers actually do work with GCC,
though they add a few extra warnings.)
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
|
|
|
SpreadLeft (rorg - DecalLeft, v1, wall, ffloor);
|
2008-01-27 11:25:03 +00:00
|
|
|
SpreadStack.Clear ();
|
|
|
|
|
|
|
|
// Then try spreading right
|
|
|
|
SpreadRight (rorg + DecalRight, wall,
|
2009-09-06 18:30:07 +00:00
|
|
|
Length (wall->linedef->dx, wall->linedef->dy), ffloor);
|
2008-01-27 11:25:03 +00:00
|
|
|
SpreadStack.Clear ();
|
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal *DBaseDecal::CloneSelf (const FDecalTemplate *tpl, fixed_t ix, fixed_t iy, fixed_t iz, side_t *wall, F3DFloor * ffloor) const
|
|
|
|
{
|
|
|
|
DBaseDecal *decal = new DBaseDecal(iz);
|
|
|
|
if (decal != NULL)
|
|
|
|
{
|
2009-12-25 12:10:12 +00:00
|
|
|
if (decal->StickToWall (wall, ix, iy, ffloor).isValid())
|
|
|
|
{
|
|
|
|
tpl->ApplyToDecal (decal, wall);
|
|
|
|
decal->AlphaColor = AlphaColor;
|
|
|
|
decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) |
|
|
|
|
(this->RenderFlags & ~RF_DECALMASK);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
decal->Destroy();
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return decal;
|
|
|
|
}
|
|
|
|
|
|
|
|
CUSTOM_CVAR (Int, cl_maxdecals, 1024, CVAR_ARCHIVE)
|
|
|
|
{
|
|
|
|
if (self < 0)
|
|
|
|
{
|
|
|
|
self = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (ImpactCount > self)
|
|
|
|
{
|
|
|
|
DThinker *thinker = DThinker::FirstThinker (STAT_AUTODECAL);
|
|
|
|
if (thinker != NULL)
|
|
|
|
{
|
|
|
|
thinker->Destroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Uses: target points to previous impact decal
|
|
|
|
// tracer points to next impact decal
|
|
|
|
//
|
|
|
|
// Note that this means we can't simply serialize an impact decal as-is
|
|
|
|
// because doing so when many are present in a level could result in
|
|
|
|
// a lot of recursion and we would run out of stack. Not nice. So instead,
|
|
|
|
// the save game code calls DImpactDecal::SerializeAll to serialize a
|
|
|
|
// list of impact decals.
|
|
|
|
|
|
|
|
void DImpactDecal::SerializeTime (FArchive &arc)
|
|
|
|
{
|
|
|
|
if (arc.IsLoading ())
|
|
|
|
{
|
|
|
|
ImpactCount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DImpactDecal::Serialize (FArchive &arc)
|
|
|
|
{
|
|
|
|
Super::Serialize (arc);
|
|
|
|
}
|
|
|
|
|
|
|
|
DImpactDecal::DImpactDecal ()
|
|
|
|
: DBaseDecal (STAT_AUTODECAL, 0)
|
|
|
|
{
|
|
|
|
ImpactCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
DImpactDecal::DImpactDecal (fixed_t z)
|
|
|
|
: DBaseDecal (STAT_AUTODECAL, z)
|
|
|
|
{
|
|
|
|
ImpactCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DImpactDecal::CheckMax ()
|
|
|
|
{
|
|
|
|
if (ImpactCount >= cl_maxdecals)
|
|
|
|
{
|
|
|
|
DThinker *thinker = DThinker::FirstThinker (STAT_AUTODECAL);
|
|
|
|
if (thinker != NULL)
|
|
|
|
{
|
|
|
|
thinker->Destroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DImpactDecal *DImpactDecal::StaticCreate (const char *name, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor, PalEntry color)
|
|
|
|
{
|
|
|
|
if (cl_maxdecals > 0)
|
|
|
|
{
|
|
|
|
const FDecalTemplate *tpl = DecalLibrary.GetDecalByName (name);
|
|
|
|
|
|
|
|
if (tpl != NULL && (tpl = tpl->GetDecal()) != NULL)
|
|
|
|
{
|
|
|
|
return StaticCreate (tpl, x, y, z, wall, ffloor, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
DImpactDecal *DImpactDecal::StaticCreate (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor, PalEntry color)
|
|
|
|
{
|
|
|
|
DImpactDecal *decal = NULL;
|
|
|
|
if (tpl != NULL && cl_maxdecals > 0 && !(wall->Flags & WALLF_NOAUTODECALS))
|
|
|
|
{
|
|
|
|
if (tpl->LowerDecal)
|
|
|
|
{
|
2009-10-17 16:33:44 +00:00
|
|
|
int lowercolor;
|
2008-01-27 11:25:03 +00:00
|
|
|
const FDecalTemplate * tpl_low = tpl->LowerDecal->GetDecal();
|
|
|
|
|
|
|
|
// If the default color of the lower decal is the same as the main decal's
|
|
|
|
// apply the custom color as well.
|
2009-10-17 16:33:44 +00:00
|
|
|
if (tpl->ShadeColor != tpl_low->ShadeColor) lowercolor=0;
|
|
|
|
else lowercolor = color;
|
2008-01-27 11:25:03 +00:00
|
|
|
StaticCreate (tpl_low, x, y, z, wall, ffloor, lowercolor);
|
|
|
|
}
|
|
|
|
DImpactDecal::CheckMax();
|
|
|
|
decal = new DImpactDecal (z);
|
2009-12-25 12:10:12 +00:00
|
|
|
if (decal == NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-12-25 12:10:12 +00:00
|
|
|
if (!decal->StickToWall (wall, x, y, ffloor).isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
tpl->ApplyToDecal (decal, wall);
|
|
|
|
if (color != 0)
|
|
|
|
{
|
|
|
|
decal->SetShade (color.r, color.g, color.b);
|
|
|
|
}
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!cl_spreaddecals || !decal->PicNum.isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
return decal;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Spread decal to nearby walls if it does not all fit on this one
|
|
|
|
decal->Spread (tpl, wall, x, y, z, ffloor);
|
|
|
|
}
|
|
|
|
return decal;
|
|
|
|
}
|
|
|
|
|
|
|
|
DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, fixed_t ix, fixed_t iy, fixed_t iz, side_t *wall, F3DFloor * ffloor) const
|
|
|
|
{
|
2009-12-25 12:10:12 +00:00
|
|
|
if (wall->Flags & WALLF_NOAUTODECALS)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
DImpactDecal::CheckMax();
|
|
|
|
DImpactDecal *decal = new DImpactDecal(iz);
|
|
|
|
if (decal != NULL)
|
|
|
|
{
|
2009-12-25 12:10:12 +00:00
|
|
|
if (decal->StickToWall (wall, ix, iy, ffloor).isValid())
|
|
|
|
{
|
|
|
|
tpl->ApplyToDecal (decal, wall);
|
|
|
|
decal->AlphaColor = AlphaColor;
|
|
|
|
decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) |
|
|
|
|
(this->RenderFlags & ~RF_DECALMASK);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
decal->Destroy();
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return decal;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DImpactDecal::Destroy ()
|
|
|
|
{
|
|
|
|
ImpactCount--;
|
|
|
|
Super::Destroy ();
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (countdecals)
|
|
|
|
{
|
|
|
|
Printf ("%d impact decals\n", ImpactCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (countdecalsreal)
|
|
|
|
{
|
|
|
|
TThinkerIterator<DImpactDecal> iterator (STAT_AUTODECAL);
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
while (iterator.Next())
|
|
|
|
count++;
|
|
|
|
|
|
|
|
Printf ("Counted %d impact decals\n", count);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (spray)
|
|
|
|
{
|
|
|
|
if (who == NULL || argv.argc() < 2)
|
|
|
|
{
|
|
|
|
Printf ("Usage: spray <decal>\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Net_WriteByte (DEM_SPRAY);
|
|
|
|
Net_WriteString (argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
class ADecal : public AActor
|
|
|
|
{
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
DECLARE_CLASS (ADecal, AActor);
|
2008-01-27 11:25:03 +00:00
|
|
|
public:
|
|
|
|
void BeginPlay ();
|
|
|
|
};
|
|
|
|
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
IMPLEMENT_CLASS (ADecal)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
void ADecal::BeginPlay ()
|
|
|
|
{
|
|
|
|
const FDecalTemplate *tpl;
|
|
|
|
FTraceResults trace;
|
|
|
|
DBaseDecal *decal;
|
|
|
|
side_t *wall;
|
|
|
|
|
|
|
|
Super::BeginPlay ();
|
|
|
|
|
- Fixed: The hitscan tracer had the current sector point to a temporary variable
when 3D floors were involved.
Update to ZDoom r965:
- Fixed: SPAC_AnyCross didn't work.
- Fixed: Pushable doors must also check for SPAC_MPush.
- Fixed: P_LoadThings2 did not adjust the byte order for the thingid field.
- Changed: HIRESTEX 'define' textures now replace existing textures
of type MiscPatch with the same name.
- Added UDMF line trigger types MonsterUse and MonsterPush.
- Separated skill and class filter bits from FMapThing::flags so that
UDMF can define up to 16 of each. Also separated easy/baby and
hard/nightmare and changed default MAPINFO definitions.
- Fixed: FWadCollection::MergeLumps() did not initialize the flags for any
marker lumps it inserted.
- Fixed: Need write barriers when modifying SequenceListHead.
- Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of
GUS patch flags, envelopes, and volume levels, while trying to be closer
to TiMidity++ than original TiMidity.
- Renamed timidity_config and timidity_voices to midi_config and midi_voices
respectively.
- Changed: Crosshair drawing uses the current player class's default health instead
of 100 to calculate the color for the crosshair.
- Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated
all user settable flags from MoreFlags into their own Flags variable.
- Reduced volume, expression, and panning controllers back to 7 bits.
- Added very basic Soundfont support to the internal TiMidity. Things missing:
filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or
may not be compatible with TiMidity++'s soundfont extensions.
- Changed all thing coordinates that were stored as shorts into fixed_t.
- Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so
that it is easier to add new features in the UDMF map format.
- Added some initial code to read UDMF maps.
- Added support for quoted strings to the TiMidity config parser.
- Split off the slope creation code from p_Setup.cpp into its own file.
- Separated the linedef activation types into a bit mask that allows combination
of all types on the same linedef. Also added a 'first side only' flag. This
is not usable from Hexen or Doom format maps though but in preparation of
the UDMF format discussed here:
http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/
- Changed linedef's alpha property from a byte to fixed point after seeing that
255 wasn't handled to be fully opaque.
- fixed a GCC warning in fmodsound.cpp
- Fixed: Warped textures didn't work anymore because the default speed was 0.
- Fixed: I had instrument vibrato setting the tremolo_sweep_increment value
in the instrument loader, effectively disabling vibrato.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
|
|
|
int decalid = args[0] + (args[1] << 8); // [KS] High byte for decals.
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// If no decal is specified, don't try to create one.
|
- Fixed: The hitscan tracer had the current sector point to a temporary variable
when 3D floors were involved.
Update to ZDoom r965:
- Fixed: SPAC_AnyCross didn't work.
- Fixed: Pushable doors must also check for SPAC_MPush.
- Fixed: P_LoadThings2 did not adjust the byte order for the thingid field.
- Changed: HIRESTEX 'define' textures now replace existing textures
of type MiscPatch with the same name.
- Added UDMF line trigger types MonsterUse and MonsterPush.
- Separated skill and class filter bits from FMapThing::flags so that
UDMF can define up to 16 of each. Also separated easy/baby and
hard/nightmare and changed default MAPINFO definitions.
- Fixed: FWadCollection::MergeLumps() did not initialize the flags for any
marker lumps it inserted.
- Fixed: Need write barriers when modifying SequenceListHead.
- Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of
GUS patch flags, envelopes, and volume levels, while trying to be closer
to TiMidity++ than original TiMidity.
- Renamed timidity_config and timidity_voices to midi_config and midi_voices
respectively.
- Changed: Crosshair drawing uses the current player class's default health instead
of 100 to calculate the color for the crosshair.
- Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated
all user settable flags from MoreFlags into their own Flags variable.
- Reduced volume, expression, and panning controllers back to 7 bits.
- Added very basic Soundfont support to the internal TiMidity. Things missing:
filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or
may not be compatible with TiMidity++'s soundfont extensions.
- Changed all thing coordinates that were stored as shorts into fixed_t.
- Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so
that it is easier to add new features in the UDMF map format.
- Added some initial code to read UDMF maps.
- Added support for quoted strings to the TiMidity config parser.
- Split off the slope creation code from p_Setup.cpp into its own file.
- Separated the linedef activation types into a bit mask that allows combination
of all types on the same linedef. Also added a 'first side only' flag. This
is not usable from Hexen or Doom format maps though but in preparation of
the UDMF format discussed here:
http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/
- Changed linedef's alpha property from a byte to fixed point after seeing that
255 wasn't handled to be fully opaque.
- fixed a GCC warning in fmodsound.cpp
- Fixed: Warped textures didn't work anymore because the default speed was 0.
- Fixed: I had instrument vibrato setting the tremolo_sweep_increment value
in the instrument loader, effectively disabling vibrato.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
|
|
|
if (decalid != 0 && (tpl = DecalLibrary.GetDecalByNum (decalid)) != 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!tpl->PicNum.Exists())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
Printf("Decal actor at (%d,%d) does not have a valid texture\n", x>>FRACBITS, y>>FRACBITS);
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Look for a wall within 64 units behind the actor. If none can be
|
|
|
|
// found, then no decal is created, and this actor is destroyed
|
|
|
|
// without effectively doing anything.
|
|
|
|
Trace (x, y, z, Sector,
|
|
|
|
finecosine[(angle+ANGLE_180)>>ANGLETOFINESHIFT],
|
|
|
|
finesine[(angle+ANGLE_180)>>ANGLETOFINESHIFT], 0,
|
|
|
|
64*FRACUNIT, 0, 0, NULL, trace, TRACE_NoSky);
|
|
|
|
|
|
|
|
if (trace.HitType == TRACE_HitWall)
|
|
|
|
{
|
|
|
|
decal = new DBaseDecal (this);
|
2009-09-06 21:11:24 +00:00
|
|
|
wall = trace.Line->sidedef[trace.Side];
|
2009-01-04 12:52:41 +00:00
|
|
|
decal->StickToWall (wall, trace.X, trace.Y, trace.ffloor);
|
2008-01-27 11:25:03 +00:00
|
|
|
tpl->ApplyToDecal (decal, wall);
|
|
|
|
// Spread decal to nearby walls if it does not all fit on this one
|
|
|
|
if (cl_spreaddecals)
|
|
|
|
{
|
2009-01-04 12:52:41 +00:00
|
|
|
decal->Spread (tpl, wall, trace.X, trace.Y, z, trace.ffloor);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DPrintf ("Could not find a wall to stick decal to at (%d,%d)\n", x>>FRACBITS, y>>FRACBITS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DPrintf ("Decal actor at (%d,%d) does not have a good template\n", x>>FRACBITS, y>>FRACBITS);
|
|
|
|
}
|
|
|
|
// This actor doesn't need to stick around anymore.
|
|
|
|
Destroy();
|
|
|
|
}
|