2008-01-27 11:25:03 +00:00
|
|
|
/*
|
|
|
|
** p_3dfloor.cpp
|
|
|
|
**
|
2008-03-19 11:19:03 +00:00
|
|
|
** 3D-floor handling
|
2008-01-27 11:25:03 +00:00
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
2008-03-19 11:19:03 +00:00
|
|
|
** Copyright 2005-2008 Christoph Oelckers
|
2008-01-27 11:25:03 +00:00
|
|
|
** 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.
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
** 4. Full disclosure of the entire project's source code, except for third
|
2008-06-29 10:27:22 +00:00
|
|
|
** party libraries is mandatory. (NOTE: This clause is non-negotiable!)
|
2008-01-27 11:25:03 +00:00
|
|
|
**
|
|
|
|
** 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 "templates.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_lnspec.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "sc_man.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "g_level.h"
|
2011-07-06 15:39:10 +00:00
|
|
|
#include "r_data/colormaps.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-01-04 17:06:46 +00:00
|
|
|
#ifdef _3DFLOORS
|
2011-04-18 18:05:27 +00:00
|
|
|
EXTERN_CVAR(Int, vid_renderer)
|
2009-01-04 17:06:46 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// 3D Floors
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2011-01-29 13:14:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Wrappers to access the colormap information
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
FDynamicColormap *F3DFloor::GetColormap()
|
|
|
|
{
|
|
|
|
// If there's no fog in either model or target sector this is easy and fast.
|
|
|
|
if ((target->ColorMap->Fade == 0 && model->ColorMap->Fade == 0) || (flags & FF_FADEWALLS))
|
|
|
|
{
|
|
|
|
return model->ColorMap;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// We must create a new colormap combining the properties we need
|
|
|
|
return GetSpecialLights(model->ColorMap->Color, target->ColorMap->Fade, model->ColorMap->Desaturate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PalEntry F3DFloor::GetBlend()
|
|
|
|
{
|
|
|
|
// The model sector's fog is used as blend unless FF_FADEWALLS is set.
|
|
|
|
if (!(flags & FF_FADEWALLS) && target->ColorMap->Fade != model->ColorMap->Fade)
|
|
|
|
{
|
|
|
|
return model->ColorMap->Fade;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void F3DFloor::UpdateColormap(FDynamicColormap *&map)
|
|
|
|
{
|
|
|
|
// If there's no fog in either model or target sector (or both have the same fog) this is easy and fast.
|
|
|
|
if ((target->ColorMap->Fade == 0 && model->ColorMap->Fade == 0) || (flags & FF_FADEWALLS) ||
|
|
|
|
target->ColorMap->Fade == model->ColorMap->Fade)
|
|
|
|
{
|
|
|
|
map = model->ColorMap;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// since rebuilding the map is not a cheap operation let's only do it if something really changed.
|
|
|
|
if (map->Color != model->ColorMap->Color || map->Fade != target->ColorMap->Fade ||
|
|
|
|
map->Desaturate != model->ColorMap->Desaturate)
|
|
|
|
{
|
|
|
|
map = GetSpecialLights(model->ColorMap->Color, target->ColorMap->Fade, model->ColorMap->Desaturate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Add one 3D floor to the sector
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2013-01-03 00:03:11 +00:00
|
|
|
static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flags, int alpha)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
F3DFloor* ffloor;
|
|
|
|
unsigned i;
|
2011-01-29 13:14:31 +00:00
|
|
|
|
|
|
|
if(!(flags & FF_THISINSIDE)) {
|
|
|
|
for(i = 0; i < sec2->e->XFloor.attached.Size(); i++) if(sec2->e->XFloor.attached[i] == sec) return;
|
|
|
|
sec2->e->XFloor.attached.Push(sec);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//Add the floor
|
|
|
|
ffloor = new F3DFloor;
|
|
|
|
ffloor->top.model = ffloor->bottom.model = ffloor->model = sec2;
|
|
|
|
ffloor->target = sec;
|
2011-01-29 13:14:31 +00:00
|
|
|
ffloor->ceilingclip = ffloor->floorclip = NULL;
|
2011-02-03 14:33:52 +00:00
|
|
|
ffloor->validcount = 0;
|
|
|
|
|
|
|
|
if (!(flags&FF_THINFLOOR))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
ffloor->bottom.plane = &sec2->floorplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
ffloor->bottom.texture = &sec2->planes[sector_t::floor].Texture;
|
|
|
|
ffloor->bottom.texheight = &sec2->planes[sector_t::floor].TexZ;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->bottom.isceiling = sector_t::floor;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ffloor->bottom.plane = &sec2->ceilingplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
ffloor->bottom.texture = &sec2->planes[sector_t::ceiling].Texture;
|
|
|
|
ffloor->bottom.texheight = &sec2->planes[sector_t::ceiling].TexZ;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->bottom.isceiling = sector_t::ceiling;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!(flags&FF_FIX))
|
|
|
|
{
|
|
|
|
ffloor->top.plane = &sec2->ceilingplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
ffloor->top.texture = &sec2->planes[sector_t::ceiling].Texture;
|
|
|
|
ffloor->top.texheight = &sec2->planes[sector_t::ceiling].TexZ;
|
2008-01-27 11:25:03 +00:00
|
|
|
ffloor->toplightlevel = &sec2->lightlevel;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->top.isceiling = sector_t::ceiling;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else // FF_FIX is a special case to patch rendering holes
|
|
|
|
{
|
|
|
|
ffloor->top.plane = &sec->floorplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
ffloor->top.texture = &sec2->planes[sector_t::floor].Texture;
|
|
|
|
ffloor->top.texheight = &sec2->planes[sector_t::floor].TexZ;
|
2008-01-27 11:25:03 +00:00
|
|
|
ffloor->toplightlevel = &sec->lightlevel;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->top.isceiling = sector_t::floor;
|
2008-01-27 11:25:03 +00:00
|
|
|
ffloor->top.model = sec;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hacks for Vavoom's idiotic implementation
|
|
|
|
if (flags&FF_INVERTSECTOR)
|
|
|
|
{
|
|
|
|
// switch the planes
|
|
|
|
F3DFloor::planeref sp = ffloor->top;
|
|
|
|
|
|
|
|
ffloor->top=ffloor->bottom;
|
|
|
|
ffloor->bottom=sp;
|
|
|
|
|
|
|
|
if (flags&FF_SWIMMABLE)
|
|
|
|
{
|
|
|
|
// Vavoom floods the lower part if it is swimmable.
|
|
|
|
// fortunately this plane won't be rendered - otherwise this wouldn't work...
|
|
|
|
ffloor->bottom.plane=&sec->floorplane;
|
|
|
|
ffloor->bottom.model=sec;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->bottom.isceiling = sector_t::floor;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ffloor->flags = flags;
|
|
|
|
ffloor->master = master;
|
2013-01-03 00:03:11 +00:00
|
|
|
ffloor->alpha = alpha;
|
2009-09-15 21:47:49 +00:00
|
|
|
ffloor->top.vindex = ffloor->bottom.vindex = -1;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// The engine cannot handle sloped translucent floors. Sorry
|
|
|
|
if (ffloor->top.plane->a || ffloor->top.plane->b || ffloor->bottom.plane->a || ffloor->bottom.plane->b)
|
|
|
|
{
|
|
|
|
ffloor->alpha = FRACUNIT;
|
2009-10-16 21:49:06 +00:00
|
|
|
ffloor->flags &= ~FF_ADDITIVETRANS;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2011-01-29 13:14:31 +00:00
|
|
|
if(flags & FF_THISINSIDE) {
|
|
|
|
// switch the planes
|
|
|
|
F3DFloor::planeref sp = ffloor->top;
|
|
|
|
ffloor->top=ffloor->bottom;
|
|
|
|
ffloor->bottom=sp;
|
|
|
|
}
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
sec->e->XFloor.ffloors.Push(ffloor);
|
2011-01-29 13:14:31 +00:00
|
|
|
|
|
|
|
// kg3D - software renderer only hack
|
|
|
|
// this is really required because of ceilingclip and floorclip
|
2013-01-03 00:03:11 +00:00
|
|
|
if((vid_renderer == 0) && (flags & FF_BOTHPLANES))
|
|
|
|
{
|
|
|
|
P_Add3DFloor(sec, sec2, master, FF_EXISTS | FF_THISINSIDE | FF_RENDERPLANES | FF_NOSHADE | FF_SEETHROUGH | FF_SHOOTTHROUGH |
|
|
|
|
(flags & (FF_INVERTSECTOR | FF_TRANSLUCENT | FF_ADDITIVETRANS)), alpha);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Creates all 3D floors defined by one linedef
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2013-01-03 00:03:11 +00:00
|
|
|
static int P_Set3DFloor(line_t * line, int param, int param2, int alpha)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int s,i;
|
|
|
|
int flags;
|
|
|
|
int tag=line->args[0];
|
|
|
|
sector_t * sec = line->frontsector, * ss;
|
|
|
|
|
|
|
|
for (s=-1; (s = P_FindSectorFromTag(tag,s)) >= 0;)
|
|
|
|
{
|
|
|
|
ss=§ors[s];
|
|
|
|
|
|
|
|
if (param==0)
|
|
|
|
{
|
|
|
|
flags=FF_EXISTS|FF_RENDERALL|FF_SOLID|FF_INVERTSECTOR;
|
|
|
|
for (i=0;i<sec->linecount;i++)
|
|
|
|
{
|
|
|
|
line_t * l=sec->lines[i];
|
|
|
|
|
|
|
|
alpha=255;
|
|
|
|
if (l->special==Sector_SetContents && l->frontsector==sec)
|
|
|
|
{
|
|
|
|
alpha=clamp<int>(l->args[1], 0, 100);
|
2009-01-03 13:00:40 +00:00
|
|
|
if (l->args[2] & 1) flags &= ~FF_SOLID;
|
|
|
|
if (l->args[2] & 2) flags |= FF_SEETHROUGH;
|
|
|
|
if (l->args[2] & 4) flags |= FF_SHOOTTHROUGH;
|
|
|
|
if (l->args[2] & 8) flags |= FF_ADDITIVETRANS;
|
2008-01-27 11:25:03 +00:00
|
|
|
if (alpha!=100) flags|=FF_TRANSLUCENT;//|FF_BOTHPLANES|FF_ALLSIDES;
|
|
|
|
if (l->args[0])
|
|
|
|
{
|
|
|
|
// Yes, Vavoom's 3D-floor definitions suck!
|
2009-09-15 06:19:39 +00:00
|
|
|
// The content list changed in r1783 of Vavoom to be unified
|
|
|
|
// among all its supported games, so it has now ten different
|
|
|
|
// values instead of just five.
|
|
|
|
static DWORD vavoomcolors[]={VC_EMPTY,
|
|
|
|
VC_WATER, VC_LAVA, VC_NUKAGE, VC_SLIME, VC_HELLSLIME,
|
|
|
|
VC_BLOOD, VC_SLUDGE, VC_HAZARD, VC_BOOMWATER};
|
2009-01-03 13:00:40 +00:00
|
|
|
flags|=FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_FLOOD;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-09-15 06:19:39 +00:00
|
|
|
l->frontsector->ColorMap =
|
|
|
|
GetSpecialLights (l->frontsector->ColorMap->Color,
|
2009-09-15 22:09:18 +00:00
|
|
|
(unsigned int)(vavoomcolors[l->args[0]]&VC_COLORMASK),
|
|
|
|
(unsigned int)(vavoomcolors[l->args[0]]&VC_ALPHAMASK)>>24);
|
2009-09-15 06:19:39 +00:00
|
|
|
// l->frontsector->ColorMap->Desaturate);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
alpha=(alpha*255)/100;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (param==4)
|
|
|
|
{
|
2009-01-03 13:00:40 +00:00
|
|
|
flags=FF_EXISTS|FF_RENDERPLANES|FF_INVERTPLANES|FF_NOSHADE|FF_FIX;
|
2008-01-27 11:25:03 +00:00
|
|
|
alpha=255;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static const int defflags[]= {0,
|
|
|
|
FF_SOLID,
|
2009-01-03 13:00:40 +00:00
|
|
|
FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_SHOOTTHROUGH|FF_SEETHROUGH,
|
|
|
|
FF_SHOOTTHROUGH|FF_SEETHROUGH,
|
|
|
|
};
|
|
|
|
|
|
|
|
flags = defflags[param&3] | FF_EXISTS|FF_RENDERALL;
|
|
|
|
|
|
|
|
if (param&4) flags |= FF_ALLSIDES|FF_BOTHPLANES;
|
|
|
|
if (param&16) flags ^= FF_SEETHROUGH;
|
|
|
|
if (param&32) flags ^= FF_SHOOTTHROUGH;
|
|
|
|
|
|
|
|
if (param2&1) flags |= FF_NOSHADE;
|
|
|
|
if (param2&2) flags |= FF_DOUBLESHADOW;
|
|
|
|
if (param2&4) flags |= FF_FOG;
|
|
|
|
if (param2&8) flags |= FF_THINFLOOR;
|
|
|
|
if (param2&16) flags |= FF_UPPERTEXTURE;
|
|
|
|
if (param2&32) flags |= FF_LOWERTEXTURE;
|
|
|
|
if (param2&64) flags |= FF_ADDITIVETRANS|FF_TRANSLUCENT;
|
|
|
|
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
|
|
|
|
if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH;
|
|
|
|
if (param2&512) flags |= FF_FADEWALLS;
|
2009-09-06 21:11:24 +00:00
|
|
|
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
if (!tex.Exists() && alpha<255)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
alpha=clamp(-tex.GetIndex(), 0, 255);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
if (alpha==0) flags&=~(FF_RENDERALL|FF_BOTHPLANES|FF_ALLSIDES);
|
|
|
|
else if (alpha!=255) flags|=FF_TRANSLUCENT;
|
|
|
|
|
|
|
|
}
|
|
|
|
P_Add3DFloor(ss, sec, line, flags, alpha);
|
|
|
|
}
|
|
|
|
// To be 100% safe this should be done even if the alpha by texture value isn't used.
|
2009-09-06 21:11:24 +00:00
|
|
|
if (!line->sidedef[0]->GetTexture(side_t::top).isValid())
|
|
|
|
line->sidedef[0]->SetTexture(side_t::top, FNullTextureID());
|
2008-01-27 11:25:03 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// P_PlayerOnSpecial3DFloor
|
|
|
|
// Checks to see if a player is standing on or is inside a 3D floor (water)
|
|
|
|
// and applies any specials..
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void P_PlayerOnSpecial3DFloor(player_t* player)
|
|
|
|
{
|
|
|
|
sector_t * sector = player->mo->Sector;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
for(unsigned i=0;i<sector->e->XFloor.ffloors.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
F3DFloor* rover=sector->e->XFloor.ffloors[i];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
|
|
|
if (rover->flags & FF_FIX) continue;
|
|
|
|
|
|
|
|
// Check the 3D floor's type...
|
|
|
|
if(rover->flags & FF_SOLID)
|
|
|
|
{
|
|
|
|
// Player must be on top of the floor to be affected...
|
|
|
|
if(player->mo->z != rover->top.plane->ZatPoint(player->mo->x, player->mo->y)) continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Water and DEATH FOG!!! heh
|
|
|
|
if (player->mo->z > rover->top.plane->ZatPoint(player->mo->x, player->mo->y) ||
|
|
|
|
(player->mo->z + player->mo->height) < rover->bottom.plane->ZatPoint(player->mo->x, player->mo->y))
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rover->model->special || rover->model->damage) P_PlayerInSpecialSector(player, rover->model);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// P_CheckFor3DFloorHit
|
|
|
|
// Checks whether the player's feet touch a solid 3D floor in the sector
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
bool P_CheckFor3DFloorHit(AActor * mo)
|
|
|
|
{
|
|
|
|
sector_t * sector = mo->Sector;
|
|
|
|
|
|
|
|
if ((mo->player && (mo->player->cheats & CF_PREDICTING))) return false;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
for(unsigned i=0;i<sector->e->XFloor.ffloors.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
F3DFloor* rover=sector->e->XFloor.ffloors[i];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
|
|
|
|
|
|
|
if(rover->flags & FF_SOLID && rover->model->SecActTarget)
|
|
|
|
{
|
2012-03-20 16:32:50 +00:00
|
|
|
if(mo->floorz == rover->top.plane->ZatPoint(mo->x, mo->y))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
rover->model->SecActTarget->TriggerAction (mo, SECSPAC_HitFloor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// P_CheckFor3DCeilingHit
|
|
|
|
// Checks whether the player's head touches a solid 3D floor in the sector
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
bool P_CheckFor3DCeilingHit(AActor * mo)
|
|
|
|
{
|
|
|
|
sector_t * sector = mo->Sector;
|
|
|
|
|
|
|
|
if ((mo->player && (mo->player->cheats & CF_PREDICTING))) return false;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
for(unsigned i=0;i<sector->e->XFloor.ffloors.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
F3DFloor* rover=sector->e->XFloor.ffloors[i];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
|
|
|
|
|
|
|
if(rover->flags & FF_SOLID && rover->model->SecActTarget)
|
|
|
|
{
|
2012-03-20 16:32:50 +00:00
|
|
|
if(mo->ceilingz == rover->bottom.plane->ZatPoint(mo->x, mo->y))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
rover->model->SecActTarget->TriggerAction (mo, SECSPAC_HitCeiling);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// P_Recalculate3DFloors
|
|
|
|
//
|
|
|
|
// This function sorts the ffloors by height and creates the lightlists
|
|
|
|
// that the given sector uses to light floors/ceilings/walls according to the 3D floors.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void P_Recalculate3DFloors(sector_t * sector)
|
|
|
|
{
|
|
|
|
F3DFloor * rover;
|
|
|
|
F3DFloor * pick;
|
|
|
|
unsigned pickindex;
|
|
|
|
F3DFloor * clipped=NULL;
|
|
|
|
fixed_t clipped_top;
|
2008-01-27 23:11:51 +00:00
|
|
|
fixed_t clipped_bottom=0;
|
2008-01-27 11:25:03 +00:00
|
|
|
fixed_t maxheight, minheight;
|
|
|
|
unsigned i, j;
|
|
|
|
lightlist_t newlight;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
TArray<F3DFloor*> & ffloors=sector->e->XFloor.ffloors;
|
|
|
|
TArray<lightlist_t> & lightlist = sector->e->XFloor.lightlist;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Sort the floors top to bottom for quicker access here and later
|
|
|
|
// Translucent and swimmable floors are split if they overlap with solid ones.
|
|
|
|
if (ffloors.Size()>1)
|
|
|
|
{
|
|
|
|
TArray<F3DFloor*> oldlist;
|
|
|
|
|
|
|
|
oldlist = ffloors;
|
|
|
|
ffloors.Clear();
|
|
|
|
|
|
|
|
// first delete the old dynamic stuff
|
|
|
|
for(i=0;i<oldlist.Size();i++)
|
|
|
|
{
|
|
|
|
F3DFloor * rover=oldlist[i];
|
|
|
|
|
|
|
|
if (rover->flags&FF_DYNAMIC)
|
|
|
|
{
|
|
|
|
delete rover;
|
|
|
|
oldlist.Delete(i);
|
|
|
|
i--;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (rover->flags&FF_CLIPPED)
|
|
|
|
{
|
|
|
|
rover->flags&=~FF_CLIPPED;
|
|
|
|
rover->flags|=FF_EXISTS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
while (oldlist.Size())
|
|
|
|
{
|
|
|
|
pick=oldlist[0];
|
|
|
|
fixed_t height=pick->top.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
|
|
|
|
// find highest starting ffloor - intersections are not supported!
|
|
|
|
pickindex=0;
|
|
|
|
for (j=1;j<oldlist.Size();j++)
|
|
|
|
{
|
|
|
|
fixed_t h2=oldlist[j]->top.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
|
|
|
|
if (h2>height)
|
|
|
|
{
|
|
|
|
pick=oldlist[j];
|
|
|
|
pickindex=j;
|
|
|
|
height=h2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
oldlist.Delete(pickindex);
|
|
|
|
|
2011-02-13 20:26:04 +00:00
|
|
|
if (pick->flags & FF_THISINSIDE)
|
|
|
|
{
|
|
|
|
// These have the floor higher than the ceiling and cannot be processed
|
|
|
|
// by the clipping code below.
|
|
|
|
ffloors.Push(pick);
|
|
|
|
}
|
|
|
|
else if (pick->flags&(FF_SWIMMABLE|FF_TRANSLUCENT) && pick->flags&FF_EXISTS)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
clipped=pick;
|
|
|
|
clipped_top=height;
|
|
|
|
clipped_bottom=pick->bottom.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
ffloors.Push(pick);
|
|
|
|
}
|
|
|
|
else if (clipped && clipped_bottom<height)
|
|
|
|
{
|
|
|
|
// translucent floor above must be clipped to this one!
|
|
|
|
F3DFloor * dyn=new F3DFloor;
|
|
|
|
*dyn=*clipped;
|
|
|
|
clipped->flags|=FF_CLIPPED;
|
|
|
|
clipped->flags&=~FF_EXISTS;
|
|
|
|
dyn->flags|=FF_DYNAMIC;
|
|
|
|
dyn->bottom=pick->top;
|
|
|
|
ffloors.Push(dyn);
|
|
|
|
ffloors.Push(pick);
|
|
|
|
|
|
|
|
fixed_t pick_bottom=pick->bottom.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
|
|
|
|
if (pick_bottom<=clipped_bottom)
|
|
|
|
{
|
|
|
|
clipped=NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// the translucent part extends below the clipper
|
|
|
|
dyn=new F3DFloor;
|
|
|
|
*dyn=*clipped;
|
|
|
|
dyn->flags|=FF_DYNAMIC|FF_EXISTS;
|
|
|
|
dyn->top=pick->bottom;
|
|
|
|
ffloors.Push(dyn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
clipped=NULL;
|
|
|
|
ffloors.Push(pick);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// having the floors sorted makes this routine significantly simpler
|
|
|
|
// Only some overlapping cases with FF_DOUBLESHADOW might create anomalies
|
|
|
|
// but these are clearly undefined.
|
|
|
|
if(ffloors.Size())
|
|
|
|
{
|
|
|
|
lightlist.Resize(1);
|
|
|
|
lightlist[0].plane = sector->ceilingplane;
|
|
|
|
lightlist[0].p_lightlevel = §or->lightlevel;
|
|
|
|
lightlist[0].caster = NULL;
|
2011-01-29 13:14:31 +00:00
|
|
|
lightlist[0].lightsource = NULL;
|
|
|
|
lightlist[0].extra_colormap = sector->ColorMap;
|
|
|
|
lightlist[0].blend = 0;
|
2008-01-27 11:25:03 +00:00
|
|
|
lightlist[0].flags = 0;
|
|
|
|
|
|
|
|
maxheight = sector->CenterCeiling();
|
|
|
|
minheight = sector->CenterFloor();
|
|
|
|
for(i = 0; i < ffloors.Size(); i++)
|
|
|
|
{
|
|
|
|
rover=ffloors[i];
|
|
|
|
|
|
|
|
if ( !(rover->flags & FF_EXISTS) || rover->flags & FF_NOSHADE )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
fixed_t ff_top=rover->top.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
if (ff_top < minheight) break; // reached the floor
|
|
|
|
if (ff_top < maxheight)
|
|
|
|
{
|
|
|
|
newlight.plane = *rover->top.plane;
|
|
|
|
newlight.p_lightlevel = rover->toplightlevel;
|
|
|
|
newlight.caster = rover;
|
2011-01-29 13:14:31 +00:00
|
|
|
newlight.lightsource = rover;
|
|
|
|
newlight.extra_colormap = rover->GetColormap();
|
|
|
|
newlight.blend = rover->GetBlend();
|
2008-01-27 11:25:03 +00:00
|
|
|
newlight.flags = rover->flags;
|
|
|
|
lightlist.Push(newlight);
|
|
|
|
}
|
|
|
|
else if (i==0)
|
|
|
|
{
|
|
|
|
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
if (ff_bottom<maxheight)
|
|
|
|
{
|
|
|
|
// this segment begins over the ceiling and extends beyond it
|
|
|
|
lightlist[0].p_lightlevel = rover->toplightlevel;
|
|
|
|
lightlist[0].caster = rover;
|
2011-01-29 13:14:31 +00:00
|
|
|
lightlist[0].lightsource = rover;
|
|
|
|
lightlist[0].extra_colormap = rover->GetColormap();
|
|
|
|
lightlist[0].blend = rover->GetBlend();
|
2008-01-27 11:25:03 +00:00
|
|
|
lightlist[0].flags = rover->flags;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (rover->flags&FF_DOUBLESHADOW)
|
|
|
|
{
|
|
|
|
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
|
|
|
if(ff_bottom < maxheight && ff_bottom>minheight)
|
|
|
|
{
|
|
|
|
newlight.caster = rover;
|
|
|
|
newlight.plane = *rover->bottom.plane;
|
|
|
|
if (lightlist.Size()>1)
|
|
|
|
{
|
2011-01-29 13:14:31 +00:00
|
|
|
newlight.lightsource = lightlist[lightlist.Size()-2].lightsource;
|
2008-01-27 11:25:03 +00:00
|
|
|
newlight.p_lightlevel = lightlist[lightlist.Size()-2].p_lightlevel;
|
2011-01-29 13:14:31 +00:00
|
|
|
newlight.extra_colormap = lightlist[lightlist.Size()-2].extra_colormap;
|
|
|
|
newlight.blend = lightlist[lightlist.Size()-2].blend;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-29 13:14:31 +00:00
|
|
|
newlight.lightsource = NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
newlight.p_lightlevel = §or->lightlevel;
|
2011-01-29 13:14:31 +00:00
|
|
|
newlight.extra_colormap = sector->ColorMap;
|
|
|
|
newlight.blend = 0;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
newlight.flags = rover->flags;
|
|
|
|
lightlist.Push(newlight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-29 13:14:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// recalculates 3D floors for all attached sectors
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
void P_RecalculateAttached3DFloors(sector_t * sec)
|
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
extsector_t::xfloor &x = sec->e->XFloor;
|
|
|
|
|
|
|
|
for(unsigned int i=0; i<x.attached.Size(); i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
P_Recalculate3DFloors(x.attached[i]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
P_Recalculate3DFloors(sec);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2011-01-29 13:14:31 +00:00
|
|
|
// recalculates light lists for this sector
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
2011-01-29 13:14:31 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void P_RecalculateLights(sector_t *sector)
|
|
|
|
{
|
|
|
|
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
|
|
|
|
|
|
|
|
for(unsigned i = 0; i < lightlist.Size(); i++)
|
|
|
|
{
|
|
|
|
lightlist_t *ll = &lightlist[i];
|
|
|
|
if (ll->lightsource != NULL)
|
|
|
|
{
|
|
|
|
ll->lightsource->UpdateColormap(ll->extra_colormap);
|
|
|
|
ll->blend = ll->lightsource->GetBlend();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ll->extra_colormap = sector->ColorMap;
|
|
|
|
ll->blend = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// recalculates light lists for all attached sectors
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2011-01-29 13:14:31 +00:00
|
|
|
|
|
|
|
void P_RecalculateAttachedLights(sector_t *sector)
|
|
|
|
{
|
|
|
|
extsector_t::xfloor &x = sector->e->XFloor;
|
|
|
|
|
|
|
|
for(unsigned int i=0; i<x.attached.Size(); i++)
|
|
|
|
{
|
|
|
|
P_RecalculateLights(x.attached[i]);
|
|
|
|
}
|
|
|
|
P_RecalculateLights(sector);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
lightlist_t * P_GetPlaneLight(sector_t * sector, secplane_t * plane, bool underside)
|
|
|
|
{
|
|
|
|
unsigned i;
|
2008-03-19 11:19:03 +00:00
|
|
|
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
fixed_t planeheight=plane->ZatPoint(CenterSpot(sector));
|
|
|
|
if(underside) planeheight--;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
for(i = 1; i < lightlist.Size(); i++)
|
|
|
|
if (lightlist[i].plane.ZatPoint(CenterSpot(sector)) <= planeheight)
|
|
|
|
return &lightlist[i - 1];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
return &lightlist[lightlist.Size() - 1];
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Extended P_LineOpening
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *linedef,
|
2012-04-14 07:39:28 +00:00
|
|
|
fixed_t x, fixed_t y, fixed_t refx, fixed_t refy, bool restrict)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(thing)
|
|
|
|
{
|
|
|
|
fixed_t thingbot, thingtop;
|
|
|
|
|
|
|
|
thingbot = thing->z;
|
2009-01-18 09:42:37 +00:00
|
|
|
thingtop = thingbot + (thing->height==0? 1:thing->height);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
extsector_t::xfloor *xf[2] = {&linedef->frontsector->e->XFloor, &linedef->backsector->e->XFloor};
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Check for 3D-floors in the sector (mostly identical to what Legacy does here)
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
if(xf[0]->ffloors.Size() || xf[1]->ffloors.Size())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
fixed_t lowestceiling = open.top;
|
|
|
|
fixed_t highestfloor = open.bottom;
|
2008-06-02 17:20:22 +00:00
|
|
|
fixed_t lowestfloor[2] = {
|
|
|
|
linedef->frontsector->floorplane.ZatPoint(x, y),
|
|
|
|
linedef->backsector->floorplane.ZatPoint(x, y) };
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID highestfloorpic;
|
|
|
|
FTextureID lowestceilingpic;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
highestfloorpic.SetInvalid();
|
|
|
|
lowestceilingpic.SetInvalid();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
for(int j=0;j<2;j++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
for(unsigned i=0;i<xf[j]->ffloors.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
F3DFloor *rover = xf[j]->ffloors[i];
|
|
|
|
|
2009-01-18 09:42:37 +00:00
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
if (!(rover->flags & FF_SOLID)) continue;
|
|
|
|
|
|
|
|
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(x, y);
|
|
|
|
fixed_t ff_top=rover->top.plane->ZatPoint(x, y);
|
|
|
|
|
|
|
|
fixed_t delta1 = abs(thingbot - ((ff_bottom + ff_top) / 2));
|
|
|
|
fixed_t delta2 = abs(thingtop - ((ff_bottom + ff_top) / 2));
|
|
|
|
|
|
|
|
if(ff_bottom < lowestceiling && delta1 >= delta2)
|
|
|
|
{
|
|
|
|
lowestceiling = ff_bottom;
|
|
|
|
lowestceilingpic = *rover->bottom.texture;
|
|
|
|
}
|
|
|
|
|
2012-04-14 07:39:28 +00:00
|
|
|
if(ff_top > highestfloor && delta1 < delta2 && (!restrict || thing->z >= ff_top))
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
{
|
|
|
|
highestfloor = ff_top;
|
|
|
|
highestfloorpic = *rover->top.texture;
|
|
|
|
}
|
2009-01-13 19:55:48 +00:00
|
|
|
if(ff_top > lowestfloor[j] && ff_top <= thing->z + thing->MaxStepHeight) lowestfloor[j] = ff_top;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
if(highestfloor > open.bottom)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
open.bottom = highestfloor;
|
|
|
|
open.floorpic = highestfloorpic;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
if(lowestceiling < open.top)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-19 11:19:03 +00:00
|
|
|
open.top = lowestceiling;
|
|
|
|
open.ceilingpic = lowestceilingpic;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures
didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'.
Update to ZDoom r940:
SBarInfo Update #18:
- Simplified the DrawGraphic function in sbarinfo_display.cpp
- Added xOffset, yOffset, and alpha to every drawing function in
sbarinfo_display.cpp. So Strife popups can be handeled better and allow for
other effects (translucent bars?). I'm thinking about making a struct for
these five (also x and y) arguments so that the argument lists don't become a
mess.
- Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to
DrawGraphic.
- DrawKeyBar wasn't using screen->DrawTexture.
- Added a Fade transition for popups. It takes two args fade in rate and fade
out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete
and so on).
- Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible.
- Fixed: When an instrument's envelope runs out, it does not immediately ramp
to zero. Rather, it lets the remainder of the sample finish playing.
- Fixed: When playing a MIDI file with EMIDI track designations to turn a
track off, any ticks that had only events on the disabled track would cause
the delay for that track to be thrown away, and the following notes on
enabled tracks would play too soon. This could be heard quite clearly in
xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing
of tracks 13 and 14 (EP1 Melody and EP1 Echo).
- Fixed: DFlashFader did some operations in its destructor that had to be moved
to its Destroy method.
- Fixed: Dropped weapons from dying players should not double ammo.
- Fixed: When note_on() is called and another copy of the same note is
already playing on the channel, it should stop it with finish_note(), not
kill_note(). This can be clearly heard in the final cymbal crashes of
D_DM2TTL where TiMidity cuts them off because the final cymbals are played
with a velocity of 1 before the preceding cymbals have finished. (I wonder
if I should be setting the self_nonexclusive flag for GUS patches to
disable even this behavior, though, since gf1note.c doesn't turn off
duplicate notes.)
- Changed envelope handling to hopefully match the GUS player's. The most
egregious mistake TiMidity makes is to treat bit 6 as an envelope enable
bit. This is not what it does; every sample has an envelope. Rather, this
is a "no sampled release" flag. Also, despite fiddling with the
PATCH_SUSTAIN flag during instrument loading, TiMidity never actually
used it. Nor did it do anything at all with the PATCH_FAST_REL flag.
- Fixed: wbstartstruct's lump name fields were only 8 characters long
and not properly zero-terminated when all 8 characters were used.
- Fixed: Local sound sequence definitions caused a crash because a proper
NULL check was missing.
- Added translucent blending modes to FMultipatchTexture (not tested yet!)
- Also changed all true color texture creation functions to use proper alpha
values instead of inverted ones.
- Changed FRemapTable so that all palette entries must contain proper alpha
values.
- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check.
- Changed: The boss brain's explosions play weapons/rocklx which is an
unlimited sound. This can become extremely loud. Replaced with a new
sound which is just an alias to weapons/rocklx but has a limit of 4.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
|
|
|
open.lowfloor = MIN(lowestfloor[0], lowestfloor[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2009-01-03 15:46:14 +00:00
|
|
|
// Spawns 3D floors
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2009-01-03 15:46:14 +00:00
|
|
|
void P_Spawn3DFloors (void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-01-03 13:00:40 +00:00
|
|
|
static int flagvals[] = {128+512, 2+512, 512};
|
2008-01-27 11:25:03 +00:00
|
|
|
int i;
|
|
|
|
line_t * line;
|
|
|
|
|
|
|
|
for (i=0,line=lines;i<numlines;i++,line++)
|
|
|
|
{
|
|
|
|
switch(line->special)
|
|
|
|
{
|
|
|
|
case ExtraFloor_LightOnly:
|
|
|
|
// Note: I am spawning both this and ZDoom's ExtraLight data
|
|
|
|
// I don't want to mess with both at the same time during rendering
|
|
|
|
// so inserting this into the 3D-floor table as well seemed to be
|
|
|
|
// the best option.
|
|
|
|
//
|
|
|
|
// This does not yet handle case 0 properly!
|
2009-01-03 13:00:40 +00:00
|
|
|
if (line->args[1] < 0 || line->args[1] > 2) line->args[1] = 0;
|
|
|
|
P_Set3DFloor(line, 3, flagvals[line->args[1]], 0);
|
2008-01-27 11:25:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case Sector_Set3DFloor:
|
2011-01-29 13:14:31 +00:00
|
|
|
// The flag high-byte/line id is only needed in Hexen format.
|
|
|
|
// UDMF can set both of these parameters without any restriction of the usable values.
|
|
|
|
// In Doom format the translators can take full integers for the tag and the line ID always is the same as the tag.
|
|
|
|
if (level.maptype == MAPTYPE_HEXEN)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2011-01-29 13:14:31 +00:00
|
|
|
if (line->args[1]&8)
|
|
|
|
{
|
|
|
|
line->id = line->args[4];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
line->args[0]+=256*line->args[4];
|
|
|
|
line->args[4]=0;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
P_Set3DFloor(line, line->args[1]&~8, line->args[2], line->args[3]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
line->special=0;
|
2009-01-03 13:00:40 +00:00
|
|
|
line->args[0] = line->args[1] = line->args[2] = line->args[3] = line->args[4] = 0;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2011-01-29 13:14:31 +00:00
|
|
|
// kg3D - do it in software
|
|
|
|
for (i = 0; i < numsectors; i++)
|
|
|
|
{
|
|
|
|
P_Recalculate3DFloors(§ors[i]);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-11 20:06:29 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Returns a 3D floorplane appropriate for the given coordinates
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
secplane_t P_FindFloorPlane(sector_t * sector, fixed_t x, fixed_t y, fixed_t z)
|
|
|
|
{
|
|
|
|
secplane_t retplane = sector->floorplane;
|
|
|
|
if (sector->e) // apparently this can be called when the data is already gone
|
|
|
|
{
|
|
|
|
for(unsigned int i=0;i<sector->e->XFloor.ffloors.Size();i++)
|
|
|
|
{
|
|
|
|
F3DFloor * rover= sector->e->XFloor.ffloors[i];
|
|
|
|
if(!(rover->flags & FF_SOLID) || !(rover->flags & FF_EXISTS)) continue;
|
|
|
|
|
|
|
|
if (rover->top.plane->ZatPoint(x, y) == z)
|
|
|
|
{
|
|
|
|
retplane = *rover->top.plane;
|
|
|
|
if (retplane.c<0) retplane.FlipVert();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return retplane;
|
|
|
|
}
|
|
|
|
|
2010-12-31 10:53:52 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Gives the index to an extra floor above or below the given location.
|
|
|
|
// -1 means normal floor or ceiling
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
int P_Find3DFloor(sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool above, bool floor, fixed_t &cmpz)
|
|
|
|
{
|
|
|
|
// If no sector given, find the one appropriate
|
|
|
|
if (sec == NULL)
|
|
|
|
sec = R_PointInSubsector(x, y)->sector;
|
|
|
|
|
|
|
|
// Above normal ceiling
|
|
|
|
cmpz = sec->ceilingplane.ZatPoint(x, y);
|
|
|
|
if (z >= cmpz)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
// Below normal floor
|
|
|
|
cmpz = sec->floorplane.ZatPoint(x, y);
|
|
|
|
if (z <= cmpz)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
// Looking through planes from top to bottom
|
|
|
|
for (int i = 0; i < (signed)sec->e->XFloor.ffloors.Size(); ++i)
|
|
|
|
{
|
|
|
|
F3DFloor *rover = sec->e->XFloor.ffloors[i];
|
|
|
|
|
|
|
|
// We are only interested in solid 3D floors here
|
|
|
|
if(!(rover->flags & FF_SOLID) || !(rover->flags & FF_EXISTS)) continue;
|
|
|
|
|
|
|
|
if (above)
|
|
|
|
{
|
|
|
|
// z is above that floor
|
|
|
|
if (floor && (z >= (cmpz = rover->top.plane->ZatPoint(x, y))))
|
|
|
|
return i - 1;
|
|
|
|
// z is above that ceiling
|
|
|
|
if (z >= (cmpz = rover->bottom.plane->ZatPoint(x, y)))
|
|
|
|
return i - 1;
|
|
|
|
}
|
|
|
|
else // below
|
|
|
|
{
|
|
|
|
// z is below that ceiling
|
|
|
|
if (!floor && (z <= (cmpz = rover->bottom.plane->ZatPoint(x, y))))
|
|
|
|
return i;
|
|
|
|
// z is below that floor
|
|
|
|
if (z <= (cmpz = rover->top.plane->ZatPoint(x, y)))
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Failsafe
|
|
|
|
return -1;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2011-02-03 14:33:52 +00:00
|
|
|
#endif
|