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 "v_palette.h"
|
|
|
|
#include "g_level.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
#include "gl/gl_lights.h"
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// 3D Floors
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Add one 3D floor to the sector
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flags,int transluc)
|
|
|
|
{
|
|
|
|
F3DFloor* ffloor;
|
|
|
|
unsigned i;
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
if (!(flags&FF_THINFLOOR))
|
|
|
|
{
|
|
|
|
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;
|
2008-01-27 11:25:03 +00:00
|
|
|
ffloor->bottom.isceiling = false;
|
|
|
|
}
|
|
|
|
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;
|
2008-01-27 11:25:03 +00:00
|
|
|
ffloor->bottom.isceiling = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
ffloor->top.isceiling = true;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
ffloor->top.isceiling = false;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ffloor->flags = flags;
|
|
|
|
ffloor->master = master;
|
|
|
|
ffloor->alpha = transluc;
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2008-03-19 11:19:03 +00:00
|
|
|
sec->e->XFloor.ffloors.Push(ffloor);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Creates all 3D floors defined by one linedef
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
static int P_Set3DFloor(line_t * line, int param,int param2, int alpha)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
if (l->args[2]&1) flags&=~FF_SOLID;
|
|
|
|
if (alpha!=100) flags|=FF_TRANSLUCENT;//|FF_BOTHPLANES|FF_ALLSIDES;
|
|
|
|
if (l->args[0])
|
|
|
|
{
|
|
|
|
// Yes, Vavoom's 3D-floor definitions suck!
|
|
|
|
static DWORD vavoomcolors[]={
|
|
|
|
0, 0x101080, 0x801010, 0x108010, 0x287020, 0xf0f010};
|
|
|
|
flags|=FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES;
|
|
|
|
|
|
|
|
l->frontsector->ColorMap = GetSpecialLights (l->frontsector->ColorMap->Color,
|
|
|
|
vavoomcolors[l->args[0]],
|
|
|
|
l->frontsector->ColorMap->Desaturate);
|
|
|
|
}
|
|
|
|
alpha=(alpha*255)/100;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (param==4)
|
|
|
|
{
|
|
|
|
flags=FF_EXISTS|FF_RENDERPLANES|FF_INVERTPLANES|FF_NOSHADE|FF_FIX|FF_NOSHADE;
|
|
|
|
alpha=255;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static const int defflags[]= {0,
|
|
|
|
FF_SOLID,
|
|
|
|
FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES,
|
|
|
|
0, 0,
|
|
|
|
FF_SOLID|FF_BOTHPLANES|FF_ALLSIDES,
|
|
|
|
FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES,
|
|
|
|
FF_BOTHPLANES|FF_ALLSIDES};
|
|
|
|
|
|
|
|
flags = defflags[param&7] | FF_EXISTS|FF_RENDERALL;
|
|
|
|
|
|
|
|
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 (param2&512) flags|=FF_FADEWALLS;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID tex = sides[line->sidenum[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.
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sides[line->sidenum[0]].GetTexture(side_t::top).isValid())
|
|
|
|
sides[line->sidenum[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)
|
|
|
|
{
|
|
|
|
if(mo->z == rover->top.plane->ZatPoint(mo->x, mo->y))
|
|
|
|
{
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
if(mo->z+mo->height == rover->bottom.plane->ZatPoint(mo->x, mo->y))
|
|
|
|
{
|
|
|
|
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.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
#define CenterSpot(sec) (vertex_t*)&(sec)->soundorg[0]
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (pick->flags&(FF_SWIMMABLE|FF_TRANSLUCENT) && pick->flags&FF_EXISTS)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
lightlist[0].p_extra_colormap = §or->ColorMap;
|
|
|
|
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;
|
|
|
|
newlight.p_extra_colormap=&rover->model->ColorMap;
|
|
|
|
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;
|
|
|
|
lightlist[0].p_extra_colormap=&rover->model->ColorMap;
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
newlight.p_lightlevel = lightlist[lightlist.Size()-2].p_lightlevel;
|
|
|
|
newlight.p_extra_colormap = lightlist[lightlist.Size()-2].p_extra_colormap;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
newlight.p_lightlevel = §or->lightlevel;
|
|
|
|
newlight.p_extra_colormap = §or->ColorMap;
|
|
|
|
}
|
|
|
|
newlight.flags = rover->flags;
|
|
|
|
lightlist.Push(newlight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
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,
|
|
|
|
fixed_t x, fixed_t y, fixed_t refx, fixed_t refy)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(thing)
|
|
|
|
{
|
|
|
|
fixed_t thingbot, thingtop;
|
|
|
|
|
|
|
|
thingbot = thing->z;
|
|
|
|
thingtop = thingbot + thing->height;
|
|
|
|
|
- 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
|
|
|
thingtop = thing->z + (thing->height==0? 1:thing->height);
|
|
|
|
|
- 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
|
|
|
// Check for frontsector's 3D-floors
|
|
|
|
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];
|
|
|
|
|
|
|
|
if (!(rover->flags&FF_EXISTS)) continue;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ff_top > highestfloor && delta1 < delta2)
|
|
|
|
{
|
|
|
|
highestfloor = ff_top;
|
|
|
|
highestfloorpic = *rover->top.texture;
|
|
|
|
}
|
|
|
|
if(ff_top > lowestfloor[j] && ff_top <= thing->z) 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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Spawns non-ZDoom specials
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
void P_SpawnSpecials2 (void)
|
|
|
|
{
|
|
|
|
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!
|
|
|
|
P_Set3DFloor(line, 3, line->args[1]&1? 514:512, 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Sector_Set3DFloor:
|
|
|
|
if (line->args[1]&8)
|
|
|
|
{
|
|
|
|
line->id = line->args[4];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
line->args[0]+=256*line->args[4];
|
|
|
|
line->args[4]=0;
|
|
|
|
}
|
|
|
|
P_Set3DFloor(line, line->args[1]&~8, line->args[2], line->args[3]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
line->special=0;
|
|
|
|
line->args[0] = line->args[1] = line->args[2] = line->args[3] = line->args[4]==0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Also do some tweaks to the spawned actors
|
|
|
|
//
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
|
2008-06-02 17:20:22 +00:00
|
|
|
while ((mo=it.Next()))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Don't count monsters in end-of-level sectors
|
|
|
|
// In 99.9% of all occurences they are part of a trap
|
|
|
|
// and not supposed to be killed.
|
|
|
|
if (mo->flags & MF_COUNTKILL)
|
|
|
|
{
|
|
|
|
if (mo->Sector->special == dDamage_End)
|
|
|
|
{
|
|
|
|
level.total_monsters--;
|
|
|
|
mo->flags&=~(MF_COUNTKILL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|