gzdoom-last-svn/src/r_main.cpp

1008 lines
26 KiB
C++
Raw Normal View History

// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:
// Rendering main loop and setup functions,
// utility functions (BSP, geometry, trigonometry).
// See tables.c, too.
//
//-----------------------------------------------------------------------------
// HEADER FILES ------------------------------------------------------------
#include <stdlib.h>
#include <math.h>
#include "templates.h"
#include "doomdef.h"
#include "d_net.h"
#include "doomstat.h"
#include "m_random.h"
#include "m_bbox.h"
#include "r_local.h"
#include "r_plane.h"
#include "r_bsp.h"
#include "r_3dfloors.h"
#include "r_sky.h"
#include "st_stuff.h"
#include "c_cvars.h"
#include "c_dispatch.h"
#include "v_video.h"
#include "stats.h"
#include "i_video.h"
#include "i_system.h"
#include "a_sharedglobal.h"
#include "r_data/r_translate.h"
Update to ZDoom r813, including: - Added copyright/license headers to a few files. - Fixed: ACS SetMugShotState needs to check the StatusBar pointer for the proper object type. - Move SBarInfo loading code in d_main.cpp into a static method of DSBarInfo. - Removed dobject.err from the repository. It only contained a list of compiler errors for some very old version of dobject.cpp. - Fixed: A_JumpIfCloser was missing a z-check. - Added Blzut3's SBARINFO update #13: - Split sbarinfo.cpp into two files sbarinfo_display.cpp and sbarinfo_parser.cpp - Rewrote the mug shot system for SBarInfo to allow for scripting and custom states for different means of death. - SBarInfo now loads all SBarInfo lumps instead of just the last one. Clashing status bar definitions will now be cleared before the bar is read. - Fixed: When using transparency with bars the new drawing method (bg over fg) didn't work. In the case that the border value is set to 0 it will revert to the old method (fg over bg). - Fixed: drawbar lost any high res information it was given. - Added: ACS command SetMugShotState(str state) which sets the mug shot state for the activating player. - Added: keepoffsets flag to drawbar. When set the offsets in the fg image will also be applied when displaying the bar. - Fixed the TArray serializer declaration. (Thank you for your warnings, GCC! ;-) - Changed root sector marking so that it can happen incrementally. - Fixed: The TArray serializer needs to be declared as a friend of TArray in order to be able to access its fields. - Since there are no backwards compatibility issues due to savegame version bumping I closed all gaps in the level flag set. - Bumped min. Savegame version and Netgame version for 3dMidtex related changes. - Changed Jump and Crouch DMFlags into 3-way switches: 0: map default, 1: off, 2: on. Since I needed new bits the rest of the DMFlag bit values had to be changed as a result. - fixed: PTR_SlideTraverse didn't check ML_BLOCKMONSTERS for sliding actors without MF3_NOBLOCKMONST. - Added MAPINFO commands 'checkswitchrange' and 'nocheckswitchrange' that can enable or disable switch range checking globally per map. - Changed ML_3DMIDTEX to force ML_CHECKSWITCHRANGE. - Added a ML_CHECKSWITCHRANGE flag which allows checking whether the player can actually reach the switch he wants to use. - Made DActiveButton::EWhere global so that I can use it outside thr DActiveButton class. - Changed P_LineOpening to pass its result in a struct instead of global variables. - Added Eternity's 3DMIDTEX feature (no Eternity code used though.) It should be feature complete with the exception of the ML_BLOCKMONSTERS flag handling. That particular part of Eternity's implementation is sub-optimal because it hijacks an existing flag and doesn't seem to make much sense to me. Maybe I'll implement it as a separate flag later. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@62 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-19 11:19:03 +00:00
#include "p_3dmidtex.h"
#include "r_data/r_interpolate.h"
#include "v_palette.h"
#include "po_man.h"
#include "p_effect.h"
#include "st_start.h"
#include "v_font.h"
#include "r_data/colormaps.h"
#include "farchive.h"
// MACROS ------------------------------------------------------------------
#if 0
#define TEST_X 32343794
#define TEST_Y 111387517
#define TEST_Z 2164524
#define TEST_ANGLE 2468347904
#endif
// TYPES -------------------------------------------------------------------
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
void R_SpanInitData ();
void RP_RenderBSPNode (void *node);
bool RP_SetupFrame (bool backside);
void R_DeinitSprites();
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static void R_ShutdownRenderer();
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern short *openings;
extern bool r_fakingunderwater;
extern "C" int fuzzviewheight;
// PRIVATE DATA DECLARATIONS -----------------------------------------------
static float CurrentVisibility = 8.f;
static fixed_t MaxVisForWall;
static fixed_t MaxVisForFloor;
static bool polyclipped;
extern bool r_showviewer;
bool r_dontmaplines;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
CVAR (String, r_viewsize, "", CVAR_NOSET)
CVAR (Int, r_polymost, 0, 0)
CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
fixed_t r_BaseVisibility;
fixed_t r_WallVisibility;
fixed_t r_FloorVisibility;
float r_TiltVisibility;
fixed_t r_SpriteVisibility;
fixed_t r_ParticleVisibility;
fixed_t r_SkyVisibility;
fixed_t GlobVis;
fixed_t viewingrangerecip;
fixed_t FocalLengthX;
fixed_t FocalLengthY;
float FocalLengthXfloat;
FDynamicColormap*basecolormap; // [RH] colormap currently drawing with
int fixedlightlev;
lighttable_t *fixedcolormap;
FSpecialColormap *realfixedcolormap;
float WallTMapScale;
float WallTMapScale2;
bool bRenderingToCanvas; // [RH] True if rendering to a special canvas
fixed_t globaluclip, globaldclip;
fixed_t centerxfrac;
fixed_t centeryfrac;
fixed_t yaspectmul;
fixed_t baseyaspectmul; // yaspectmul without a forced aspect ratio
float iyaspectmulfloat;
fixed_t InvZtoScale;
// just for profiling purposes
int linecount;
int loopcount;
//
// precalculated math tables
//
// The xtoviewangleangle[] table maps a screen pixel
// to the lowest viewangle that maps back to x ranges
// from clipangle to -clipangle.
angle_t xtoviewangle[MAXWIDTH+1];
bool foggy; // [RH] ignore extralight and fullbright?
int r_actualextralight;
void (*colfunc) (void);
void (*basecolfunc) (void);
void (*fuzzcolfunc) (void);
void (*transcolfunc) (void);
void (*spanfunc) (void);
void (*hcolfunc_pre) (void);
void (*hcolfunc_post1) (int hx, int sx, int yl, int yh);
void (*hcolfunc_post2) (int hx, int sx, int yl, int yh);
void (STACK_ARGS *hcolfunc_post4) (int sx, int yl, int yh);
cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles;
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static int lastcenteryfrac;
// CODE --------------------------------------------------------------------
//==========================================================================
//
// viewangletox
//
// Used solely for construction the xtoviewangle table.
//
//==========================================================================
static inline int viewangletox(int i)
{
if (finetangent[i] > FRACUNIT*2)
{
return -1;
}
else if (finetangent[i] < -FRACUNIT*2)
{
return viewwidth+1;
}
else
{
int t = FixedMul(finetangent[i], FocalLengthX);
t = (centerxfrac - t + FRACUNIT-1) >> FRACBITS;
return clamp(t, -1, viewwidth+1);
}
}
//==========================================================================
//
// R_InitTextureMapping
//
//==========================================================================
void R_InitTextureMapping ()
{
int i, x;
// Calc focallength so FieldOfView fineangles covers viewwidth.
FocalLengthX = FixedDiv (centerxfrac, FocalTangent);
FocalLengthY = Scale (centerxfrac, yaspectmul, FocalTangent);
FocalLengthXfloat = (float)FocalLengthX / 65536.f;
// This is 1/FocalTangent before the widescreen extension of FOV.
viewingrangerecip = DivScale32(1, finetangent[FINEANGLES/4+(FieldOfView/2)]);
// [RH] Do not generate viewangletox, because texture mapping is no
// longer done with trig, so it's not needed.
// Now generate xtoviewangle for sky texture mapping.
// We do this with a hybrid approach: The center 90 degree span is
// constructed as per the original code:
// Scan xtoviewangle to find the smallest view angle that maps to x.
// (viewangletox is sorted in non-increasing order.)
// This reduces the chances of "doubling-up" of texture columns in
// the drawn sky texture.
// The remaining arcs are done with tantoangle instead.
const int t1 = MAX<int>(centerx - (FocalLengthX >> FRACBITS), 0);
const int t2 = MIN<int>(centerx + (FocalLengthX >> FRACBITS), viewwidth);
const fixed_t dfocus = FocalLengthX >> DBITS;
for (i = 0, x = t2; x >= t1; --x)
{
while(viewangletox(i) > x)
{
++i;
}
xtoviewangle[x] = (i << ANGLETOFINESHIFT) - ANGLE_90;
}
for (x = t2 + 1; x <= viewwidth; ++x)
{
xtoviewangle[x] = ANGLE_270 + tantoangle[dfocus / (x - centerx)];
}
for (x = 0; x < t1; ++x)
{
xtoviewangle[x] = (angle_t)(-(signed)xtoviewangle[viewwidth - x]);
}
}
//==========================================================================
//
// R_SetVisibility
//
// Changes how rapidly things get dark with distance
//
//==========================================================================
void R_SetVisibility (float vis)
{
// Allow negative visibilities, just for novelty's sake
//vis = clamp (vis, -204.7f, 204.7f);
CurrentVisibility = vis;
if (FocalTangent == 0 || FocalLengthY == 0)
{ // If r_visibility is called before the renderer is all set up, don't
// divide by zero. This will be called again later, and the proper
// values can be initialized then.
return;
}
r_BaseVisibility = xs_RoundToInt(vis * 65536.f);
// Prevent overflow on walls
if (r_BaseVisibility < 0 && r_BaseVisibility < -MaxVisForWall)
r_WallVisibility = -MaxVisForWall;
else if (r_BaseVisibility > 0 && r_BaseVisibility > MaxVisForWall)
r_WallVisibility = MaxVisForWall;
else
r_WallVisibility = r_BaseVisibility;
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
r_WallVisibility = FixedMul (Scale (InvZtoScale, SCREENWIDTH*BaseRatioSizes[WidescreenRatio][1],
viewwidth*SCREENHEIGHT*3), FixedMul (r_WallVisibility, FocalTangent));
// Prevent overflow on floors/ceilings. Note that the calculation of
// MaxVisForFloor means that planes less than two units from the player's
// view could still overflow, but there is no way to totally eliminate
// that while still using fixed point math.
if (r_BaseVisibility < 0 && r_BaseVisibility < -MaxVisForFloor)
r_FloorVisibility = -MaxVisForFloor;
else if (r_BaseVisibility > 0 && r_BaseVisibility > MaxVisForFloor)
r_FloorVisibility = MaxVisForFloor;
else
r_FloorVisibility = r_BaseVisibility;
r_FloorVisibility = Scale (160*FRACUNIT, r_FloorVisibility, FocalLengthY);
r_TiltVisibility = vis * (float)FocalTangent * (16.f * 320.f) / (float)viewwidth;
r_SpriteVisibility = r_WallVisibility;
}
//==========================================================================
//
// R_GetVisibility
//
//==========================================================================
float R_GetVisibility ()
{
return CurrentVisibility;
}
//==========================================================================
//
// CCMD r_visibility
//
// Controls how quickly light ramps across a 1/z range. Set this, and it
// sets all the r_*Visibility variables (except r_SkyVisibilily, which is
// currently unused).
//
//==========================================================================
CCMD (r_visibility)
{
if (argv.argc() < 2)
{
Printf ("Visibility is %g\n", R_GetVisibility());
}
else if (!netgame)
{
R_SetVisibility ((float)atof (argv[1]));
}
else
{
Printf ("Visibility cannot be changed in net games.\n");
}
}
//==========================================================================
//
// R_SetWindow
//
//==========================================================================
void R_SWRSetWindow(int windowSize, int fullWidth, int fullHeight, int stHeight, int trueratio)
{
int virtheight, virtwidth, virtwidth2, virtheight2;
if (!bRenderingToCanvas)
{ // Set r_viewsize cvar to reflect the current view size
UCVarValue value;
char temp[16];
Update to ZDoom r1083. Not fully tested yet! - Converted most sprintf (and all wsprintf) calls to either mysnprintf or FStrings, depending on the situation. - Changed the strings in the wbstartstruct to be FStrings. - Changed myvsnprintf() to output nothing if count is greater than INT_MAX. This is so that I can use a series of mysnprintf() calls and advance the pointer for each one. Once the pointer goes beyond the end of the buffer, the count will go negative, but since it's an unsigned type it will be seen as excessively huge instead. This should not be a problem, as there's no reason for ZDoom to be using text buffers larger than 2 GB anywhere. - Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig(). - Changed CalcMapName() to return an FString instead of a pointer to a static buffer. - Changed startmap in d_main.cpp into an FString. - Changed CheckWarpTransMap() to take an FString& as the first argument. - Changed d_mapname in g_level.cpp into an FString. - Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an FString. - Fixed: The MAPINFO parser wrote into the string buffer to construct a map name when given a Hexen map number. This was fine with the old scanner code, but only a happy coincidence prevents it from crashing with the new code. - Added the 'B' conversion specifier to StringFormat::VWorker() for printing binary numbers. - Added CMake support for building with MinGW, MSYS, and NMake. Linux support is probably broken until I get around to booting into Linux again. Niceties provided over the existing Makefiles they're replacing: * All command-line builds can use the same build system, rather than having a separate one for MinGW and another for Linux. * Microsoft's NMake tool is supported as a target. * Progress meters. * Parallel makes work from a fresh checkout without needing to be primed first with a single-threaded make. * Porting to other architectures should be simplified, whenever that day comes. - Replaced the makewad tool with zipdir. This handles the dependency tracking itself instead of generating an external makefile to do it, since I couldn't figure out how to generate a makefile with an external tool and include it with a CMake-generated makefile. Where makewad used a master list of files to generate the package file, zipdir just zips the entire contents of one or more directories. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
mysnprintf (temp, countof(temp), "%d x %d", viewwidth, viewheight);
value.String = temp;
r_viewsize.ForceSet (value, CVAR_String);
}
fuzzviewheight = viewheight - 2; // Maximum row the fuzzer can draw to
halfviewwidth = (viewwidth >> 1) - 1;
lastcenteryfrac = 1<<30;
centerxfrac = centerx<<FRACBITS;
centeryfrac = centery<<FRACBITS;
virtwidth = virtwidth2 = fullWidth;
virtheight = virtheight2 = fullHeight;
if (trueratio & 4)
{
virtheight2 = virtheight2 * BaseRatioSizes[trueratio][3] / 48;
}
else
{
virtwidth2 = virtwidth2 * BaseRatioSizes[trueratio][3] / 48;
}
if (WidescreenRatio & 4)
{
virtheight = virtheight * BaseRatioSizes[WidescreenRatio][3] / 48;
}
else
{
virtwidth = virtwidth * BaseRatioSizes[WidescreenRatio][3] / 48;
}
baseyaspectmul = Scale(320 << FRACBITS, virtheight2, r_Yaspect * virtwidth2);
yaspectmul = Scale ((320<<FRACBITS), virtheight, r_Yaspect * virtwidth);
iyaspectmulfloat = (float)virtwidth * r_Yaspect / 320.f / (float)virtheight;
InvZtoScale = yaspectmul * centerx;
WallTMapScale = (float)centerx * 32.f;
WallTMapScale2 = iyaspectmulfloat * 2.f / (float)centerx;
// psprite scales
pspritexscale = (centerxwide << FRACBITS) / 160;
pspriteyscale = FixedMul (pspritexscale, yaspectmul);
pspritexiscale = FixedDiv (FRACUNIT, pspritexscale);
// thing clipping
clearbufshort (screenheightarray, viewwidth, (short)viewheight);
R_InitTextureMapping ();
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
MaxVisForWall = FixedMul (Scale (InvZtoScale, SCREENWIDTH*r_Yaspect,
viewwidth*SCREENHEIGHT), FocalTangent);
MaxVisForWall = FixedDiv (0x7fff0000, MaxVisForWall);
MaxVisForFloor = Scale (FixedDiv (0x7fff0000, viewheight<<(FRACBITS-2)), FocalLengthY, 160*FRACUNIT);
// Reset r_*Visibility vars
R_SetVisibility (R_GetVisibility ());
}
//==========================================================================
//
// CVAR r_columnmethod
//
// Selects which version of the seg renderers to use.
//
//==========================================================================
CUSTOM_CVAR (Int, r_columnmethod, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
if (self != 0 && self != 1)
{
self = 1;
}
else
{ // Trigger the change
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
setsizeneeded = true;
}
}
//==========================================================================
//
// R_Init
//
//==========================================================================
void R_InitRenderer()
{
atterm(R_ShutdownRenderer);
// viewwidth / viewheight are set by the defaults
clearbufshort (zeroarray, MAXWIDTH, 0);
R_InitPlanes ();
R_InitShadeMaps();
R_InitColumnDrawers ();
colfunc = basecolfunc = R_DrawColumn;
fuzzcolfunc = R_DrawFuzzColumn;
transcolfunc = R_DrawTranslatedColumn;
spanfunc = R_DrawSpan;
// [RH] Horizontal column drawers
hcolfunc_pre = R_DrawColumnHoriz;
hcolfunc_post1 = rt_map1col;
hcolfunc_post4 = rt_map4cols;
}
//==========================================================================
//
// R_ShutdownRenderer
//
//==========================================================================
static void R_ShutdownRenderer()
{
R_DeinitSprites();
R_DeinitPlanes();
// Free openings
if (openings != NULL)
{
M_Free (openings);
openings = NULL;
}
// Free drawsegs
if (drawsegs != NULL)
{
M_Free (drawsegs);
drawsegs = NULL;
}
}
//==========================================================================
//
// R_CopyStackedViewParameters
//
//==========================================================================
void R_CopyStackedViewParameters()
{
stacked_viewx = viewx;
stacked_viewy = viewy;
stacked_viewz = viewz;
stacked_angle = viewangle;
stacked_extralight = extralight;
stacked_visibility = R_GetVisibility();
}
//==========================================================================
//
// R_SetupColormap
//
// Sets up special fixed colormaps
//
//==========================================================================
void R_SetupColormap(player_t *player)
{
realfixedcolormap = NULL;
fixedcolormap = NULL;
fixedlightlev = -1;
if (player != NULL && camera == player->mo)
{
if (player->fixedcolormap >= 0 && player->fixedcolormap < (int)SpecialColormaps.Size())
{
realfixedcolormap = &SpecialColormaps[player->fixedcolormap];
if (RenderTarget == screen && (DFrameBuffer *)screen->Accel2D && r_shadercolormaps)
{
// Render everything fullbright. The copy to video memory will
// apply the special colormap, so it won't be restricted to the
// palette.
fixedcolormap = realcolormaps;
}
else
{
fixedcolormap = SpecialColormaps[player->fixedcolormap].Colormap;
}
}
else if (player->fixedlightlevel >= 0 && player->fixedlightlevel < NUMCOLORMAPS)
{
fixedlightlev = player->fixedlightlevel * 256;
}
}
// [RH] Inverse light for shooting the Sigil
if (fixedcolormap == NULL && extralight == INT_MIN)
{
fixedcolormap = SpecialColormaps[INVERSECOLORMAP].Colormap;
extralight = 0;
}
}
//==========================================================================
//
// R_SetupFreelook
//
// [RH] freelook stuff
//
//==========================================================================
void R_SetupFreelook()
{
{
fixed_t dy;
if (camera != NULL)
{
dy = FixedMul (FocalLengthY, finetangent[(ANGLE_90-viewpitch)>>ANGLETOFINESHIFT]);
}
else
{
dy = 0;
}
centeryfrac = (viewheight << (FRACBITS-1)) + dy;
centery = centeryfrac >> FRACBITS;
globaluclip = FixedDiv (-centeryfrac, InvZtoScale);
globaldclip = FixedDiv ((viewheight<<FRACBITS)-centeryfrac, InvZtoScale);
//centeryfrac &= 0xffff0000;
int e, i;
i = 0;
e = viewheight;
fixed_t focus = FocalLengthY;
fixed_t den;
if (i < centery)
{
den = centeryfrac - (i << FRACBITS) - FRACUNIT/2;
if (e <= centery)
{
do {
yslope[i] = FixedDiv (focus, den);
den -= FRACUNIT;
} while (++i < e);
}
else
{
do {
yslope[i] = FixedDiv (focus, den);
den -= FRACUNIT;
} while (++i < centery);
den = (i << FRACBITS) - centeryfrac + FRACUNIT/2;
do {
yslope[i] = FixedDiv (focus, den);
den += FRACUNIT;
} while (++i < e);
}
}
else
{
den = (i << FRACBITS) - centeryfrac + FRACUNIT/2;
do {
yslope[i] = FixedDiv (focus, den);
den += FRACUNIT;
} while (++i < e);
}
}
}
void R_SetupPolymost()
{
if (r_polymost)
{
polyclipped = RP_SetupFrame (false);
}
}
//==========================================================================
//
// R_EnterMirror
//
// [RH] Draw the reflection inside a mirror
//
//==========================================================================
void R_EnterMirror (drawseg_t *ds, int depth)
{
angle_t startang = viewangle;
fixed_t startx = viewx;
fixed_t starty = viewy;
CurrentMirror++;
unsigned int mirrorsAtStart = WallMirrors.Size ();
vertex_t *v1 = ds->curline->v1;
// Reflect the current view behind the mirror.
if (ds->curline->linedef->dx == 0)
{ // vertical mirror
viewx = v1->x - startx + v1->x;
}
else if (ds->curline->linedef->dy == 0)
{ // horizontal mirror
viewy = v1->y - starty + v1->y;
}
else
{ // any mirror--use floats to avoid integer overflow
vertex_t *v2 = ds->curline->v2;
float dx = FIXED2FLOAT(v2->x - v1->x);
float dy = FIXED2FLOAT(v2->y - v1->y);
float x1 = FIXED2FLOAT(v1->x);
float y1 = FIXED2FLOAT(v1->y);
float x = FIXED2FLOAT(startx);
float y = FIXED2FLOAT(starty);
// the above two cases catch len == 0
float r = ((x - x1)*dx + (y - y1)*dy) / (dx*dx + dy*dy);
viewx = FLOAT2FIXED((x1 + r * dx)*2 - x);
viewy = FLOAT2FIXED((y1 + r * dy)*2 - y);
}
viewangle = 2*R_PointToAngle2 (ds->curline->v1->x, ds->curline->v1->y,
ds->curline->v2->x, ds->curline->v2->y) - startang;
viewsin = finesine[viewangle>>ANGLETOFINESHIFT];
viewcos = finecosine[viewangle>>ANGLETOFINESHIFT];
viewtansin = FixedMul (FocalTangent, viewsin);
viewtancos = FixedMul (FocalTangent, viewcos);
R_CopyStackedViewParameters();
validcount++;
ActiveWallMirror = ds->curline;
R_ClearPlanes (false);
R_ClearClipSegs (ds->x1, ds->x2 + 1);
memcpy (ceilingclip + ds->x1, openings + ds->sprtopclip, (ds->x2 - ds->x1 + 1)*sizeof(*ceilingclip));
memcpy (floorclip + ds->x1, openings + ds->sprbottomclip, (ds->x2 - ds->x1 + 1)*sizeof(*floorclip));
WindowLeft = ds->x1;
WindowRight = ds->x2;
MirrorFlags = (depth + 1) & 1;
R_RenderBSPNode (nodes + numnodes - 1);
R_3D_ResetClip(); // reset clips (floor/ceiling)
R_DrawPlanes ();
R_DrawSkyBoxes ();
// Allow up to 4 recursions through a mirror
if (depth < 4)
{
unsigned int mirrorsAtEnd = WallMirrors.Size ();
for (; mirrorsAtStart < mirrorsAtEnd; mirrorsAtStart++)
{
R_EnterMirror (drawsegs + WallMirrors[mirrorsAtStart], depth + 1);
}
}
else
{
depth = depth;
}
viewangle = startang;
viewx = startx;
viewy = starty;
}
//==========================================================================
//
// R_SetupBuffer
//
// Precalculate all row offsets and fuzz table.
//
//==========================================================================
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
void R_SetupBuffer ()
{
static BYTE *lastbuff = NULL;
int pitch = RenderTarget->GetPitch();
BYTE *lineptr = RenderTarget->GetBuffer() + viewwindowy*pitch + viewwindowx;
if (dc_pitch != pitch || lineptr != lastbuff)
{
if (dc_pitch != pitch)
{
dc_pitch = pitch;
R_InitFuzzTable (pitch);
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
#if defined(X86_ASM) || defined(X64_ASM)
ASM_PatchPitch ();
#endif
}
dc_destorg = lineptr;
for (int i = 0; i < RenderTarget->GetHeight(); i++)
{
ylookup[i] = i * pitch;
}
}
}
//==========================================================================
//
// R_RenderActorView
//
//==========================================================================
void R_RenderActorView (AActor *actor, bool dontmaplines)
{
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
WallCycles.Reset();
PlaneCycles.Reset();
MaskedCycles.Reset();
WallScanCycles.Reset();
fakeActive = 0; // kg3D - reset fake floor indicator
R_3D_ResetClip(); // reset clips (floor/ceiling)
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
R_SetupBuffer ();
R_SetupFrame (actor);
// Clear buffers.
R_ClearClipSegs (0, viewwidth);
R_ClearDrawSegs ();
R_ClearPlanes (true);
R_ClearSprites ();
NetUpdate ();
// [RH] Show off segs if r_drawflat is 1
if (r_drawflat)
{
hcolfunc_pre = R_FillColumnHorizP;
hcolfunc_post1 = rt_copy1col;
hcolfunc_post4 = rt_copy4cols;
colfunc = R_FillColumnP;
spanfunc = R_FillSpan;
}
else
{
hcolfunc_pre = R_DrawColumnHoriz;
hcolfunc_post1 = rt_map1col;
hcolfunc_post4 = rt_map4cols;
colfunc = basecolfunc;
spanfunc = R_DrawSpan;
}
WindowLeft = 0;
WindowRight = viewwidth - 1;
MirrorFlags = 0;
ActiveWallMirror = NULL;
r_dontmaplines = dontmaplines;
// [RH] Hack to make windows into underwater areas possible
r_fakingunderwater = false;
// [RH] Setup particles for this frame
P_FindParticleSubsectors ();
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
WallCycles.Clock();
DWORD savedflags = camera->renderflags;
// Never draw the player unless in chasecam mode
if (!r_showviewer)
{
camera->renderflags |= RF_INVISIBLE;
}
// Link the polyobjects right before drawing the scene to reduce the amounts of calls to this function
PO_LinkToSubsectors();
if (r_polymost < 2)
{
R_RenderBSPNode (nodes + numnodes - 1); // The head node is the last node output.
R_3D_ResetClip(); // reset clips (floor/ceiling)
}
camera->renderflags = savedflags;
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
WallCycles.Unclock();
NetUpdate ();
if (viewactive)
{
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
PlaneCycles.Clock();
R_DrawPlanes ();
R_DrawSkyBoxes ();
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
PlaneCycles.Unclock();
// [RH] Walk through mirrors
size_t lastmirror = WallMirrors.Size ();
for (unsigned int i = 0; i < lastmirror; i++)
{
R_EnterMirror (drawsegs + WallMirrors[i], 0);
}
NetUpdate ();
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
MaskedCycles.Clock();
R_DrawMasked ();
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
MaskedCycles.Unclock();
NetUpdate ();
if (r_polymost)
{
RP_RenderBSPNode (nodes + numnodes - 1);
if (polyclipped)
{
RP_SetupFrame (true);
RP_RenderBSPNode (nodes + numnodes - 1);
}
}
}
WallMirrors.Clear ();
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
interpolator.RestoreInterpolations ();
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
R_SetupBuffer ();
// If we don't want shadered colormaps, NULL it now so that the
// copy to the screen does not use a special colormap shader.
if (!r_shadercolormaps)
{
realfixedcolormap = NULL;
}
}
//==========================================================================
//
// R_RenderViewToCanvas
//
// Pre: Canvas is already locked.
//
//==========================================================================
void R_RenderViewToCanvas (AActor *actor, DCanvas *canvas,
int x, int y, int width, int height, bool dontmaplines)
{
const bool savedviewactive = viewactive;
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
viewwidth = width;
RenderTarget = canvas;
bRenderingToCanvas = true;
R_SetWindow (12, width, height, height);
viewwindowx = x;
viewwindowy = y;
viewactive = true;
R_RenderActorView (actor, dontmaplines);
RenderTarget = screen;
bRenderingToCanvas = false;
R_ExecuteSetViewSize ();
screen->Lock (true);
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
R_SetupBuffer ();
screen->Unlock ();
viewactive = savedviewactive;
}
//==========================================================================
//
// R_MultiresInit
//
// Called from V_SetResolution()
//
//==========================================================================
void R_MultiresInit ()
{
R_PlaneInitData ();
}
//==========================================================================
//
// STAT fps
//
// Displays statistics about rendering times
//
//==========================================================================
extern cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles;
extern cycle_t FrameCycles;
ADD_STAT (fps)
{
FString out;
out.Format("frame=%04.1f ms walls=%04.1f ms planes=%04.1f ms masked=%04.1f ms",
FrameCycles.TimeMS(), WallCycles.TimeMS(), PlaneCycles.TimeMS(), MaskedCycles.TimeMS());
return out;
}
static double f_acc, w_acc,p_acc,m_acc;
static int acc_c;
ADD_STAT (fps_accumulated)
{
f_acc += FrameCycles.TimeMS();
w_acc += WallCycles.TimeMS();
p_acc += PlaneCycles.TimeMS();
m_acc += MaskedCycles.TimeMS();
acc_c++;
FString out;
out.Format("frame=%04.1f ms walls=%04.1f ms planes=%04.1f ms masked=%04.1f ms %d counts",
f_acc/acc_c, w_acc/acc_c, p_acc/acc_c, m_acc/acc_c, acc_c);
Printf(PRINT_LOG, "%s\n", out.GetChars());
return out;
}
//==========================================================================
//
// STAT wallcycles
//
// Displays the minimum number of cycles spent drawing walls
//
//==========================================================================
static double bestwallcycles = HUGE_VAL;
ADD_STAT (wallcycles)
{
FString out;
double cycles = WallCycles.Time();
if (cycles && cycles < bestwallcycles)
bestwallcycles = cycles;
out.Format ("%g", bestwallcycles);
return out;
}
//==========================================================================
//
// CCMD clearwallcycles
//
// Resets the count of minimum wall drawing cycles
//
//==========================================================================
CCMD (clearwallcycles)
{
bestwallcycles = HUGE_VAL;
}
#if 1
// To use these, also uncomment the clock/unclock in wallscan
static double bestscancycles = HUGE_VAL;
ADD_STAT (scancycles)
{
FString out;
double scancycles = WallScanCycles.Time();
if (scancycles && scancycles < bestscancycles)
bestscancycles = scancycles;
out.Format ("%g", bestscancycles);
return out;
}
CCMD (clearscancycles)
{
bestscancycles = HUGE_VAL;
}
#endif