2008-01-27 11:25:03 +00:00
|
|
|
|
/*
|
|
|
|
|
** gl_portal.cpp
|
|
|
|
|
** Generalized portal maintenance classes for skyboxes, horizons etc.
|
|
|
|
|
** Requires a stencil buffer!
|
|
|
|
|
**
|
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
|
** Copyright 2004-2005 Christoph Oelckers
|
|
|
|
|
** 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.
|
|
|
|
|
** 4. When not used as part of GZDoom or a GZDoom derivative, this code will be
|
|
|
|
|
** covered by the terms of the GNU Lesser General Public License as published
|
|
|
|
|
** by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
|
** your option) any later version.
|
- 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
|
|
|
|
** 5. 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.
|
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
2008-03-21 21:15:56 +00:00
|
|
|
|
#include "gl/gl_include.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
#include "p_local.h"
|
|
|
|
|
#include "vectors.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
|
#include "doomstat.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
#include "gl/gl_struct.h"
|
|
|
|
|
#include "gl/gl_portal.h"
|
|
|
|
|
#include "gl/gl_clipper.h"
|
|
|
|
|
#include "gl/gl_glow.h"
|
|
|
|
|
#include "gl/gl_texture.h"
|
|
|
|
|
#include "gl/gl_functions.h"
|
|
|
|
|
#include "gl/gl_intern.h"
|
|
|
|
|
#include "gl/gl_basic.h"
|
|
|
|
|
#include "gl/gl_data.h"
|
|
|
|
|
#include "gl/gl_geometric.h"
|
2008-11-03 18:33:40 +00:00
|
|
|
|
#include "gl/gl_shader.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// General portal handling code
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2008-10-19 22:24:34 +00:00
|
|
|
|
CVAR(Bool, gl_portals, true, 0)
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
CUSTOM_CVAR(Int, r_mirror_recursions,4,CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|
|
|
|
{
|
|
|
|
|
if (self<0) self=0;
|
|
|
|
|
if (self>10) self=10;
|
|
|
|
|
}
|
2008-12-06 23:37:13 +00:00
|
|
|
|
bool gl_plane_reflection_i; // This is needed in a header that cannot include the CVAR stuff...
|
|
|
|
|
CUSTOM_CVAR(Bool, gl_plane_reflection, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|
|
|
|
{
|
|
|
|
|
gl_plane_reflection_i = self;
|
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
TArray<GLPortal *> GLPortal::portals;
|
|
|
|
|
int GLPortal::recursion;
|
|
|
|
|
int GLPortal::MirrorFlag;
|
|
|
|
|
int GLPortal::PlaneMirrorFlag;
|
|
|
|
|
int GLPortal::renderdepth;
|
|
|
|
|
int GLPortal::PlaneMirrorMode;
|
|
|
|
|
GLuint GLPortal::QueryObject;
|
|
|
|
|
|
|
|
|
|
line_t * GLPortal::mirrorline;
|
|
|
|
|
bool GLPortal::inupperstack;
|
|
|
|
|
bool GLPortal::inlowerstack;
|
|
|
|
|
bool GLPortal::inskybox;
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==========================================================================
|
|
|
|
|
void GLPortal::ClearScreen()
|
|
|
|
|
{
|
|
|
|
|
gl.MatrixMode(GL_MODELVIEW);
|
|
|
|
|
gl.PushMatrix();
|
|
|
|
|
gl.MatrixMode(GL_PROJECTION);
|
|
|
|
|
gl.PushMatrix();
|
|
|
|
|
screen->Begin2D(false);
|
|
|
|
|
screen->Dim(0, 1.f, 0, 0, SCREENWIDTH, SCREENHEIGHT);
|
|
|
|
|
gl.Enable(GL_DEPTH_TEST);
|
|
|
|
|
gl.MatrixMode(GL_PROJECTION);
|
|
|
|
|
gl.PopMatrix();
|
|
|
|
|
gl.MatrixMode(GL_MODELVIEW);
|
|
|
|
|
gl.PopMatrix();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// DrawPortalStencil
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLPortal::DrawPortalStencil()
|
|
|
|
|
{
|
2008-06-02 17:20:22 +00:00
|
|
|
|
for(unsigned int i=0;i<lines.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
{
|
|
|
|
|
lines[i].RenderWall(0, NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (NeedCap() && lines.Size() > 1)
|
|
|
|
|
{
|
|
|
|
|
// Cap the stencil at the top and bottom
|
2008-11-03 18:33:40 +00:00
|
|
|
|
// (cheap ass version)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
gl.Begin(GL_TRIANGLE_FAN);
|
|
|
|
|
gl.Vertex3f(-32767.0f,32767.0f,-32767.0f);
|
|
|
|
|
gl.Vertex3f(-32767.0f,32767.0f, 32767.0f);
|
|
|
|
|
gl.Vertex3f( 32767.0f,32767.0f, 32767.0f);
|
|
|
|
|
gl.Vertex3f( 32767.0f,32767.0f,-32767.0f);
|
|
|
|
|
gl.End();
|
|
|
|
|
gl.Begin(GL_TRIANGLE_FAN);
|
|
|
|
|
gl.Vertex3f(-32767.0f,-32767.0f,-32767.0f);
|
|
|
|
|
gl.Vertex3f(-32767.0f,-32767.0f, 32767.0f);
|
|
|
|
|
gl.Vertex3f( 32767.0f,-32767.0f, 32767.0f);
|
|
|
|
|
gl.Vertex3f( 32767.0f,-32767.0f,-32767.0f);
|
|
|
|
|
gl.End();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Start
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
CVAR(Bool, gl_noquery, false, 0)
|
|
|
|
|
|
|
|
|
|
bool GLPortal::Start(bool usestencil, bool doquery)
|
|
|
|
|
{
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Clock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
if (usestencil)
|
|
|
|
|
{
|
2008-10-19 22:24:34 +00:00
|
|
|
|
if (!gl_portals) return false;
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
// Create stencil
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion,~0); // create stencil
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_INCR); // increment stencil of valid pixels
|
|
|
|
|
gl.ColorMask(0,0,0,0); // don't write to the graphics buffer
|
|
|
|
|
gl.DepthMask(false); // don't write to Z-buffer!
|
|
|
|
|
gl_EnableTexture(false);
|
|
|
|
|
gl.Color3f(1,1,1);
|
|
|
|
|
gl.DepthFunc(GL_LESS);
|
2008-11-03 18:33:40 +00:00
|
|
|
|
gl_DisableShader();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
if (NeedDepthBuffer())
|
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
|
if (gl_noquery) doquery = false;
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
// If occlusion query is supported let's use it to avoid rendering portals that aren't visible
|
|
|
|
|
if (doquery && gl.flags&RFL_OCCLUSION_QUERY)
|
|
|
|
|
{
|
|
|
|
|
if (!QueryObject) gl.GenQueries(1, &QueryObject);
|
2008-06-28 13:29:59 +00:00
|
|
|
|
if (QueryObject)
|
|
|
|
|
{
|
|
|
|
|
gl.BeginQuery(GL_SAMPLES_PASSED_ARB, QueryObject);
|
|
|
|
|
}
|
|
|
|
|
else doquery = false; // some kind of error happened
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
|
|
|
|
|
if (doquery && gl.flags&RFL_OCCLUSION_QUERY)
|
|
|
|
|
{
|
|
|
|
|
gl.EndQuery(GL_SAMPLES_PASSED_ARB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear Z-buffer
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion+1,~0); // draw sky into stencil
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_KEEP); // this stage doesn't modify the stencil
|
|
|
|
|
gl.DepthMask(true); // enable z-buffer again
|
|
|
|
|
gl.DepthRange(1,1);
|
|
|
|
|
gl.DepthFunc(GL_ALWAYS);
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
|
|
|
|
|
// set normal drawing mode
|
|
|
|
|
gl_EnableTexture(true);
|
|
|
|
|
gl.DepthFunc(GL_LESS);
|
|
|
|
|
gl.ColorMask(1,1,1,1);
|
|
|
|
|
gl.DepthRange(0,1);
|
|
|
|
|
|
|
|
|
|
if (doquery && gl.flags&RFL_OCCLUSION_QUERY)
|
|
|
|
|
{
|
|
|
|
|
GLuint sampleCount;
|
|
|
|
|
|
|
|
|
|
gl.GetQueryObjectuiv(QueryObject, GL_QUERY_RESULT_ARB, &sampleCount);
|
|
|
|
|
|
|
|
|
|
if (sampleCount==0) // not visible
|
|
|
|
|
{
|
|
|
|
|
// restore default stencil op.
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion,~0); // draw sky into stencil
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GLDrawInfo::StartDrawInfo(NULL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// No z-buffer is needed therefore we can skip all the complicated stuff that is involved
|
|
|
|
|
// No occlusion queries will be done here. For these portals the overhead is far greater
|
|
|
|
|
// than the benefit.
|
|
|
|
|
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion+1,~0); // draw sky into stencil
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_KEEP); // this stage doesn't modify the stencil
|
|
|
|
|
gl_EnableTexture(true);
|
|
|
|
|
gl.ColorMask(1,1,1,1);
|
|
|
|
|
gl.Disable(GL_DEPTH_TEST);
|
|
|
|
|
}
|
|
|
|
|
recursion++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (NeedDepthBuffer())
|
|
|
|
|
{
|
|
|
|
|
GLDrawInfo::StartDrawInfo(NULL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gl.DepthMask(false);
|
|
|
|
|
gl.Disable(GL_DEPTH_TEST);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// The clip plane from the previous portal must be deactivated for this one.
|
|
|
|
|
clipsave = gl.IsEnabled(GL_CLIP_PLANE0+renderdepth-1);
|
|
|
|
|
if (clipsave) gl.Disable(GL_CLIP_PLANE0+renderdepth-1);
|
|
|
|
|
|
|
|
|
|
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Unclock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
// save viewpoint
|
|
|
|
|
savedviewx=viewx;
|
|
|
|
|
savedviewy=viewy;
|
|
|
|
|
savedviewz=viewz;
|
|
|
|
|
savedviewactor=viewactor;
|
|
|
|
|
savedviewangle=viewangle;
|
|
|
|
|
savedviewarea=in_area;
|
|
|
|
|
mirrorline=NULL;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void GLPortal::ClearClipper()
|
|
|
|
|
{
|
|
|
|
|
fixed_t angleOffset = viewangle - savedviewangle;
|
|
|
|
|
|
|
|
|
|
clipper.Clear();
|
|
|
|
|
|
|
|
|
|
static int call=0;
|
|
|
|
|
|
|
|
|
|
// Set the clipper to the minimal visible area
|
|
|
|
|
clipper.AddClipRange(0,0xffffffff);
|
2008-06-02 17:20:22 +00:00
|
|
|
|
for(unsigned int i=0;i<lines.Size();i++)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
{
|
|
|
|
|
angle_t startAngle = R_PointToAngle2(savedviewx, savedviewy,
|
2008-11-02 12:27:18 +00:00
|
|
|
|
TO_MAP(lines[i].glseg.x2), TO_MAP(lines[i].glseg.y2));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
angle_t endAngle = R_PointToAngle2(savedviewx, savedviewy,
|
2008-11-02 12:27:18 +00:00
|
|
|
|
TO_MAP(lines[i].glseg.x1), TO_MAP(lines[i].glseg.y1));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
if (startAngle-endAngle>0)
|
|
|
|
|
{
|
|
|
|
|
clipper.SafeRemoveClipRange(startAngle + angleOffset, endAngle + angleOffset);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// and finally clip it to the visible area
|
|
|
|
|
angle_t a1 = gl_FrustumAngle();
|
|
|
|
|
if (a1<ANGLE_180) clipper.SafeAddClipRange(viewangle+a1, viewangle-a1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// End
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLPortal::End(bool usestencil)
|
|
|
|
|
{
|
|
|
|
|
bool needdepth = NeedDepthBuffer();
|
|
|
|
|
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Clock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
if (clipsave) gl.Enable (GL_CLIP_PLANE0+renderdepth-1);
|
|
|
|
|
if (usestencil)
|
|
|
|
|
{
|
|
|
|
|
if (needdepth) GLDrawInfo::EndDrawInfo();
|
|
|
|
|
|
|
|
|
|
// Restore the old view
|
|
|
|
|
viewx=savedviewx;
|
|
|
|
|
viewy=savedviewy;
|
|
|
|
|
viewz=savedviewz;
|
|
|
|
|
viewangle=savedviewangle;
|
|
|
|
|
viewactor=savedviewactor;
|
|
|
|
|
in_area=savedviewarea;
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
|
|
|
|
|
gl.ColorMask(0,0,0,0); // no graphics
|
|
|
|
|
gl.Color3f(1,1,1);
|
|
|
|
|
gl_EnableTexture(false);
|
2008-11-03 18:33:40 +00:00
|
|
|
|
gl_DisableShader();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
if (needdepth)
|
|
|
|
|
{
|
|
|
|
|
// first step: reset the depth buffer to max. depth
|
|
|
|
|
gl.DepthRange(1,1); // always
|
|
|
|
|
gl.DepthFunc(GL_ALWAYS); // write the farthest depth value
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gl.Enable(GL_DEPTH_TEST);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// second step: restore the depth buffer to the previous values and reset the stencil
|
|
|
|
|
gl.DepthFunc(GL_LEQUAL);
|
|
|
|
|
gl.DepthRange(0,1);
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_DECR);
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion,~0); // draw sky into stencil
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
gl.DepthFunc(GL_LESS);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gl_EnableTexture(true);
|
|
|
|
|
gl.ColorMask(1,1,1,1);
|
|
|
|
|
recursion--;
|
|
|
|
|
|
|
|
|
|
// restore old stencil op.
|
|
|
|
|
gl.StencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
|
|
|
|
|
gl.StencilFunc(GL_EQUAL,recursion,~0); // draw sky into stencil
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (needdepth)
|
|
|
|
|
{
|
|
|
|
|
GLDrawInfo::EndDrawInfo();
|
|
|
|
|
gl.Clear(GL_DEPTH_BUFFER_BIT);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gl.Enable(GL_DEPTH_TEST);
|
|
|
|
|
gl.DepthMask(true);
|
|
|
|
|
}
|
|
|
|
|
// Restore the old view
|
|
|
|
|
viewx=savedviewx;
|
|
|
|
|
viewy=savedviewy;
|
|
|
|
|
viewz=savedviewz;
|
|
|
|
|
viewangle=savedviewangle;
|
|
|
|
|
viewactor=savedviewactor;
|
|
|
|
|
in_area=savedviewarea;
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
|
|
|
|
|
// This draws a valid z-buffer into the stencil's contents to ensure it
|
|
|
|
|
// doesn't get overwritten by the level's geometry.
|
|
|
|
|
|
|
|
|
|
gl.DepthFunc(GL_LEQUAL);
|
|
|
|
|
gl.DepthRange(0,1);
|
|
|
|
|
gl.ColorMask(0,0,0,0); // no graphics
|
|
|
|
|
gl_EnableTexture(false);
|
|
|
|
|
DrawPortalStencil();
|
|
|
|
|
gl_EnableTexture(true);
|
|
|
|
|
gl.ColorMask(1,1,1,1);
|
|
|
|
|
gl.DepthFunc(GL_LESS);
|
|
|
|
|
}
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Unclock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// StartFrame
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLPortal::StartFrame()
|
|
|
|
|
{
|
|
|
|
|
GLPortal * p=NULL;
|
|
|
|
|
portals.Push(p);
|
|
|
|
|
if (renderdepth==0)
|
|
|
|
|
{
|
|
|
|
|
inskybox=inupperstack=inlowerstack=false;
|
|
|
|
|
mirrorline=NULL;
|
|
|
|
|
}
|
|
|
|
|
renderdepth++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// EndFrame
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLPortal::EndFrame()
|
|
|
|
|
{
|
|
|
|
|
GLPortal * p;
|
|
|
|
|
|
|
|
|
|
// Only use occlusion query if there are more than 2 portals.
|
|
|
|
|
// Otherwise there's too much overhead.
|
|
|
|
|
bool usequery = portals.Size() > 2;
|
|
|
|
|
|
|
|
|
|
while (portals.Pop(p) && p)
|
|
|
|
|
{
|
|
|
|
|
p->RenderPortal(true, usequery);
|
|
|
|
|
delete p;
|
|
|
|
|
}
|
|
|
|
|
renderdepth--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Renders one sky portal without a stencil.
|
|
|
|
|
// In more complex scenes using a stencil for skies can severly stall
|
|
|
|
|
// the GPU and there's rarely more than one sky visible at a time.
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
bool GLPortal::RenderFirstSkyPortal(int recursion)
|
|
|
|
|
{
|
|
|
|
|
GLPortal * p;
|
|
|
|
|
GLPortal * best = NULL;
|
|
|
|
|
unsigned bestindex=0;
|
|
|
|
|
|
|
|
|
|
// Find the one with the highest amount of lines.
|
|
|
|
|
// Normally this is also the one that saves the largest amount
|
|
|
|
|
// of time by drawing it before the scene itself.
|
|
|
|
|
for(unsigned i=portals.Size()-1;i>=0 && portals[i]!=NULL;i--)
|
|
|
|
|
{
|
|
|
|
|
p=portals[i];
|
|
|
|
|
if (p->IsSky())
|
|
|
|
|
{
|
|
|
|
|
// Cannot clear the depth buffer inside a portal recursion
|
|
|
|
|
if (recursion && p->NeedDepthBuffer()) continue;
|
|
|
|
|
|
|
|
|
|
if (!best || p->lines.Size()>best->lines.Size())
|
|
|
|
|
{
|
|
|
|
|
best=p;
|
|
|
|
|
bestindex=i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (best)
|
|
|
|
|
{
|
|
|
|
|
best->RenderPortal(false, false);
|
|
|
|
|
portals.Delete(bestindex);
|
|
|
|
|
|
|
|
|
|
delete best;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// FindPortal
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
GLPortal * GLPortal::FindPortal(const void * src)
|
|
|
|
|
{
|
|
|
|
|
int i=portals.Size()-1;
|
|
|
|
|
|
|
|
|
|
while (i>=0 && portals[i] && portals[i]->GetSource()!=src) i--;
|
|
|
|
|
return i>=0? portals[i]:NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Skybox Portal
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// GLSkyboxPortal::DrawContents
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
static int skyboxrecursion=0;
|
|
|
|
|
void GLSkyboxPortal::DrawContents()
|
|
|
|
|
{
|
|
|
|
|
int old_pm=PlaneMirrorMode;
|
|
|
|
|
int saved_extralight = extralight;
|
|
|
|
|
|
|
|
|
|
if (skyboxrecursion>=3)
|
|
|
|
|
{
|
|
|
|
|
ClearScreen();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
skyboxrecursion++;
|
|
|
|
|
origin->flags|=MF_JUSTHIT;
|
|
|
|
|
extralight = 0;
|
|
|
|
|
|
|
|
|
|
PlaneMirrorMode=0;
|
|
|
|
|
|
|
|
|
|
gl.Disable(GL_DEPTH_CLAMP_NV);
|
|
|
|
|
|
|
|
|
|
viewx = origin->x;
|
|
|
|
|
viewy = origin->y;
|
|
|
|
|
viewz = origin->z;
|
|
|
|
|
|
|
|
|
|
// Don't let the viewpoint be too close to a floor or ceiling!
|
|
|
|
|
fixed_t floorh = origin->Sector->floorplane.ZatPoint(origin->x, origin->y);
|
|
|
|
|
fixed_t ceilh = origin->Sector->ceilingplane.ZatPoint(origin->x, origin->y);
|
|
|
|
|
if (viewz<floorh+4*FRACUNIT) viewz=floorh+4*FRACUNIT;
|
|
|
|
|
if (viewz>ceilh-4*FRACUNIT) viewz=ceilh-4*FRACUNIT;
|
|
|
|
|
|
|
|
|
|
viewangle += origin->angle;
|
|
|
|
|
|
|
|
|
|
viewactor = origin;
|
|
|
|
|
|
|
|
|
|
validcount++;
|
|
|
|
|
inskybox=true;
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
gl_SetViewArea();
|
|
|
|
|
ClearClipper();
|
|
|
|
|
gl_DrawScene();
|
|
|
|
|
origin->flags&=~MF_JUSTHIT;
|
|
|
|
|
inskybox=false;
|
|
|
|
|
gl.Enable(GL_DEPTH_CLAMP_NV);
|
|
|
|
|
skyboxrecursion--;
|
|
|
|
|
|
|
|
|
|
PlaneMirrorMode=old_pm;
|
|
|
|
|
extralight = saved_extralight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// GLSectorStackPortal::DrawContents
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLSectorStackPortal::DrawContents()
|
|
|
|
|
{
|
|
|
|
|
viewx -= origin->deltax;
|
|
|
|
|
viewy -= origin->deltay;
|
|
|
|
|
viewz -= origin->deltaz;
|
|
|
|
|
viewactor = NULL;
|
|
|
|
|
|
|
|
|
|
validcount++;
|
|
|
|
|
|
|
|
|
|
// avoid recursions!
|
|
|
|
|
if (origin->isupper) inupperstack=true;
|
|
|
|
|
else inlowerstack=true;
|
|
|
|
|
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
ClearClipper();
|
|
|
|
|
gl_DrawScene();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// GLPlaneMirrorPortal::DrawContents
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLPlaneMirrorPortal::DrawContents()
|
|
|
|
|
{
|
|
|
|
|
if (renderdepth>r_mirror_recursions)
|
|
|
|
|
{
|
|
|
|
|
ClearScreen();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int old_pm=PlaneMirrorMode;
|
|
|
|
|
|
|
|
|
|
fixed_t planez = origin->ZatPoint(viewx, viewy);
|
|
|
|
|
viewz = 2*planez - viewz;
|
|
|
|
|
viewactor = NULL;
|
|
|
|
|
PlaneMirrorMode = ksgn(origin->c);
|
|
|
|
|
|
|
|
|
|
validcount++;
|
|
|
|
|
|
|
|
|
|
PlaneMirrorFlag++;
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
ClearClipper();
|
|
|
|
|
|
|
|
|
|
gl.Enable(GL_CLIP_PLANE0+renderdepth);
|
|
|
|
|
// This only works properly for non-sloped planes so don't bother with the math.
|
2008-11-02 12:27:18 +00:00
|
|
|
|
//double d[4]={origin->a/65536., origin->c/65536., origin->b/65536., TO_GL(origin->d)};
|
|
|
|
|
double d[4]={0, PlaneMirrorMode, 0, TO_GL(origin->d)};
|
2008-01-27 11:25:03 +00:00
|
|
|
|
gl.ClipPlane(GL_CLIP_PLANE0+renderdepth, d);
|
|
|
|
|
|
|
|
|
|
gl_DrawScene();
|
|
|
|
|
gl.Disable(GL_CLIP_PLANE0+renderdepth);
|
|
|
|
|
PlaneMirrorFlag--;
|
|
|
|
|
PlaneMirrorMode=old_pm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Mirror Portal
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// R_EnterMirror
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLMirrorPortal::DrawContents()
|
|
|
|
|
{
|
|
|
|
|
if (renderdepth>r_mirror_recursions)
|
|
|
|
|
{
|
|
|
|
|
ClearScreen();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mirrorline=linedef;
|
|
|
|
|
angle_t startang = viewangle;
|
|
|
|
|
fixed_t startx = viewx;
|
|
|
|
|
fixed_t starty = viewy;
|
|
|
|
|
|
|
|
|
|
vertex_t *v1 = mirrorline->v1;
|
|
|
|
|
vertex_t *v2 = mirrorline->v2;
|
|
|
|
|
|
|
|
|
|
// Reflect the current view behind the mirror.
|
|
|
|
|
if (mirrorline->dx == 0)
|
|
|
|
|
{
|
|
|
|
|
// vertical mirror
|
|
|
|
|
viewx = v1->x - startx + v1->x;
|
|
|
|
|
|
|
|
|
|
// Compensation for reendering inaccuracies
|
|
|
|
|
if (startx<v1->x) viewx -= FRACUNIT/2;
|
|
|
|
|
else viewx += FRACUNIT/2;
|
|
|
|
|
}
|
|
|
|
|
else if (mirrorline->dy == 0)
|
|
|
|
|
{
|
|
|
|
|
// horizontal mirror
|
|
|
|
|
viewy = v1->y - starty + v1->y;
|
|
|
|
|
|
|
|
|
|
// Compensation for reendering inaccuracies
|
|
|
|
|
if (starty<v1->y) viewy -= FRACUNIT/2;
|
|
|
|
|
else viewy += FRACUNIT/2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// any mirror--use floats to avoid integer overflow
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
float dx = TO_GL(v2->x - v1->x);
|
|
|
|
|
float dy = TO_GL(v2->y - v1->y);
|
|
|
|
|
float x1 = TO_GL(v1->x);
|
|
|
|
|
float y1 = TO_GL(v1->y);
|
|
|
|
|
float x = TO_GL(startx);
|
|
|
|
|
float y = TO_GL(starty);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
// the above two cases catch len == 0
|
|
|
|
|
float r = ((x - x1)*dx + (y - y1)*dy) / (dx*dx + dy*dy);
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
viewx = TO_MAP((x1 + r * dx)*2 - x);
|
|
|
|
|
viewy = TO_MAP((y1 + r * dy)*2 - y);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
// Compensation for reendering inaccuracies
|
|
|
|
|
FVector2 v(-dx, dy);
|
|
|
|
|
v.MakeUnit();
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
viewx+= TO_MAP(v[1] * renderdepth / 2);
|
|
|
|
|
viewy+= TO_MAP(v[0] * renderdepth / 2);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
viewangle = 2*R_PointToAngle2 (mirrorline->v1->x, mirrorline->v1->y,
|
|
|
|
|
mirrorline->v2->x, mirrorline->v2->y) - startang;
|
|
|
|
|
|
|
|
|
|
viewactor = NULL;
|
|
|
|
|
|
|
|
|
|
validcount++;
|
|
|
|
|
|
|
|
|
|
MirrorFlag++;
|
|
|
|
|
gl_SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1));
|
|
|
|
|
|
|
|
|
|
clipper.Clear();
|
|
|
|
|
|
|
|
|
|
angle_t af = gl_FrustumAngle();
|
|
|
|
|
if (af<ANGLE_180) clipper.SafeAddClipRange(viewangle+af, viewangle-af);
|
|
|
|
|
|
|
|
|
|
angle_t a2=R_PointToAngle(mirrorline->v1->x, mirrorline->v1->y);
|
|
|
|
|
angle_t a1=R_PointToAngle(mirrorline->v2->x, mirrorline->v2->y);
|
|
|
|
|
clipper.SafeAddClipRange(a1,a2);
|
|
|
|
|
|
|
|
|
|
gl_DrawScene();
|
|
|
|
|
|
|
|
|
|
MirrorFlag--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Horizon Portal
|
|
|
|
|
//
|
|
|
|
|
// This simply draws the area in medium sized squares. Drawing it as a whole
|
|
|
|
|
// polygon creates visible inaccuracies.
|
|
|
|
|
//
|
|
|
|
|
// Originally I tried to minimize the amount of data to be drawn but there
|
|
|
|
|
// are 2 problems with it:
|
|
|
|
|
//
|
|
|
|
|
// 1. Setting this up completely negates any performance gains.
|
|
|
|
|
// 2. It doesn't work with a 360<36> field of view (as when you are looking up.)
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// So the brute force mechanism is just as good.
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// GLHorizonPortal::DrawContents
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void GLHorizonPortal::DrawContents()
|
|
|
|
|
{
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Clock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
GLSectorPlane * sp=&origin->plane;
|
|
|
|
|
FGLTexture * gltexture;
|
|
|
|
|
PalEntry color;
|
|
|
|
|
float z;
|
|
|
|
|
player_t * player=&players[consoleplayer];
|
|
|
|
|
|
|
|
|
|
gltexture=FGLTexture::ValidateTexture(sp->texture);
|
|
|
|
|
if (!gltexture)
|
|
|
|
|
{
|
|
|
|
|
ClearScreen();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
z=TO_GL(sp->texheight);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
|
2008-11-02 23:48:39 +00:00
|
|
|
|
if (gltexture && gltexture->tex->isFullbright())
|
2008-01-27 11:25:03 +00:00
|
|
|
|
{
|
|
|
|
|
// glowing textures are always drawn full bright without color
|
|
|
|
|
gl_SetColor(255, 0, NULL, 1.f);
|
2008-11-02 12:27:18 +00:00
|
|
|
|
gl_SetFog(255, 0, &origin->colormap, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2008-11-02 12:27:18 +00:00
|
|
|
|
int rel = extralight * gl_weaponlight;
|
|
|
|
|
gl_SetColor(origin->lightlevel, rel, &origin->colormap, 1.0f);
|
|
|
|
|
gl_SetFog(origin->lightlevel, rel, &origin->colormap, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gltexture->Bind(origin->colormap.LightColor.a);
|
|
|
|
|
gl_SetPlaneTextureRotation(sp, gltexture);
|
|
|
|
|
|
|
|
|
|
gl.Disable(GL_ALPHA_TEST);
|
|
|
|
|
gl.BlendFunc(GL_ONE,GL_ZERO);
|
2008-11-03 18:33:40 +00:00
|
|
|
|
gl_ApplyShader();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
float vx=TO_GL(viewx);
|
|
|
|
|
float vy=TO_GL(viewy);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
// Draw to some far away boundary
|
|
|
|
|
for(float x=-32768+vx; x<32768+vx; x+=4096)
|
|
|
|
|
{
|
|
|
|
|
for(float y=-32768+vy; y<32768+vy;y+=4096)
|
|
|
|
|
{
|
|
|
|
|
gl.Begin(GL_TRIANGLE_FAN);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(x/64, -y/64);
|
|
|
|
|
gl.Vertex3f(x, z, y);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(x/64 + 64, -y/64);
|
|
|
|
|
gl.Vertex3f(x + 4096, z, y);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(x/64 + 64, -y/64 - 64);
|
|
|
|
|
gl.Vertex3f(x + 4096, z, y + 4096);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(x/64, -y/64 - 64);
|
|
|
|
|
gl.Vertex3f(x, z, y + 4096);
|
|
|
|
|
|
|
|
|
|
gl.End();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-02 12:27:18 +00:00
|
|
|
|
float vz=TO_GL(viewz);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
float tz=(z-vz);///64.0f;
|
|
|
|
|
|
|
|
|
|
// fill the gap between the polygon and the true horizon
|
|
|
|
|
// Since I can't draw into infinity there can always be a
|
|
|
|
|
// small gap
|
|
|
|
|
|
|
|
|
|
gl.Begin(GL_TRIANGLE_STRIP);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(512.f, 0);
|
|
|
|
|
gl.Vertex3f(-32768+vx, z, -32768+vy);
|
|
|
|
|
gl.TexCoord2f(512.f, tz);
|
|
|
|
|
gl.Vertex3f(-32768+vx, vz, -32768+vy);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(-512.f, 0);
|
|
|
|
|
gl.Vertex3f(-32768+vx, z, 32768+vy);
|
|
|
|
|
gl.TexCoord2f(-512.f, tz);
|
|
|
|
|
gl.Vertex3f(-32768+vx, vz, 32768+vy);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(512.f, 0);
|
|
|
|
|
gl.Vertex3f( 32768+vx, z, 32768+vy);
|
|
|
|
|
gl.TexCoord2f(512.f, tz);
|
|
|
|
|
gl.Vertex3f( 32768+vx, vz, 32768+vy);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(-512.f, 0);
|
|
|
|
|
gl.Vertex3f( 32768+vx, z, -32768+vy);
|
|
|
|
|
gl.TexCoord2f(-512.f, tz);
|
|
|
|
|
gl.Vertex3f( 32768+vx, vz, -32768+vy);
|
|
|
|
|
|
|
|
|
|
gl.TexCoord2f(512.f, 0);
|
|
|
|
|
gl.Vertex3f(-32768+vx, z, -32768+vy);
|
|
|
|
|
gl.TexCoord2f(512.f, tz);
|
|
|
|
|
gl.Vertex3f(-32768+vx, vz, -32768+vy);
|
|
|
|
|
|
|
|
|
|
gl.End();
|
|
|
|
|
|
|
|
|
|
gl.MatrixMode(GL_TEXTURE);
|
|
|
|
|
gl.PopMatrix();
|
|
|
|
|
gl.MatrixMode(GL_MODELVIEW);
|
|
|
|
|
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
|
PortalAll.Unclock();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|