2008-01-27 11:25:03 +00:00
|
|
|
// 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:
|
|
|
|
// Refresh of things, i.e. objects represented by sprites.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2009-12-18 09:11:54 +00:00
|
|
|
#include <algorithm>
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "doomdef.h"
|
|
|
|
#include "m_swap.h"
|
|
|
|
#include "m_argv.h"
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "r_local.h"
|
|
|
|
#include "c_console.h"
|
|
|
|
#include "c_cvars.h"
|
|
|
|
#include "c_dispatch.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "sc_man.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "sbar.h"
|
|
|
|
#include "gi.h"
|
2008-06-28 13:29:59 +00:00
|
|
|
#include "r_sky.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "cmdlib.h"
|
|
|
|
#include "g_level.h"
|
|
|
|
#include "d_net.h"
|
|
|
|
#include "colormatcher.h"
|
|
|
|
#include "d_netinf.h"
|
|
|
|
#include "r_bsp.h"
|
|
|
|
#include "r_plane.h"
|
|
|
|
#include "r_segs.h"
|
|
|
|
#include "v_palette.h"
|
2009-09-20 20:51:32 +00:00
|
|
|
#include "r_translate.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
extern fixed_t globaluclip, globaldclip;
|
|
|
|
|
|
|
|
|
|
|
|
#define MINZ (2048*4)
|
|
|
|
#define BASEYCENTER (100)
|
|
|
|
|
|
|
|
EXTERN_CVAR (Bool, st_scale)
|
|
|
|
CVAR (Bool, r_drawfuzz, true, CVAR_ARCHIVE)
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Sprite rotation 0 is facing the viewer,
|
|
|
|
// rotation 1 is one angle turn CLOCKWISE around the axis.
|
|
|
|
// This is not the same as the angle,
|
|
|
|
// which increases counter clockwise (protractor).
|
|
|
|
//
|
|
|
|
fixed_t pspritexscale;
|
|
|
|
fixed_t pspriteyscale;
|
|
|
|
fixed_t pspritexiscale;
|
|
|
|
fixed_t sky1scale; // [RH] Sky 1 scale factor
|
|
|
|
fixed_t sky2scale; // [RH] Sky 2 scale factor
|
|
|
|
|
2009-09-20 20:51:32 +00:00
|
|
|
vissprite_t *VisPSprites[NUMPSPRITES];
|
|
|
|
int VisPSpritesX1[NUMPSPRITES];
|
|
|
|
FDynamicColormap *VisPSpritesBaseColormap[NUMPSPRITES];
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
static int spriteshade;
|
|
|
|
|
|
|
|
TArray<WORD> ParticlesInSubsec;
|
|
|
|
|
|
|
|
// constant arrays
|
|
|
|
// used for psprite clipping and initializing clipping
|
|
|
|
short zeroarray[MAXWIDTH];
|
|
|
|
short screenheightarray[MAXWIDTH];
|
|
|
|
|
|
|
|
#define MAX_SPRITE_FRAMES 29 // [RH] Macro-ized as in BOOM.
|
|
|
|
|
|
|
|
|
|
|
|
CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites?
|
|
|
|
|
|
|
|
//
|
|
|
|
// INITIALIZATION FUNCTIONS
|
|
|
|
//
|
|
|
|
|
|
|
|
// variables used to look up
|
|
|
|
// and range check thing_t sprites patches
|
|
|
|
TArray<spritedef_t> sprites;
|
|
|
|
TArray<spriteframe_t> SpriteFrames;
|
|
|
|
DWORD NumStdSprites; // The first x sprites that don't belong to skins.
|
|
|
|
|
|
|
|
struct spriteframewithrotate : public spriteframe_t
|
|
|
|
{
|
|
|
|
int rotate;
|
|
|
|
}
|
|
|
|
sprtemp[MAX_SPRITE_FRAMES];
|
|
|
|
int maxframe;
|
|
|
|
char* spritename;
|
|
|
|
|
|
|
|
// [RH] skin globals
|
|
|
|
FPlayerSkin *skins;
|
|
|
|
size_t numskins;
|
|
|
|
BYTE OtherGameSkinRemap[256];
|
|
|
|
PalEntry OtherGameSkinPalette[256];
|
|
|
|
|
|
|
|
// [RH] particle globals
|
|
|
|
WORD NumParticles;
|
|
|
|
WORD ActiveParticles;
|
|
|
|
WORD InactiveParticles;
|
|
|
|
particle_t *Particles;
|
|
|
|
|
|
|
|
CVAR (Bool, r_particles, true, 0);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_InstallSpriteLump
|
|
|
|
// Local function for R_InitSprites.
|
|
|
|
//
|
|
|
|
// [RH] Removed checks for coexistance of rotation 0 with other
|
|
|
|
// rotations and made it look more like BOOM's version.
|
|
|
|
//
|
2008-06-28 13:29:59 +00:00
|
|
|
static void R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool flipped)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
unsigned rotation;
|
|
|
|
|
|
|
|
if (rot >= '0' && rot <= '9')
|
|
|
|
{
|
|
|
|
rotation = rot - '0';
|
|
|
|
}
|
|
|
|
else if (rot >= 'A')
|
|
|
|
{
|
|
|
|
rotation = rot - 'A' + 10;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rotation = 17;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (frame >= MAX_SPRITE_FRAMES || rotation > 16)
|
|
|
|
I_FatalError ("R_InstallSpriteLump: Bad frame characters in lump %s", TexMan[lump]->Name);
|
|
|
|
|
|
|
|
if ((int)frame > maxframe)
|
|
|
|
maxframe = frame;
|
|
|
|
|
|
|
|
if (rotation == 0)
|
|
|
|
{
|
|
|
|
// the lump should be used for all rotations
|
|
|
|
// false=0, true=1, but array initialised to -1
|
|
|
|
// allows doom to have a "no value set yet" boolean value!
|
|
|
|
int r;
|
|
|
|
|
|
|
|
for (r = 14; r >= 0; r -= 2)
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sprtemp[frame].Texture[r].isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
sprtemp[frame].Texture[r] = lump;
|
2008-01-27 11:25:03 +00:00
|
|
|
if (flipped)
|
|
|
|
{
|
|
|
|
sprtemp[frame].Flip |= 1 << r;
|
|
|
|
}
|
|
|
|
sprtemp[frame].rotate = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (rotation <= 8)
|
|
|
|
{
|
|
|
|
rotation = (rotation - 1) * 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rotation = (rotation - 9) * 2 + 1;
|
|
|
|
}
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sprtemp[frame].Texture[rotation].isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// the lump is only used for one rotation
|
|
|
|
sprtemp[frame].Texture[rotation] = lump;
|
|
|
|
if (flipped)
|
|
|
|
{
|
|
|
|
sprtemp[frame].Flip |= 1 << rotation;
|
|
|
|
}
|
|
|
|
sprtemp[frame].rotate = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// [RH] Seperated out of R_InitSpriteDefs()
|
|
|
|
static void R_InstallSprite (int num)
|
|
|
|
{
|
|
|
|
int frame;
|
|
|
|
int framestart;
|
|
|
|
int rot;
|
|
|
|
// int undefinedFix;
|
|
|
|
|
|
|
|
if (maxframe == -1)
|
|
|
|
{
|
|
|
|
sprites[num].numframes = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
maxframe++;
|
|
|
|
|
|
|
|
// [RH] If any frames are undefined, but there are some defined frames, map
|
|
|
|
// them to the first defined frame. This is a fix for Doom Raider, which actually
|
|
|
|
// worked with ZDoom 2.0.47, because of a bug here. It does not define frames A,
|
|
|
|
// B, or C for the sprite PSBG, but because I had sprtemp[].rotate defined as a
|
|
|
|
// bool, this code never detected that it was not actually present. After switching
|
|
|
|
// to the unified texture system, this caused it to crash while loading the wad.
|
|
|
|
|
|
|
|
// [RH] Let undefined frames actually be blank because LWM uses this in at least
|
|
|
|
// one of her wads.
|
|
|
|
// for (frame = 0; frame < maxframe && sprtemp[frame].rotate == -1; ++frame)
|
|
|
|
// { }
|
|
|
|
//
|
|
|
|
// undefinedFix = frame;
|
|
|
|
|
|
|
|
for (frame = 0; frame < maxframe; ++frame)
|
|
|
|
{
|
|
|
|
switch (sprtemp[frame].rotate)
|
|
|
|
{
|
|
|
|
case -1:
|
|
|
|
// no rotations were found for that frame at all
|
|
|
|
//I_FatalError ("R_InstallSprite: No patches found for %s frame %c", sprites[num].name, frame+'A');
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
// only the first rotation is needed
|
|
|
|
for (rot = 1; rot < 16; ++rot)
|
|
|
|
{
|
|
|
|
sprtemp[frame].Texture[rot] = sprtemp[frame].Texture[0];
|
|
|
|
}
|
|
|
|
// If the frame is flipped, they all should be
|
|
|
|
if (sprtemp[frame].Flip & 1)
|
|
|
|
{
|
|
|
|
sprtemp[frame].Flip = 0xFFFF;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
// must have all 8 frame pairs
|
|
|
|
for (rot = 0; rot < 8; ++rot)
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sprtemp[frame].Texture[rot*2+1].isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sprtemp[frame].Texture[rot*2+1] = sprtemp[frame].Texture[rot*2];
|
|
|
|
if (sprtemp[frame].Flip & (1 << (rot*2)))
|
|
|
|
{
|
|
|
|
sprtemp[frame].Flip |= 1 << (rot*2+1);
|
|
|
|
}
|
|
|
|
}
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sprtemp[frame].Texture[rot*2].isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sprtemp[frame].Texture[rot*2] = sprtemp[frame].Texture[rot*2+1];
|
|
|
|
if (sprtemp[frame].Flip & (1 << (rot*2+1)))
|
|
|
|
{
|
|
|
|
sprtemp[frame].Flip |= 1 << (rot*2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
for (rot = 0; rot < 16; ++rot)
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!sprtemp[frame].Texture[rot].isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
I_FatalError ("R_InstallSprite: Sprite %s frame %c is missing rotations",
|
|
|
|
sprites[num].name, frame+'A');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (frame = 0; frame < maxframe; ++frame)
|
|
|
|
{
|
|
|
|
if (sprtemp[frame].rotate == -1)
|
|
|
|
{
|
|
|
|
memset (&sprtemp[frame], 0, sizeof(sprtemp[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// allocate space for the frames present and copy sprtemp to it
|
|
|
|
sprites[num].numframes = maxframe;
|
|
|
|
sprites[num].spriteframes = WORD(framestart = SpriteFrames.Reserve (maxframe));
|
|
|
|
for (frame = 0; frame < maxframe; ++frame)
|
|
|
|
{
|
|
|
|
memcpy (SpriteFrames[framestart+frame].Texture, sprtemp[frame].Texture, sizeof(sprtemp[frame].Texture));
|
|
|
|
SpriteFrames[framestart+frame].Flip = sprtemp[frame].Flip;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Let the textures know about the rotations
|
|
|
|
for (frame = 0; frame < maxframe; ++frame)
|
|
|
|
{
|
|
|
|
if (sprtemp[frame].rotate == 1)
|
|
|
|
{
|
|
|
|
for (int rot = 0; rot < 16; ++rot)
|
|
|
|
{
|
|
|
|
TexMan[sprtemp[frame].Texture[rot]]->Rotations = framestart + frame;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_InitSpriteDefs
|
|
|
|
// Pass a null terminated list of sprite names
|
|
|
|
// (4 chars exactly) to be used.
|
|
|
|
// Builds the sprite rotation matrices to account
|
|
|
|
// for horizontally flipped sprites.
|
|
|
|
// Will report an error if the lumps are inconsistant.
|
|
|
|
// Only called at startup.
|
|
|
|
//
|
|
|
|
// Sprite lump names are 4 characters for the actor,
|
|
|
|
// a letter for the frame, and a number for the rotation.
|
|
|
|
// A sprite that is flippable will have an additional
|
|
|
|
// letter/number appended.
|
|
|
|
// The rotation character can be 0 to signify no rotations.
|
|
|
|
//
|
|
|
|
void R_InitSpriteDefs ()
|
|
|
|
{
|
|
|
|
struct Hasher
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
int Head, Next;
|
2008-01-27 11:25:03 +00:00
|
|
|
} *hashes;
|
|
|
|
unsigned int i, max;
|
|
|
|
DWORD intname;
|
|
|
|
|
|
|
|
// Create a hash table to speed up the process
|
|
|
|
max = TexMan.NumTextures();
|
|
|
|
hashes = (Hasher *)alloca (sizeof(Hasher) * max);
|
|
|
|
for (i = 0; i < max; ++i)
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
hashes[i].Head = -1;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
for (i = 0; i < max; ++i)
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
FTexture *tex = TexMan.ByIndex(i);
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
if (tex->UseType == FTexture::TEX_Sprite && strlen(tex->Name) >= 6)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
DWORD bucket = tex->dwName % max;
|
2008-01-27 11:25:03 +00:00
|
|
|
hashes[i].Next = hashes[bucket].Head;
|
|
|
|
hashes[bucket].Head = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// scan all the lump names for each of the names, noting the highest frame letter.
|
|
|
|
for (i = 0; i < sprites.Size(); ++i)
|
|
|
|
{
|
|
|
|
memset (sprtemp, 0xFF, sizeof(sprtemp));
|
|
|
|
for (int j = 0; j < MAX_SPRITE_FRAMES; ++j)
|
|
|
|
{
|
|
|
|
sprtemp[j].Flip = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
maxframe = -1;
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
intname = sprites[i].dwName;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// scan the lumps, filling in the frames for whatever is found
|
|
|
|
int hash = hashes[intname % max].Head;
|
2008-06-28 13:29:59 +00:00
|
|
|
while (hash != -1)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
FTexture *tex = TexMan[hash];
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
if (tex->dwName == intname)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
R_InstallSpriteLump (FTextureID(hash), tex->Name[4] - 'A', tex->Name[5], false);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (tex->Name[6])
|
2008-06-28 13:29:59 +00:00
|
|
|
R_InstallSpriteLump (FTextureID(hash), tex->Name[6] - 'A', tex->Name[7], true);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
hash = hashes[hash].Next;
|
|
|
|
}
|
|
|
|
|
|
|
|
R_InstallSprite ((int)i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH]
|
|
|
|
// R_InitSkins
|
|
|
|
// Reads in everything applicable to a skin. The skins should have already
|
|
|
|
// been counted and had their identifiers assigned to namespaces.
|
|
|
|
//
|
|
|
|
#define NUMSKINSOUNDS 17
|
|
|
|
static const char *skinsoundnames[NUMSKINSOUNDS][2] =
|
|
|
|
{ // The *painXXX sounds must be the first four
|
|
|
|
{ "dsplpain", "*pain100" },
|
|
|
|
{ "dsplpain", "*pain75" },
|
|
|
|
{ "dsplpain", "*pain50" },
|
|
|
|
{ "dsplpain", "*pain25" },
|
|
|
|
{ "dsplpain", "*poison" },
|
|
|
|
|
|
|
|
{ "dsoof", "*grunt" },
|
|
|
|
{ "dsoof", "*land" },
|
|
|
|
|
|
|
|
{ "dspldeth", "*death" },
|
|
|
|
{ "dspldeth", "*wimpydeath" },
|
|
|
|
|
|
|
|
{ "dspdiehi", "*xdeath" },
|
|
|
|
{ "dspdiehi", "*crazydeath" },
|
|
|
|
|
|
|
|
{ "dsnoway", "*usefail" },
|
|
|
|
{ "dsnoway", "*puzzfail" },
|
|
|
|
|
|
|
|
{ "dsslop", "*gibbed" },
|
|
|
|
{ "dsslop", "*splat" },
|
|
|
|
|
|
|
|
{ "dspunch", "*fist" },
|
|
|
|
{ "dsjump", "*jump" }
|
|
|
|
};
|
|
|
|
|
2009-02-21 17:07:32 +00:00
|
|
|
/*
|
2008-01-27 11:25:03 +00:00
|
|
|
static int STACK_ARGS skinsorter (const void *a, const void *b)
|
|
|
|
{
|
|
|
|
return stricmp (((FPlayerSkin *)a)->name, ((FPlayerSkin *)b)->name);
|
|
|
|
}
|
2009-02-21 17:07:32 +00:00
|
|
|
*/
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
void R_InitSkins (void)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
FSoundID playersoundrefs[NUMSKINSOUNDS];
|
2008-01-27 11:25:03 +00:00
|
|
|
spritedef_t temp;
|
|
|
|
int sndlumps[NUMSKINSOUNDS];
|
|
|
|
char key[65];
|
|
|
|
DWORD intname, crouchname;
|
|
|
|
size_t i;
|
|
|
|
int j, k, base;
|
|
|
|
int lastlump;
|
|
|
|
int aliasid;
|
|
|
|
bool remove;
|
|
|
|
const PClass *basetype, *transtype;
|
|
|
|
|
|
|
|
key[sizeof(key)-1] = 0;
|
|
|
|
i = PlayerClasses.Size () - 1;
|
|
|
|
lastlump = 0;
|
|
|
|
|
|
|
|
for (j = 0; j < NUMSKINSOUNDS; ++j)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
playersoundrefs[j] = skinsoundnames[j][1];
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
while ((base = Wads.FindLump ("S_SKIN", &lastlump, true)) != -1)
|
|
|
|
{
|
|
|
|
// The player sprite has 23 frames. This means that the S_SKIN
|
|
|
|
// marker needs a minimum of 23 lumps after it.
|
|
|
|
if (base >= Wads.GetNumLumps() - 23 || base == -1)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
for (j = 0; j < NUMSKINSOUNDS; j++)
|
|
|
|
sndlumps[j] = -1;
|
|
|
|
skins[i].namespc = Wads.GetLumpNamespace (base);
|
|
|
|
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
FScanner sc(base);
|
2008-01-27 11:25:03 +00:00
|
|
|
intname = 0;
|
|
|
|
crouchname = 0;
|
|
|
|
|
|
|
|
remove = false;
|
|
|
|
basetype = NULL;
|
|
|
|
transtype = NULL;
|
|
|
|
|
|
|
|
// Data is stored as "key = data".
|
2008-01-27 15:34:47 +00:00
|
|
|
while (sc.GetString ())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
strncpy (key, sc.String, sizeof(key)-1);
|
|
|
|
if (!sc.GetString() || sc.String[0] != '=')
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-14 17:49:11 +00:00
|
|
|
Printf (PRINT_BOLD, "Bad format for skin %d: %s\n", (int)i, key);
|
2008-01-27 11:25:03 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-01-27 15:34:47 +00:00
|
|
|
sc.GetString ();
|
2008-01-27 11:25:03 +00:00
|
|
|
if (0 == stricmp (key, "name"))
|
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
strncpy (skins[i].name, sc.String, 16);
|
2008-01-27 11:25:03 +00:00
|
|
|
for (j = 0; (size_t)j < i; j++)
|
|
|
|
{
|
|
|
|
if (stricmp (skins[i].name, skins[j].name) == 0)
|
|
|
|
{
|
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 (skins[i].name, countof(skins[i].name), "skin%d", (int)i);
|
2008-01-27 11:25:03 +00:00
|
|
|
Printf (PRINT_BOLD, "Skin %s duplicated as %s\n",
|
|
|
|
skins[j].name, skins[i].name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "sprite"))
|
|
|
|
{
|
|
|
|
for (j = 3; j >= 0; j--)
|
2008-01-27 15:34:47 +00:00
|
|
|
sc.String[j] = toupper (sc.String[j]);
|
|
|
|
intname = *((DWORD *)sc.String);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "crouchsprite"))
|
|
|
|
{
|
|
|
|
for (j = 3; j >= 0; j--)
|
2008-01-27 15:34:47 +00:00
|
|
|
sc.String[j] = toupper (sc.String[j]);
|
|
|
|
crouchname = *((DWORD *)sc.String);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "face"))
|
|
|
|
{
|
|
|
|
for (j = 2; j >= 0; j--)
|
2008-01-27 15:34:47 +00:00
|
|
|
skins[i].face[j] = toupper (sc.String[j]);
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
skins[i].face[3] = '\0';
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "gender"))
|
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
skins[i].gender = D_GenderToInt (sc.String);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "scale"))
|
|
|
|
{
|
2008-05-01 21:45:22 +00:00
|
|
|
skins[i].ScaleX = clamp<fixed_t> (FLOAT2FIXED(atof (sc.String)), 1, 256*FRACUNIT);
|
|
|
|
skins[i].ScaleY = skins[i].ScaleX;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "game"))
|
|
|
|
{
|
|
|
|
if (gameinfo.gametype == GAME_Heretic)
|
|
|
|
basetype = PClass::FindClass (NAME_HereticPlayer);
|
|
|
|
else if (gameinfo.gametype == GAME_Strife)
|
|
|
|
basetype = PClass::FindClass (NAME_StrifePlayer);
|
|
|
|
else
|
|
|
|
basetype = PClass::FindClass (NAME_DoomPlayer);
|
|
|
|
|
|
|
|
transtype = basetype;
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
if (stricmp (sc.String, "heretic") == 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-09-01 19:08:19 +00:00
|
|
|
if (gameinfo.gametype & GAME_DoomChex)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
transtype = PClass::FindClass (NAME_HereticPlayer);
|
|
|
|
skins[i].othergame = true;
|
|
|
|
}
|
|
|
|
else if (gameinfo.gametype != GAME_Heretic)
|
|
|
|
{
|
|
|
|
remove = true;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 15:34:47 +00:00
|
|
|
else if (stricmp (sc.String, "strife") == 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (gameinfo.gametype != GAME_Strife)
|
|
|
|
{
|
|
|
|
remove = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (gameinfo.gametype == GAME_Heretic)
|
|
|
|
{
|
|
|
|
transtype = PClass::FindClass (NAME_DoomPlayer);
|
|
|
|
skins[i].othergame = true;
|
|
|
|
}
|
2008-09-01 19:08:19 +00:00
|
|
|
else if (!(gameinfo.gametype & GAME_DoomChex))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
remove = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (remove)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (0 == stricmp (key, "class"))
|
|
|
|
{ // [GRB] Define the skin for a specific player class
|
2008-01-27 15:34:47 +00:00
|
|
|
int pclass = D_PlayerClassToInt (sc.String);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (pclass < 0)
|
|
|
|
{
|
|
|
|
remove = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
basetype = transtype = PlayerClasses[pclass].Type;
|
|
|
|
}
|
|
|
|
else if (key[0] == '*')
|
|
|
|
{ // Player sound replacment (ZDoom extension)
|
2008-01-27 15:34:47 +00:00
|
|
|
int lump = Wads.CheckNumForName (sc.String, skins[i].namespc);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (lump == -1)
|
|
|
|
{
|
2008-03-30 08:34:44 +00:00
|
|
|
lump = Wads.CheckNumForFullName (sc.String, true, ns_sounds);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
if (lump != -1)
|
|
|
|
{
|
|
|
|
if (stricmp (key, "*pain") == 0)
|
|
|
|
{ // Replace all pain sounds in one go
|
|
|
|
aliasid = S_AddPlayerSound (skins[i].name, skins[i].gender,
|
|
|
|
playersoundrefs[0], lump, true);
|
|
|
|
for (int l = 3; l > 0; --l)
|
|
|
|
{
|
|
|
|
S_AddPlayerSoundExisting (skins[i].name, skins[i].gender,
|
|
|
|
playersoundrefs[l], aliasid, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int sndref = S_FindSoundNoHash (key);
|
|
|
|
if (sndref != 0)
|
|
|
|
{
|
|
|
|
S_AddPlayerSound (skins[i].name, skins[i].gender, sndref, lump, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (j = 0; j < NUMSKINSOUNDS; j++)
|
|
|
|
{
|
|
|
|
if (stricmp (key, skinsoundnames[j][0]) == 0)
|
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
sndlumps[j] = Wads.CheckNumForName (sc.String, skins[i].namespc);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (sndlumps[j] == -1)
|
|
|
|
{ // Replacement not found, try finding it in the global namespace
|
2008-03-30 08:34:44 +00:00
|
|
|
sndlumps[j] = Wads.CheckNumForFullName (sc.String, true, ns_sounds);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//if (j == 8)
|
2008-01-27 15:34:47 +00:00
|
|
|
// Printf ("Funny info for skin %i: %s = %s\n", i, key, sc.String);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [GRB] Assume Doom skin by default
|
|
|
|
if (!remove && basetype == NULL)
|
|
|
|
{
|
2008-09-01 19:08:19 +00:00
|
|
|
if (gameinfo.gametype & GAME_DoomChex)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
basetype = transtype = PClass::FindClass (NAME_DoomPlayer);
|
|
|
|
}
|
|
|
|
else if (gameinfo.gametype == GAME_Heretic)
|
|
|
|
{
|
|
|
|
basetype = PClass::FindClass (NAME_HereticPlayer);
|
|
|
|
transtype = PClass::FindClass (NAME_DoomPlayer);
|
|
|
|
skins[i].othergame = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
remove = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!remove)
|
|
|
|
{
|
|
|
|
skins[i].range0start = transtype->Meta.GetMetaInt (APMETA_ColorRange) & 0xff;
|
|
|
|
skins[i].range0end = transtype->Meta.GetMetaInt (APMETA_ColorRange) >> 8;
|
|
|
|
|
|
|
|
remove = true;
|
|
|
|
for (j = 0; j < (int)PlayerClasses.Size (); j++)
|
|
|
|
{
|
|
|
|
const PClass *type = PlayerClasses[j].Type;
|
|
|
|
|
|
|
|
if (type->IsDescendantOf (basetype) &&
|
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
|
|
|
GetDefaultByType (type)->SpawnState->sprite == GetDefaultByType (basetype)->SpawnState->sprite &&
|
2008-01-27 11:25:03 +00:00
|
|
|
type->Meta.GetMetaInt (APMETA_ColorRange) == basetype->Meta.GetMetaInt (APMETA_ColorRange))
|
|
|
|
{
|
|
|
|
PlayerClasses[j].Skins.Push ((int)i);
|
|
|
|
remove = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!remove)
|
|
|
|
{
|
|
|
|
if (skins[i].name[0] == 0)
|
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 (skins[i].name, countof(skins[i].name), "skin%d", (int)i);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Now collect the sprite frames for this skin. If the sprite name was not
|
|
|
|
// specified, use whatever immediately follows the specifier lump.
|
|
|
|
if (intname == 0)
|
|
|
|
{
|
|
|
|
char name[9];
|
|
|
|
Wads.GetLumpName (name, base+1);
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
memcpy(&intname, name, 4);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int basens = Wads.GetLumpNamespace(base);
|
|
|
|
|
|
|
|
for(int spr = 0; spr<2; spr++)
|
|
|
|
{
|
|
|
|
memset (sprtemp, 0xFFFF, sizeof(sprtemp));
|
|
|
|
for (k = 0; k < MAX_SPRITE_FRAMES; ++k)
|
|
|
|
{
|
|
|
|
sprtemp[k].Flip = 0;
|
|
|
|
}
|
|
|
|
maxframe = -1;
|
|
|
|
|
|
|
|
if (spr == 1)
|
|
|
|
{
|
|
|
|
if (crouchname !=0 && crouchname != intname)
|
|
|
|
{
|
|
|
|
intname = crouchname;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
skins[i].crouchsprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (k = base + 1; Wads.GetLumpNamespace(k) == basens; k++)
|
|
|
|
{
|
|
|
|
char lname[9];
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
DWORD lnameint;
|
2008-01-27 11:25:03 +00:00
|
|
|
Wads.GetLumpName (lname, k);
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
memcpy(&lnameint, lname, 4);
|
|
|
|
if (lnameint == intname)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum = TexMan.CreateTexture(k, FTexture::TEX_SkinSprite);
|
2008-01-27 11:25:03 +00:00
|
|
|
R_InstallSpriteLump (picnum, lname[4] - 'A', lname[5], false);
|
|
|
|
|
|
|
|
if (lname[6])
|
|
|
|
R_InstallSpriteLump (picnum, lname[6] - 'A', lname[7], true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (spr == 0 && maxframe <= 0)
|
|
|
|
{
|
2008-05-14 17:49:11 +00:00
|
|
|
Printf (PRINT_BOLD, "Skin %s (#%d) has no frames. Removing.\n", skins[i].name, (int)i);
|
2008-01-27 11:25:03 +00:00
|
|
|
remove = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Wads.GetLumpName (temp.name, base+1);
|
|
|
|
temp.name[4] = 0;
|
|
|
|
int sprno = (int)sprites.Push (temp);
|
|
|
|
if (spr==0) skins[i].sprite = sprno;
|
|
|
|
else skins[i].crouchsprite = sprno;
|
|
|
|
R_InstallSprite (sprno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (remove)
|
|
|
|
{
|
|
|
|
if (i < numskins-1)
|
|
|
|
memmove (&skins[i], &skins[i+1], sizeof(skins[0])*(numskins-i-1));
|
|
|
|
i--;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Register any sounds this skin provides
|
|
|
|
aliasid = 0;
|
|
|
|
for (j = 0; j < NUMSKINSOUNDS; j++)
|
|
|
|
{
|
|
|
|
if (sndlumps[j] != -1)
|
|
|
|
{
|
|
|
|
if (j == 0 || sndlumps[j] != sndlumps[j-1])
|
|
|
|
{
|
|
|
|
aliasid = S_AddPlayerSound (skins[i].name, skins[i].gender,
|
|
|
|
playersoundrefs[j], sndlumps[j], true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
S_AddPlayerSoundExisting (skins[i].name, skins[i].gender,
|
|
|
|
playersoundrefs[j], aliasid, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make sure face prefix is a full 3 chars
|
|
|
|
if (skins[i].face[1] == 0 || skins[i].face[2] == 0)
|
|
|
|
{
|
|
|
|
skins[i].face[0] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (numskins > PlayerClasses.Size ())
|
|
|
|
{ // The sound table may have changed, so rehash it.
|
|
|
|
S_HashSounds ();
|
|
|
|
S_ShrinkPlayerSoundLists ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Find a skin by name
|
|
|
|
int R_FindSkin (const char *name, int pclass)
|
|
|
|
{
|
|
|
|
if (stricmp ("base", name) == 0)
|
|
|
|
{
|
|
|
|
return pclass;
|
|
|
|
}
|
|
|
|
|
2009-02-21 17:07:32 +00:00
|
|
|
for (unsigned i = PlayerClasses.Size(); i < numskins; i++)
|
|
|
|
{
|
|
|
|
if (strnicmp (skins[i].name, name, 16) == 0)
|
|
|
|
{
|
- version bump to 1.2.0.
- fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct.
- fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright.
Update to ZDoom r1456 (2.3.0 plus one additional fix):
- Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true
floor and ceiling heights. Otherwise the actor will fall right through
3DMidtex textures (and 3D-floors.)
- Fixed: The TeleporterBeacon tried to enter its See state rather than its
Drop state. Also changed it to fade out when it's done rather than
disappearing abruptly.
- Fixed: Strife's quest based line actions also work in Deathmatch.
- Fixed: Gravity application was not correct. For actors with no vertical
momentum the initial pull is supposed to be twice as strong as when
vertical movement already takes place.
- added invquery CCMD like in Strife. Also removed all underscores from the
tag strings so that they can be printed properly.
- Fixed: Skill baby was missing 'autousehealth' for all games.
- Added a new CVAR: sv_disableautohealth
- Autouse of health items is no longer hardwired to the default item classes.
There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small
Raven health item, 2 a large Raven health item and 3 a Strife item.
- Removed an early-out in wallscan_striped() that is invalid when drawing a
skybox.
- fixed: nextmap and nextsecret CCMDs set skill to 0.
- fixed: level.flags2 was not stored in savegames. Also bumped min. savegame
version and removed old compatibility handlings.
- The SFX Reverb unit is now moved so that it serves as an input to the water
effect rather than as an input to the ChannelGroup Target Unit. This means
the water effect is now applied after any room reverb, rather than in
parallel with it.
- Fixed: UI sounds should not have reverb applied to them.
- Removed the delay for starting all sounds from one tic at exactly the same
DSP position. Without also synchronizing the stopping of sounds, it can
cause problems with things like the chainsaw where the sound is stopped and
immediately restarted, causing occassional gaps between the stopping of the
sound and the starting of the new one. (I added the start synchronization to
combat flanging of paired moving polyobjects when moving around, but I think
just removing velocity from the player for sound calculations takes care of
that well enough.)
- Added GCC headers for intptr_t to tarray.h.
- Added MF5_PAINLESS flag for projectiles that don't make the target go into
the pain state.
- Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space-
efficient.
- Fixed: player->oldbuttons was copied from the current button set at the end
of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput.
- Fixed: The map name display on the automap was incomplete.
- Added FakeInventory.Respawns DECORATe property
- Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the
conversation by pressing Escape.
- added ML_BLOCKPROJECTILE flag to lines.
- Fixed: With opl_onechip set the second OPL chip was never set to anything valid
so it contained an invalid pointer. There were also a few other places that
simply assumed that the second chip is set to something valid.
- Fixed: NPCs which are engaged in a conversation should not move.
- Fixed: Player movement animation was not stopped when starting a conversation.
- Added selective compression of network packets. Interestingly, most packets
don't actually compress all that well, even the ones that aren't too short
to possibly compress. (Maybe make the whole thing one long, never-ending
zlib data stream with Z_SYNC_FLUSH used to chunk things at packet
boundaries? That would probably help the compression ratio, but it would
require changing the way the netcode determines sequence, which would be
a much more invasive change.)
- Fixed: Heretic's fullscreen HUD crashed when the player had armor without
a valid icon.
- Fixed: The StrifePlayer was missing a RunHealth setting.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
|
|
|
if (PlayerClasses[pclass].CheckSkin (i))
|
2009-02-21 17:07:32 +00:00
|
|
|
return i;
|
|
|
|
else
|
|
|
|
return pclass;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
return pclass;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] List the names of all installed skins
|
|
|
|
CCMD (skins)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = PlayerClasses.Size ()-1; i < (int)numskins; i++)
|
|
|
|
Printf ("% 3d %s\n", i-PlayerClasses.Size ()+1, skins[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// GAME FUNCTIONS
|
|
|
|
//
|
|
|
|
int MaxVisSprites;
|
|
|
|
vissprite_t **vissprites;
|
|
|
|
vissprite_t **firstvissprite;
|
|
|
|
vissprite_t **vissprite_p;
|
|
|
|
vissprite_t **lastvissprite;
|
|
|
|
int newvissprite;
|
|
|
|
|
|
|
|
static vissprite_t **spritesorter;
|
|
|
|
static int spritesortersize = 0;
|
|
|
|
static int vsprcount;
|
|
|
|
|
|
|
|
static void R_CreateSkinTranslation (const char *palname)
|
|
|
|
{
|
|
|
|
FMemLump lump = Wads.ReadLump (palname);
|
|
|
|
const BYTE *otherPal = (BYTE *)lump.GetMem();
|
|
|
|
|
|
|
|
for (int i = 0; i < 256; ++i)
|
|
|
|
{
|
|
|
|
OtherGameSkinRemap[i] = ColorMatcher.Pick (otherPal[0], otherPal[1], otherPal[2]);
|
|
|
|
OtherGameSkinPalette[i] = PalEntry(otherPal[0], otherPal[1], otherPal[2]);
|
|
|
|
otherPal += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_InitSprites
|
|
|
|
// Called at program start.
|
|
|
|
//
|
|
|
|
void R_InitSprites ()
|
|
|
|
{
|
|
|
|
int lump, lastlump;
|
|
|
|
unsigned int i, j;
|
|
|
|
|
|
|
|
clearbufshort (zeroarray, MAXWIDTH, 0);
|
|
|
|
|
|
|
|
// [RH] Create a standard translation to map skins between Heretic and Doom
|
2008-09-01 19:08:19 +00:00
|
|
|
if (gameinfo.gametype == GAME_DoomChex)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
R_CreateSkinTranslation ("SPALHTIC");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
R_CreateSkinTranslation ("SPALDOOM");
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Count the number of skins.
|
|
|
|
numskins = PlayerClasses.Size ();
|
|
|
|
lastlump = 0;
|
|
|
|
while ((lump = Wads.FindLump ("S_SKIN", &lastlump, true)) != -1)
|
|
|
|
{
|
|
|
|
numskins++;
|
|
|
|
}
|
|
|
|
|
2010-12-15 16:32:37 +00:00
|
|
|
SpriteFrames.Clear();
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// [RH] Do some preliminary setup
|
2010-12-15 16:32:37 +00:00
|
|
|
if (skins != NULL) delete [] skins;
|
2008-01-27 11:25:03 +00:00
|
|
|
skins = new FPlayerSkin[numskins];
|
|
|
|
memset (skins, 0, sizeof(*skins) * numskins);
|
|
|
|
for (i = 0; i < numskins; i++)
|
|
|
|
{ // Assume Doom skin by default
|
|
|
|
const PClass *type = PlayerClasses[0].Type;
|
|
|
|
skins[i].range0start = type->Meta.GetMetaInt (APMETA_ColorRange) & 255;
|
|
|
|
skins[i].range0end = type->Meta.GetMetaInt (APMETA_ColorRange) >> 8;
|
2008-05-01 21:45:22 +00:00
|
|
|
skins[i].ScaleX = GetDefaultByType (type)->scaleX;
|
|
|
|
skins[i].ScaleY = GetDefaultByType (type)->scaleY;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
R_InitSpriteDefs ();
|
|
|
|
NumStdSprites = sprites.Size();
|
|
|
|
R_InitSkins (); // [RH] Finish loading skin data
|
|
|
|
|
|
|
|
// [RH] Set up base skin
|
|
|
|
// [GRB] Each player class has its own base skin
|
|
|
|
for (i = 0; i < PlayerClasses.Size (); i++)
|
|
|
|
{
|
|
|
|
const PClass *basetype = PlayerClasses[i].Type;
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
const char *pclassface = basetype->Meta.GetMetaString (APMETA_Face);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
strcpy (skins[i].name, "Base");
|
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 (pclassface == NULL || strcmp(pclassface, "None") == 0)
|
- Fixed: The players were not added to FS's list of spawned things.
- Update to ZDoom r882
- Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
way to do it.
- Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData function and replaced all calls to P_OpenMapData that
only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
but keeps all existing information in the default and just adds to it. This
is needed because Hexen and Strife set some information in their base
MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
* Finale texts loaded from a text lump
* Demos
* Local SNDINFOs
* Local SNDSEQs
* Image names in FONTDEFS
* intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in
the map and the actor type they spawned.
SBarInfo Update #16
- Added: fillzeros flag for drawnumber. When set the string will always have
a length of the specified size and zeros will fill in for the missing places.
If the number is negative the negative sign will take the place of the last
digit.
- Added: globalarray type to drawnumber which will display the value in a
global array with the index set to the player's number. Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
most of the gaps caused by round off errors. At least for now anyways and it
is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture()
- Increased limit for demon/melee to 4.
- Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
(MELEERANGE) and didn't set the puff to its melee state if the range
was different. Even worse, it checked a global variable for this so
the behavior was undefined when P_SpawnPuff was called from anywhere
else but P_LineAttack. To reduce the amount of parameters I combined
this information with the hitthing and temporary parameters into one
flags parameter. Also changed P_LineAttack so that it gets passed
an additional parameter that specifies whether the attack is a melee
attack or not and set this to true in all calls that are to be considered
melee attacks. I couldn't use the damage type because A_CustomPunch
and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET
and FX_GRENADE.
- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
a level using this cluster. Now it will only do that if HexenHack is true,
i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format
MAPINFOs it will now be the same as for the other games which means that
'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
code for any actor with this flag. Mostly useful for particle effects where
the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.
- Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
but that still caused some blending of the channels.
- Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
the same lump name no longer involves any degree of guesswork in
determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
pointer checks, in case an improper sequence was encountered during
parsing but not early enough to avoid creating a slot for it in the array.
- Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
MUSSong2 works just as well. There are still lots of leftover bits in
the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
in_adlib calculates the song length for this format wrong, even though
the exact length is stored right in the header. (But in_adlib seems buggy
in general; too bad it's the only Windows version of Adplug that seems to
exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
|
|
|
{
|
|
|
|
skins[i].face[0] = 'S';
|
|
|
|
skins[i].face[1] = 'T';
|
|
|
|
skins[i].face[2] = 'F';
|
|
|
|
skins[i].face[3] = '\0';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy(skins[i].face, pclassface);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
skins[i].range0start = basetype->Meta.GetMetaInt (APMETA_ColorRange) & 255;
|
|
|
|
skins[i].range0end = basetype->Meta.GetMetaInt (APMETA_ColorRange) >> 8;
|
2008-05-01 21:45:22 +00:00
|
|
|
skins[i].ScaleX = GetDefaultByType (basetype)->scaleX;
|
|
|
|
skins[i].ScaleY = GetDefaultByType (basetype)->scaleY;
|
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
|
|
|
skins[i].sprite = GetDefaultByType (basetype)->SpawnState->sprite;
|
2008-01-27 11:25:03 +00:00
|
|
|
skins[i].namespc = ns_global;
|
|
|
|
|
|
|
|
PlayerClasses[i].Skins.Push (i);
|
|
|
|
|
|
|
|
if (memcmp (sprites[skins[i].sprite].name, "PLAY", 4) == 0)
|
|
|
|
{
|
|
|
|
for (j = 0; j < sprites.Size (); j++)
|
|
|
|
{
|
|
|
|
if (memcmp (sprites[j].name, deh.PlayerSprite, 4) == 0)
|
|
|
|
{
|
|
|
|
skins[i].sprite = (int)j;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Sort the skins, but leave base as skin 0
|
2009-02-21 17:07:32 +00:00
|
|
|
//qsort (&skins[PlayerClasses.Size ()], numskins-PlayerClasses.Size (), sizeof(FPlayerSkin), skinsorter);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void R_DeinitSprites()
|
|
|
|
{
|
|
|
|
// Free skins
|
|
|
|
if (skins != NULL)
|
|
|
|
{
|
|
|
|
delete[] skins;
|
|
|
|
skins = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Free vissprites
|
|
|
|
for (int i = 0; i < MaxVisSprites; ++i)
|
|
|
|
{
|
|
|
|
delete vissprites[i];
|
|
|
|
}
|
|
|
|
free (vissprites);
|
|
|
|
vissprites = NULL;
|
|
|
|
vissprite_p = lastvissprite = NULL;
|
|
|
|
MaxVisSprites = 0;
|
|
|
|
|
|
|
|
// Free vissprites sorter
|
|
|
|
if (spritesorter != NULL)
|
|
|
|
{
|
|
|
|
delete[] spritesorter;
|
|
|
|
spritesortersize = 0;
|
|
|
|
spritesorter = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_ClearSprites
|
|
|
|
// Called at frame start.
|
|
|
|
//
|
|
|
|
void R_ClearSprites (void)
|
|
|
|
{
|
|
|
|
vissprite_p = firstvissprite;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_NewVisSprite
|
|
|
|
//
|
|
|
|
vissprite_t *R_NewVisSprite (void)
|
|
|
|
{
|
|
|
|
if (vissprite_p == lastvissprite)
|
|
|
|
{
|
|
|
|
ptrdiff_t firstvisspritenum = firstvissprite - vissprites;
|
|
|
|
ptrdiff_t prevvisspritenum = vissprite_p - vissprites;
|
|
|
|
|
|
|
|
MaxVisSprites = MaxVisSprites ? MaxVisSprites * 2 : 128;
|
|
|
|
vissprites = (vissprite_t **)M_Realloc (vissprites, MaxVisSprites * sizeof(vissprite_t));
|
|
|
|
lastvissprite = &vissprites[MaxVisSprites];
|
|
|
|
firstvissprite = &vissprites[firstvisspritenum];
|
|
|
|
vissprite_p = &vissprites[prevvisspritenum];
|
|
|
|
DPrintf ("MaxVisSprites increased to %d\n", MaxVisSprites);
|
|
|
|
|
|
|
|
// Allocate sprites from the new pile
|
|
|
|
for (vissprite_t **p = vissprite_p; p < lastvissprite; ++p)
|
|
|
|
{
|
|
|
|
*p = new vissprite_t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vissprite_p++;
|
|
|
|
return *(vissprite_p-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawMaskedColumn
|
|
|
|
// Used for sprites and masked mid textures.
|
|
|
|
// Masked means: partly transparent, i.e. stored
|
|
|
|
// in posts/runs of opaque pixels.
|
|
|
|
//
|
|
|
|
short* mfloorclip;
|
|
|
|
short* mceilingclip;
|
|
|
|
|
|
|
|
fixed_t spryscale;
|
|
|
|
fixed_t sprtopscreen;
|
|
|
|
|
|
|
|
bool sprflipvert;
|
|
|
|
|
|
|
|
void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *span)
|
|
|
|
{
|
|
|
|
while (span->Length != 0)
|
|
|
|
{
|
|
|
|
const int length = span->Length;
|
|
|
|
const int top = span->TopOffset;
|
|
|
|
|
|
|
|
// calculate unclipped screen coordinates for post
|
|
|
|
dc_yl = (sprtopscreen + spryscale * top) >> FRACBITS;
|
|
|
|
dc_yh = (sprtopscreen + spryscale * (top + length) - FRACUNIT) >> FRACBITS;
|
|
|
|
|
|
|
|
if (sprflipvert)
|
|
|
|
{
|
2010-07-23 22:01:12 +00:00
|
|
|
swapvalues (dc_yl, dc_yh);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dc_yh >= mfloorclip[dc_x])
|
|
|
|
{
|
|
|
|
dc_yh = mfloorclip[dc_x] - 1;
|
|
|
|
}
|
|
|
|
if (dc_yl < mceilingclip[dc_x])
|
|
|
|
{
|
|
|
|
dc_yl = mceilingclip[dc_x];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dc_yl <= dc_yh)
|
|
|
|
{
|
|
|
|
if (sprflipvert)
|
|
|
|
{
|
|
|
|
dc_texturefrac = (dc_yl*dc_iscale) - (top << FRACBITS)
|
|
|
|
- FixedMul (centeryfrac, dc_iscale) - dc_texturemid;
|
|
|
|
const fixed_t maxfrac = length << FRACBITS;
|
|
|
|
while (dc_texturefrac >= maxfrac)
|
|
|
|
{
|
|
|
|
if (++dc_yl > dc_yh)
|
|
|
|
goto nextpost;
|
|
|
|
dc_texturefrac += dc_iscale;
|
|
|
|
}
|
|
|
|
fixed_t endfrac = dc_texturefrac + (dc_yh-dc_yl)*dc_iscale;
|
|
|
|
while (endfrac < 0)
|
|
|
|
{
|
|
|
|
if (--dc_yh < dc_yl)
|
|
|
|
goto nextpost;
|
|
|
|
endfrac -= dc_iscale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dc_texturefrac = dc_texturemid - (top << FRACBITS)
|
|
|
|
+ (dc_yl*dc_iscale) - FixedMul (centeryfrac-FRACUNIT, dc_iscale);
|
|
|
|
while (dc_texturefrac < 0)
|
|
|
|
{
|
|
|
|
if (++dc_yl > dc_yh)
|
|
|
|
goto nextpost;
|
|
|
|
dc_texturefrac += dc_iscale;
|
|
|
|
}
|
|
|
|
fixed_t endfrac = dc_texturefrac + (dc_yh-dc_yl)*dc_iscale;
|
|
|
|
const fixed_t maxfrac = length << FRACBITS;
|
|
|
|
if (dc_yh < mfloorclip[dc_x]-1 && endfrac < maxfrac - dc_iscale)
|
|
|
|
{
|
|
|
|
dc_yh++;
|
|
|
|
}
|
|
|
|
else while (endfrac >= maxfrac)
|
|
|
|
{
|
|
|
|
if (--dc_yh < dc_yl)
|
|
|
|
goto nextpost;
|
|
|
|
endfrac -= dc_iscale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dc_source = column + top;
|
|
|
|
dc_dest = ylookup[dc_yl] + dc_x + dc_destorg;
|
|
|
|
dc_count = dc_yh - dc_yl + 1;
|
|
|
|
colfunc ();
|
|
|
|
}
|
|
|
|
nextpost:
|
|
|
|
span++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawVisSprite
|
|
|
|
// mfloorclip and mceilingclip should also be set.
|
|
|
|
//
|
|
|
|
void R_DrawVisSprite (vissprite_t *vis)
|
|
|
|
{
|
|
|
|
const BYTE *pixels;
|
|
|
|
const FTexture::Span *spans;
|
|
|
|
fixed_t frac;
|
|
|
|
FTexture *tex;
|
|
|
|
int x2, stop4;
|
|
|
|
fixed_t xiscale;
|
|
|
|
ESPSResult mode;
|
|
|
|
|
|
|
|
dc_colormap = vis->colormap;
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
mode = R_SetPatchStyle (vis->RenderStyle, vis->alpha, vis->Translation, vis->FillColor);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (mode != DontDraw)
|
|
|
|
{
|
|
|
|
if (mode == DoDraw0)
|
|
|
|
{
|
|
|
|
// One column at a time
|
|
|
|
stop4 = vis->x1;
|
|
|
|
}
|
|
|
|
else // DoDraw1
|
|
|
|
{
|
|
|
|
// Up to four columns at a time
|
|
|
|
stop4 = (vis->x2 + 1) & ~3;
|
|
|
|
}
|
|
|
|
|
|
|
|
tex = vis->pic;
|
|
|
|
spryscale = vis->yscale;
|
|
|
|
sprflipvert = false;
|
|
|
|
dc_iscale = 0xffffffffu / (unsigned)vis->yscale;
|
|
|
|
dc_texturemid = vis->texturemid;
|
|
|
|
frac = vis->startfrac;
|
|
|
|
xiscale = vis->xiscale;
|
|
|
|
|
|
|
|
sprtopscreen = centeryfrac - FixedMul (dc_texturemid, spryscale);
|
|
|
|
|
|
|
|
dc_x = vis->x1;
|
|
|
|
x2 = vis->x2 + 1;
|
|
|
|
|
|
|
|
if (dc_x < x2)
|
|
|
|
{
|
|
|
|
while ((dc_x < stop4) && (dc_x & 3))
|
|
|
|
{
|
|
|
|
pixels = tex->GetColumn (frac >> FRACBITS, &spans);
|
|
|
|
R_DrawMaskedColumn (pixels, spans);
|
|
|
|
dc_x++;
|
|
|
|
frac += xiscale;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (dc_x < stop4)
|
|
|
|
{
|
|
|
|
rt_initcols();
|
|
|
|
for (int zz = 4; zz; --zz)
|
|
|
|
{
|
|
|
|
pixels = tex->GetColumn (frac >> FRACBITS, &spans);
|
|
|
|
R_DrawMaskedColumnHoriz (pixels, spans);
|
|
|
|
dc_x++;
|
|
|
|
frac += xiscale;
|
|
|
|
}
|
|
|
|
rt_draw4cols (dc_x - 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
while (dc_x < x2)
|
|
|
|
{
|
|
|
|
pixels = tex->GetColumn (frac >> FRACBITS, &spans);
|
|
|
|
R_DrawMaskedColumn (pixels, spans);
|
|
|
|
dc_x++;
|
|
|
|
frac += xiscale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
R_FinishSetPatchStyle ();
|
|
|
|
|
|
|
|
NetUpdate ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_ProjectSprite
|
|
|
|
// Generates a vissprite for a thing if it might be visible.
|
|
|
|
//
|
|
|
|
void R_ProjectSprite (AActor *thing, int fakeside)
|
|
|
|
{
|
|
|
|
fixed_t fx, fy, fz;
|
|
|
|
fixed_t tr_x;
|
|
|
|
fixed_t tr_y;
|
|
|
|
|
|
|
|
fixed_t gzt; // killough 3/27/98
|
|
|
|
fixed_t gzb; // [RH] use bottom of sprite, not actor
|
|
|
|
fixed_t tx, tx2;
|
|
|
|
fixed_t tz;
|
|
|
|
|
|
|
|
fixed_t xscale;
|
|
|
|
|
|
|
|
int x1;
|
|
|
|
int x2;
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum;
|
2008-01-27 11:25:03 +00:00
|
|
|
FTexture *tex;
|
|
|
|
|
|
|
|
WORD flip;
|
|
|
|
|
|
|
|
vissprite_t* vis;
|
|
|
|
|
|
|
|
fixed_t iscale;
|
|
|
|
|
|
|
|
sector_t* heightsec; // killough 3/27/98
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
// Don't waste time projecting sprites that are definitely not visible.
|
2008-01-27 11:25:03 +00:00
|
|
|
if (thing == NULL ||
|
|
|
|
(thing->renderflags & RF_INVISIBLE) ||
|
2008-01-27 15:34:47 +00:00
|
|
|
!thing->RenderStyle.IsVisible(thing->alpha))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Interpolate the sprite's position to make it look smooth
|
|
|
|
fx = thing->PrevX + FixedMul (r_TicFrac, thing->x - thing->PrevX);
|
|
|
|
fy = thing->PrevY + FixedMul (r_TicFrac, thing->y - thing->PrevY);
|
|
|
|
fz = thing->PrevZ + FixedMul (r_TicFrac, thing->z - thing->PrevZ);
|
|
|
|
|
|
|
|
// transform the origin point
|
|
|
|
tr_x = fx - viewx;
|
|
|
|
tr_y = fy - viewy;
|
|
|
|
|
|
|
|
tz = DMulScale20 (tr_x, viewtancos, tr_y, viewtansin);
|
|
|
|
|
|
|
|
// thing is behind view plane?
|
|
|
|
if (tz < MINZ)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tx = DMulScale16 (tr_x, viewsin, -tr_y, viewcos);
|
|
|
|
|
|
|
|
// [RH] Flip for mirrors
|
|
|
|
if (MirrorFlags & RF_XFLIP)
|
|
|
|
{
|
|
|
|
tx = -tx;
|
|
|
|
}
|
|
|
|
tx2 = tx >> 4;
|
|
|
|
|
|
|
|
// too far off the side?
|
|
|
|
if ((abs (tx) >> 6) > tz)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
xscale = DivScale12 (centerxfrac, tz);
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
if (thing->picnum.isValid())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
picnum = thing->picnum;
|
|
|
|
|
|
|
|
tex = TexMan(picnum);
|
|
|
|
if (tex->UseType == FTexture::TEX_Null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
flip = 0;
|
|
|
|
|
|
|
|
if (tex->Rotations != 0xFFFF)
|
|
|
|
{
|
|
|
|
// choose a different rotation based on player view
|
|
|
|
spriteframe_t *sprframe = &SpriteFrames[tex->Rotations];
|
|
|
|
angle_t ang = R_PointToAngle (fx, fy);
|
|
|
|
angle_t rot;
|
|
|
|
if (sprframe->Texture[0] == sprframe->Texture[1])
|
|
|
|
{
|
|
|
|
rot = (ang - thing->angle + (angle_t)(ANGLE_45/2)*9) >> 28;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rot = (ang - thing->angle + (angle_t)(ANGLE_45/2)*9-(angle_t)(ANGLE_180/16)) >> 28;
|
|
|
|
}
|
|
|
|
picnum = sprframe->Texture[rot];
|
|
|
|
flip = sprframe->Flip & (1 << rot);
|
|
|
|
tex = TexMan[picnum]; // Do not animate the rotation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// decide which texture to use for the sprite
|
|
|
|
#ifdef RANGECHECK
|
|
|
|
if ((unsigned)thing->sprite >= (unsigned)sprites.Size ())
|
|
|
|
{
|
|
|
|
DPrintf ("R_ProjectSprite: invalid sprite number %i\n", thing->sprite);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
spritedef_t *sprdef = &sprites[thing->sprite];
|
|
|
|
if (thing->frame >= sprdef->numframes)
|
|
|
|
{
|
|
|
|
// If there are no frames at all for this sprite, don't draw it.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//picnum = SpriteFrames[sprdef->spriteframes + thing->frame].Texture[0];
|
|
|
|
// choose a different rotation based on player view
|
|
|
|
spriteframe_t *sprframe = &SpriteFrames[sprdef->spriteframes + thing->frame];
|
|
|
|
angle_t ang = R_PointToAngle (fx, fy);
|
|
|
|
angle_t rot;
|
|
|
|
if (sprframe->Texture[0] == sprframe->Texture[1])
|
|
|
|
{
|
|
|
|
rot = (ang - thing->angle + (angle_t)(ANGLE_45/2)*9) >> 28;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rot = (ang - thing->angle + (angle_t)(ANGLE_45/2)*9-(angle_t)(ANGLE_180/16)) >> 28;
|
|
|
|
}
|
|
|
|
picnum = sprframe->Texture[rot];
|
|
|
|
flip = sprframe->Flip & (1 << rot);
|
|
|
|
tex = TexMan[picnum]; // Do not animate the rotation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tex == NULL || tex->UseType == FTexture::TEX_Null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Added scaling
|
|
|
|
int scaled_to = tex->GetScaledTopOffset();
|
|
|
|
int scaled_bo = scaled_to - tex->GetScaledHeight();
|
|
|
|
gzt = fz + thing->scaleY * scaled_to;
|
|
|
|
gzb = fz + thing->scaleY * scaled_bo;
|
|
|
|
|
|
|
|
// [RH] Reject sprites that are off the top or bottom of the screen
|
|
|
|
if (MulScale12 (globaluclip, tz) > viewz - gzb ||
|
|
|
|
MulScale12 (globaldclip, tz) < viewz - gzt)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Flip for mirrors and renderflags
|
|
|
|
if ((MirrorFlags ^ thing->renderflags) & RF_XFLIP)
|
|
|
|
{
|
|
|
|
flip = !flip;
|
|
|
|
}
|
|
|
|
|
|
|
|
// calculate edges of the shape
|
|
|
|
const fixed_t thingxscalemul = DivScale16(thing->scaleX, tex->xScale);
|
|
|
|
|
|
|
|
tx -= (flip ? (tex->GetWidth() - tex->LeftOffset - 1) : tex->LeftOffset) * thingxscalemul;
|
|
|
|
x1 = centerx + MulScale32 (tx, xscale);
|
|
|
|
|
|
|
|
// off the right side?
|
|
|
|
if (x1 > WindowRight)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tx += tex->GetWidth() * thingxscalemul;
|
|
|
|
x2 = centerx + MulScale32 (tx, xscale);
|
|
|
|
|
|
|
|
// off the left side or too small?
|
|
|
|
if (x2 < WindowLeft || x2 <= x1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
xscale = FixedDiv(FixedMul(thing->scaleX, xscale), tex->xScale);
|
|
|
|
iscale = (tex->GetWidth() << FRACBITS) / (x2 - x1);
|
|
|
|
x2--;
|
|
|
|
|
|
|
|
// killough 3/27/98: exclude things totally separated
|
|
|
|
// from the viewer, by either water or fake ceilings
|
|
|
|
// killough 4/11/98: improve sprite clipping for underwater/fake ceilings
|
|
|
|
|
2009-05-23 10:24:33 +00:00
|
|
|
heightsec = thing->Sector->GetHeightSec();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2009-05-23 10:24:33 +00:00
|
|
|
if (heightsec != NULL) // only clip things which are in special sectors
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (fakeside == FAKED_AboveCeiling)
|
|
|
|
{
|
|
|
|
if (gzt < heightsec->ceilingplane.ZatPoint (fx, fy))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (fakeside == FAKED_BelowFloor)
|
|
|
|
{
|
|
|
|
if (gzb >= heightsec->floorplane.ZatPoint (fx, fy))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (gzt < heightsec->floorplane.ZatPoint (fx, fy))
|
|
|
|
return;
|
|
|
|
if (gzb >= heightsec->ceilingplane.ZatPoint (fx, fy))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// store information in a vissprite
|
|
|
|
vis = R_NewVisSprite ();
|
|
|
|
|
|
|
|
// killough 3/27/98: save sector for special clipping later
|
|
|
|
vis->heightsec = heightsec;
|
|
|
|
vis->sector = thing->Sector;
|
|
|
|
|
|
|
|
fixed_t yscale = DivScale16(thing->scaleY, tex->yScale);
|
|
|
|
vis->renderflags = thing->renderflags;
|
|
|
|
vis->RenderStyle = thing->RenderStyle;
|
2008-01-27 15:34:47 +00:00
|
|
|
vis->FillColor = thing->fillcolor;
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->xscale = xscale;
|
Update to ZDoom r1735:
- Added extra states to dehsupp for the MBF additions.
- Removed specific Button_Speed handling from the controllers' AddAxes()
methods. Analog axes now respond to Button_Speed and cl_run in exactly the
same way as digital buttons do.
- Changed rounding slightly for analog axis -> integer in G_BuildTiccmd().
- Fixed: FXInputController::ProcessThumbstick() was slightly off when it
converted to the range [-1.0,+1.0].
- Added default bindings for the Xbox 360 controller buttons.
- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set
the value for ACSReturn.
- Added a DefaultSkill property. Adding it to a skill will cause that skill
to be the default one selected in the menu. If none is specified as the
default, then the middle skill is the default.
- Slider controls in the options menu now display their values
numerically next to the slider.
- The minimum value for m_yaw, m_pitch, m_forward, and m_side from the
menu has been dropped from 0.5 to 0, so those particular mouse motions can
be disabled entirely without using the console.
- added compat_anybossdeath to MAPINFO.
- fixed blue colormap
- Added parameters to A_VileAttack.
- Removed redundant definition of use_joystick from SDL/i_input.cpp.
- Turned net decompression into a non fatal error. It now drops the packet
and waits for the sender to send a new, hopefully good, packet.
- Reduced potential for overflow in R_ProjectSprite().
- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so
that additive time powerups can be activated before the existing
power has entered its blink threshold.
- Added a "BlueMap" for powerup colors.
- Added a NULL screen check when detaching HUD messages.
- Added HotWax's A_SetArg.
- Gez's patch for more A_WeaponReady flags:
* WRF_NOBOB (1): Weapon won't bob
* WRF_NOFIRE (12): Weapon won't fire at all
* WRF_NOSWITCH (2): Weapon can't be switched off
* WRF_NOPRIMARY (4): Weapon will not fire its main attack
* WRF_NOSECONDARY (8): Weapon will not fire its alt attack
- Attempt to add support for Microsoft's SideWinder Strategic Commander.
- Split the joystick menu into two parts: A top level with general options
and a list of all attached controllers, and a second level for configuring
an individual controller.
- Fixed: Pressing Up at the top of a menu with more lines than fit on screen
would find an incorrect bottom position if the menu had a custom top height.
- Added the cvars joy_dinput, joy_ps2raw, and joy_xinput to enable/disable
specific game controller input systems independant of each other.
- Device change broadcasts are now sent to the Doom event queue, so
device scanning can be handled in one common place.
- Added a fast version of IsXInputDevice that uses the Raw Input device
list, because querying WMI for this information is painfully slow.
- Added support for compiling with FMOD Ex 4.26+ and running the game
with an older DLL. This combination will now produce sound.
- added submission for raising master/children/siblings.
- added submission for no decals on wall option.
- removed some useless code from SpawnMissile function.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@402 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-24 13:47:25 +00:00
|
|
|
vis->yscale = Scale (InvZtoScale, yscale, tz << 4);
|
2009-02-08 23:01:13 +00:00
|
|
|
vis->depth = tz;
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->idepth = (DWORD)DivScale32 (1, tz) >> 1; // tz is 20.12, so idepth ought to be 12.20, but
|
|
|
|
vis->cx = tx2; // signed math makes it 13.19
|
|
|
|
vis->gx = fx;
|
|
|
|
vis->gy = fy;
|
|
|
|
vis->gz = gzb; // [RH] use gzb, not thing->z
|
|
|
|
vis->gzt = gzt; // killough 3/27/98
|
|
|
|
vis->floorclip = FixedDiv (thing->floorclip, yscale);
|
|
|
|
vis->texturemid = (tex->TopOffset << FRACBITS) -
|
|
|
|
FixedDiv (viewz-fz+thing->floorclip, yscale);
|
|
|
|
vis->x1 = x1 < WindowLeft ? WindowLeft : x1;
|
|
|
|
vis->x2 = x2 > WindowRight ? WindowRight : x2;
|
|
|
|
vis->Translation = thing->Translation; // [RH] thing translation table
|
|
|
|
vis->FakeFlatStat = fakeside;
|
|
|
|
vis->alpha = thing->alpha;
|
|
|
|
vis->pic = tex;
|
|
|
|
|
|
|
|
if (flip)
|
|
|
|
{
|
|
|
|
vis->startfrac = (tex->GetWidth() << FRACBITS) - 1;
|
|
|
|
vis->xiscale = -iscale;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
vis->startfrac = 0;
|
|
|
|
vis->xiscale = iscale;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vis->x1 > x1)
|
|
|
|
vis->startfrac += vis->xiscale*(vis->x1-x1);
|
2008-01-27 15:34:47 +00:00
|
|
|
|
|
|
|
// The software renderer cannot invert the source without inverting the overlay
|
|
|
|
// too. That means if the source is inverted, we need to do the reverse of what
|
|
|
|
// the invert overlay flag says to do.
|
|
|
|
INTBOOL invertcolormap = (vis->RenderStyle.Flags & STYLEF_InvertOverlay);
|
|
|
|
|
|
|
|
if (vis->RenderStyle.Flags & STYLEF_InvertSource)
|
|
|
|
{
|
|
|
|
invertcolormap = !invertcolormap;
|
|
|
|
}
|
|
|
|
|
|
|
|
FDynamicColormap *mybasecolormap = basecolormap;
|
|
|
|
|
2009-10-30 11:18:39 +00:00
|
|
|
// Sprites that are added to the scene must fade to black.
|
|
|
|
if (vis->RenderStyle == LegacyRenderStyles[STYLE_Add] && mybasecolormap->Fade != 0)
|
|
|
|
{
|
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, 0, mybasecolormap->Desaturate);
|
|
|
|
}
|
|
|
|
|
2008-01-27 15:34:47 +00:00
|
|
|
if (vis->RenderStyle.Flags & STYLEF_FadeToBlack)
|
|
|
|
{
|
|
|
|
if (invertcolormap)
|
2009-09-20 20:51:32 +00:00
|
|
|
{ // Fade to white
|
2008-01-27 15:34:47 +00:00
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, MAKERGB(255,255,255), mybasecolormap->Desaturate);
|
|
|
|
invertcolormap = false;
|
|
|
|
}
|
|
|
|
else
|
2009-09-20 20:51:32 +00:00
|
|
|
{ // Fade to black
|
2008-01-27 15:34:47 +00:00
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, MAKERGB(0,0,0), mybasecolormap->Desaturate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// get light level
|
2009-09-20 20:51:32 +00:00
|
|
|
if (fixedcolormap != NULL)
|
|
|
|
{ // fixed map
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->colormap = fixedcolormap;
|
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
if (invertcolormap)
|
|
|
|
{
|
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, mybasecolormap->Fade.InverseColor(), mybasecolormap->Desaturate);
|
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
if (fixedlightlev >= 0)
|
2008-01-27 15:34:47 +00:00
|
|
|
{
|
2009-09-20 20:51:32 +00:00
|
|
|
vis->colormap = mybasecolormap->Maps + fixedlightlev;
|
|
|
|
}
|
|
|
|
else if (!foggy && ((thing->renderflags & RF_FULLBRIGHT) || (thing->flags5 & MF5_BRIGHT)))
|
|
|
|
{ // full bright
|
|
|
|
vis->colormap = mybasecolormap->Maps;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // diminished light
|
|
|
|
vis->colormap = mybasecolormap->Maps + (GETPALOOKUP (
|
|
|
|
(fixed_t)DivScale12 (r_SpriteVisibility, tz), spriteshade) << COLORMAPSHIFT);
|
2008-01-27 15:34:47 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_AddSprites
|
|
|
|
// During BSP traversal, this adds sprites by sector.
|
|
|
|
//
|
|
|
|
// killough 9/18/98: add lightlevel as parameter, fixing underwater lighting
|
|
|
|
// [RH] Save which side of heightsec sprite is on here.
|
|
|
|
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside)
|
|
|
|
{
|
|
|
|
AActor *thing;
|
|
|
|
|
|
|
|
// BSP is traversed by subsector.
|
|
|
|
// A sector might have been split into several
|
|
|
|
// subsectors during BSP building.
|
|
|
|
// Thus we check whether it was already added.
|
|
|
|
if (sec->thinglist == NULL || sec->validcount == validcount)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Well, now it will be done.
|
|
|
|
sec->validcount = validcount;
|
|
|
|
|
|
|
|
spriteshade = LIGHT2SHADE(lightlevel + r_actualextralight);
|
|
|
|
|
|
|
|
// Handle all things in sector.
|
|
|
|
for (thing = sec->thinglist; thing; thing = thing->snext)
|
|
|
|
{
|
|
|
|
R_ProjectSprite (thing, fakeside);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawPSprite
|
|
|
|
//
|
|
|
|
void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, fixed_t sx, fixed_t sy)
|
|
|
|
{
|
|
|
|
fixed_t tx;
|
|
|
|
int x1;
|
|
|
|
int x2;
|
|
|
|
spritedef_t* sprdef;
|
|
|
|
spriteframe_t* sprframe;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum;
|
2008-01-27 11:25:03 +00:00
|
|
|
WORD flip;
|
|
|
|
FTexture* tex;
|
|
|
|
vissprite_t* vis;
|
2009-09-20 20:51:32 +00:00
|
|
|
static vissprite_t avis[NUMPSPRITES];
|
|
|
|
bool noaccel;
|
|
|
|
|
|
|
|
assert(pspnum >= 0 && pspnum < NUMPSPRITES);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// decide which patch to use
|
2010-04-21 10:48:59 +00:00
|
|
|
if ( (unsigned)psp->sprite >= (unsigned)sprites.Size ())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-04-21 10:48:59 +00:00
|
|
|
DPrintf ("R_DrawPSprite: invalid sprite number %i\n", psp->sprite);
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
|
|
|
}
|
2010-04-21 10:48:59 +00:00
|
|
|
sprdef = &sprites[psp->sprite];
|
|
|
|
if (psp->frame >= sprdef->numframes)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-04-21 10:48:59 +00:00
|
|
|
DPrintf ("R_DrawPSprite: invalid sprite frame %i : %i\n", psp->sprite, psp->frame);
|
2008-01-27 11:25:03 +00:00
|
|
|
return;
|
|
|
|
}
|
2010-04-21 10:48:59 +00:00
|
|
|
sprframe = &SpriteFrames[sprdef->spriteframes + psp->frame];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
picnum = sprframe->Texture[0];
|
|
|
|
flip = sprframe->Flip & 1;
|
|
|
|
tex = TexMan(picnum);
|
|
|
|
|
|
|
|
if (tex->UseType == FTexture::TEX_Null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// calculate edges of the shape
|
|
|
|
tx = sx-((320/2)<<FRACBITS);
|
|
|
|
|
|
|
|
tx -= tex->GetScaledLeftOffset() << FRACBITS;
|
|
|
|
x1 = (centerxfrac + FixedMul (tx, pspritexscale)) >>FRACBITS;
|
2009-09-20 20:51:32 +00:00
|
|
|
VisPSpritesX1[pspnum] = x1;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// off the right side
|
|
|
|
if (x1 > viewwidth)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tx += tex->GetScaledWidth() << FRACBITS;
|
|
|
|
x2 = ((centerxfrac + FixedMul (tx, pspritexscale)) >>FRACBITS) - 1;
|
|
|
|
|
|
|
|
// off the left side
|
|
|
|
if (x2 < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// store information in a vissprite
|
2009-09-20 20:51:32 +00:00
|
|
|
vis = &avis[pspnum];
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->renderflags = owner->renderflags;
|
|
|
|
vis->floorclip = 0;
|
|
|
|
|
|
|
|
|
|
|
|
vis->texturemid = MulScale16((BASEYCENTER<<FRACBITS) - sy, tex->yScale) + (tex->TopOffset << FRACBITS);
|
|
|
|
|
|
|
|
|
|
|
|
if (camera->player && (RenderTarget != screen ||
|
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
|
|
|
viewheight == RenderTarget->GetHeight() ||
|
2008-01-27 11:25:03 +00:00
|
|
|
(RenderTarget->GetWidth() > 320 && !st_scale)))
|
|
|
|
{ // Adjust PSprite for fullscreen views
|
|
|
|
AWeapon *weapon = NULL;
|
|
|
|
if (camera->player != NULL)
|
|
|
|
{
|
|
|
|
weapon = camera->player->ReadyWeapon;
|
|
|
|
}
|
|
|
|
if (pspnum <= ps_flash && weapon != NULL && weapon->YAdjust != 0)
|
|
|
|
{
|
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 (RenderTarget != screen || viewheight == RenderTarget->GetHeight())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
vis->texturemid -= weapon->YAdjust;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
vis->texturemid -= FixedMul (StatusBar->GetDisplacement (),
|
|
|
|
weapon->YAdjust);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pspnum <= ps_flash)
|
|
|
|
{ // Move the weapon down for 1280x1024.
|
|
|
|
vis->texturemid -= BaseRatioSizes[WidescreenRatio][2];
|
|
|
|
}
|
|
|
|
vis->x1 = x1 < 0 ? 0 : x1;
|
|
|
|
vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
|
|
|
|
vis->xscale = DivScale16(pspritexscale, tex->xScale);
|
|
|
|
vis->yscale = DivScale16(pspriteyscale, tex->yScale);
|
|
|
|
vis->Translation = 0; // [RH] Use default colors
|
|
|
|
vis->pic = tex;
|
|
|
|
|
|
|
|
if (flip)
|
|
|
|
{
|
|
|
|
vis->xiscale = -MulScale16(pspritexiscale, tex->xScale);
|
|
|
|
vis->startfrac = (tex->GetWidth() << FRACBITS) - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
vis->xiscale = MulScale16(pspritexiscale, tex->xScale);
|
|
|
|
vis->startfrac = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vis->x1 > x1)
|
|
|
|
vis->startfrac += vis->xiscale*(vis->x1-x1);
|
|
|
|
|
2009-09-20 20:51:32 +00:00
|
|
|
noaccel = false;
|
2008-01-27 11:25:03 +00:00
|
|
|
if (pspnum <= ps_flash)
|
|
|
|
{
|
|
|
|
vis->alpha = owner->alpha;
|
|
|
|
vis->RenderStyle = owner->RenderStyle;
|
2008-01-27 15:34:47 +00:00
|
|
|
|
|
|
|
// The software renderer cannot invert the source without inverting the overlay
|
|
|
|
// too. That means if the source is inverted, we need to do the reverse of what
|
|
|
|
// the invert overlay flag says to do.
|
|
|
|
INTBOOL invertcolormap = (vis->RenderStyle.Flags & STYLEF_InvertOverlay);
|
|
|
|
|
|
|
|
if (vis->RenderStyle.Flags & STYLEF_InvertSource)
|
|
|
|
{
|
|
|
|
invertcolormap = !invertcolormap;
|
|
|
|
}
|
|
|
|
|
|
|
|
FDynamicColormap *mybasecolormap = basecolormap;
|
|
|
|
|
|
|
|
if (vis->RenderStyle.Flags & STYLEF_FadeToBlack)
|
|
|
|
{
|
|
|
|
if (invertcolormap)
|
2009-09-20 20:51:32 +00:00
|
|
|
{ // Fade to white
|
2008-01-27 15:34:47 +00:00
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, MAKERGB(255,255,255), mybasecolormap->Desaturate);
|
|
|
|
invertcolormap = false;
|
|
|
|
}
|
|
|
|
else
|
2009-09-20 20:51:32 +00:00
|
|
|
{ // Fade to black
|
2008-01-27 15:34:47 +00:00
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, MAKERGB(0,0,0), mybasecolormap->Desaturate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-22 12:51:23 +00:00
|
|
|
if (realfixedcolormap != NULL)
|
2009-09-20 20:51:32 +00:00
|
|
|
{ // fixed color
|
2009-09-22 12:51:23 +00:00
|
|
|
vis->colormap = realfixedcolormap->Colormap;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-01-27 15:34:47 +00:00
|
|
|
if (invertcolormap)
|
|
|
|
{
|
|
|
|
mybasecolormap = GetSpecialLights(mybasecolormap->Color, mybasecolormap->Fade.InverseColor(), mybasecolormap->Desaturate);
|
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
if (fixedlightlev >= 0)
|
2008-01-27 15:34:47 +00:00
|
|
|
{
|
2009-09-20 20:51:32 +00:00
|
|
|
vis->colormap = mybasecolormap->Maps + fixedlightlev;
|
|
|
|
}
|
|
|
|
else if (!foggy && psp->state->GetFullbright())
|
|
|
|
{ // full bright
|
|
|
|
vis->colormap = mybasecolormap->Maps; // [RH] use basecolormap
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // local light
|
|
|
|
vis->colormap = mybasecolormap->Maps + (GETPALOOKUP (0, spriteshade) << COLORMAPSHIFT);
|
2008-01-27 15:34:47 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
if (camera->Inventory != NULL)
|
|
|
|
{
|
2009-09-20 20:51:32 +00:00
|
|
|
lighttable_t *oldcolormap = vis->colormap;
|
2008-01-27 11:25:03 +00:00
|
|
|
camera->Inventory->AlterWeaponSprite (vis);
|
2009-09-20 20:51:32 +00:00
|
|
|
if (vis->colormap != oldcolormap)
|
|
|
|
{
|
|
|
|
// The colormap has changed. Is it one we can easily identify?
|
|
|
|
// If not, then don't bother trying to identify it for
|
|
|
|
// hardware accelerated drawing.
|
2009-09-21 20:54:52 +00:00
|
|
|
if (vis->colormap < SpecialColormaps[0].Colormap ||
|
|
|
|
vis->colormap >= SpecialColormaps[SpecialColormaps.Size()].Colormap)
|
2009-09-20 20:51:32 +00:00
|
|
|
{
|
|
|
|
noaccel = true;
|
|
|
|
}
|
|
|
|
// Has the basecolormap changed? If so, we can't hardware accelerate it,
|
|
|
|
// since we don't know what it is anymore.
|
|
|
|
else if (vis->colormap < mybasecolormap->Maps ||
|
|
|
|
vis->colormap >= mybasecolormap->Maps + NUMCOLORMAPS*256)
|
|
|
|
{
|
|
|
|
noaccel = true;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
VisPSpritesBaseColormap[pspnum] = mybasecolormap;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-09-20 20:51:32 +00:00
|
|
|
VisPSpritesBaseColormap[pspnum] = basecolormap;
|
2009-09-27 07:11:21 +00:00
|
|
|
vis->colormap = basecolormap->Maps;
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->RenderStyle = STYLE_Normal;
|
|
|
|
}
|
2009-09-20 20:51:32 +00:00
|
|
|
|
|
|
|
// Check for hardware-assisted 2D. If it's available, and this sprite is not
|
|
|
|
// fuzzy, don't draw it until after the switch to 2D mode.
|
|
|
|
if (!noaccel && RenderTarget == screen && (DFrameBuffer *)screen->Accel2D)
|
|
|
|
{
|
|
|
|
FRenderStyle style = vis->RenderStyle;
|
|
|
|
style.CheckFuzz();
|
|
|
|
if (style.BlendOp != STYLEOP_Fuzz)
|
|
|
|
{
|
|
|
|
VisPSprites[pspnum] = vis;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
R_DrawVisSprite (vis);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-20 20:51:32 +00:00
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// R_DrawPlayerSprites
|
|
|
|
//
|
2009-09-20 20:51:32 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
void R_DrawPlayerSprites (void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int lightnum;
|
|
|
|
pspdef_t* psp;
|
|
|
|
sector_t* sec;
|
|
|
|
static sector_t tempsec;
|
|
|
|
int floorlight, ceilinglight;
|
2009-09-20 20:51:32 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!r_drawplayersprites ||
|
|
|
|
!camera->player ||
|
|
|
|
(players[consoleplayer].cheats & CF_CHASECAM))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// This used to use camera->Sector but due to interpolation that can be incorrect
|
|
|
|
// when the interpolated viewpoint is in a different sector than the camera.
|
|
|
|
sec = R_FakeFlat (viewsector, &tempsec, &floorlight,
|
|
|
|
&ceilinglight, false);
|
|
|
|
|
|
|
|
// [RH] set foggy flag
|
|
|
|
foggy = (level.fadeto || sec->ColorMap->Fade || (level.flags & LEVEL_HASFADETABLE));
|
|
|
|
r_actualextralight = foggy ? 0 : extralight << 4;
|
|
|
|
|
|
|
|
// [RH] set basecolormap
|
2008-01-27 15:34:47 +00:00
|
|
|
basecolormap = sec->ColorMap;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// get light level
|
|
|
|
lightnum = ((floorlight + ceilinglight) >> 1) + r_actualextralight;
|
|
|
|
spriteshade = LIGHT2SHADE(lightnum) - 24*FRACUNIT;
|
|
|
|
|
|
|
|
// clip to screen bounds
|
|
|
|
mfloorclip = screenheightarray;
|
|
|
|
mceilingclip = zeroarray;
|
|
|
|
|
|
|
|
if (camera->player != NULL)
|
|
|
|
{
|
|
|
|
fixed_t centerhack = centeryfrac;
|
|
|
|
fixed_t ofsx, ofsy;
|
|
|
|
|
|
|
|
centery = viewheight >> 1;
|
|
|
|
centeryfrac = centery << FRACBITS;
|
|
|
|
|
|
|
|
P_BobWeapon (camera->player, &camera->player->psprites[ps_weapon], &ofsx, &ofsy);
|
|
|
|
|
|
|
|
// add all active psprites
|
|
|
|
for (i = 0, psp = camera->player->psprites;
|
|
|
|
i < NUMPSPRITES;
|
|
|
|
i++, psp++)
|
|
|
|
{
|
|
|
|
// [RH] Don't draw the targeter's crosshair if the player already has a crosshair set.
|
|
|
|
if (psp->state && (i != ps_targetcenter || CrosshairImage == NULL))
|
|
|
|
{
|
|
|
|
R_DrawPSprite (psp, i, camera, psp->sx + ofsx, psp->sy + ofsy);
|
|
|
|
}
|
|
|
|
// [RH] Don't bob the targeter.
|
|
|
|
if (i == ps_flash)
|
|
|
|
{
|
|
|
|
ofsx = ofsy = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
centeryfrac = centerhack;
|
|
|
|
centery = centerhack >> FRACBITS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-20 20:51:32 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_DrawRemainingPlayerSprites
|
|
|
|
//
|
|
|
|
// Called from D_Display to draw sprites that were not drawn by
|
|
|
|
// R_DrawPlayerSprites().
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_DrawRemainingPlayerSprites()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < NUMPSPRITES; ++i)
|
|
|
|
{
|
|
|
|
vissprite_t *vis;
|
|
|
|
|
|
|
|
vis = VisPSprites[i];
|
|
|
|
VisPSprites[i] = NULL;
|
|
|
|
|
|
|
|
if (vis != NULL)
|
|
|
|
{
|
|
|
|
FDynamicColormap *colormap = VisPSpritesBaseColormap[i];
|
|
|
|
bool flip = vis->xiscale < 0;
|
2009-09-21 20:54:52 +00:00
|
|
|
FSpecialColormap *special = NULL;
|
2009-09-20 20:51:32 +00:00
|
|
|
PalEntry overlay = 0;
|
|
|
|
FColormapStyle colormapstyle;
|
|
|
|
bool usecolormapstyle = false;
|
|
|
|
|
2009-09-21 20:54:52 +00:00
|
|
|
if (vis->colormap >= SpecialColormaps[0].Colormap &&
|
|
|
|
vis->colormap < SpecialColormaps[SpecialColormaps.Size()].Colormap)
|
2009-09-20 20:51:32 +00:00
|
|
|
{
|
2009-09-21 20:54:52 +00:00
|
|
|
// Yuck! There needs to be a better way to store colormaps in the vissprite... :(
|
|
|
|
ptrdiff_t specialmap = (vis->colormap - SpecialColormaps[0].Colormap) / sizeof(FSpecialColormap);
|
|
|
|
special = &SpecialColormaps[specialmap];
|
2009-09-20 20:51:32 +00:00
|
|
|
}
|
|
|
|
else if (colormap->Color == PalEntry(255,255,255) &&
|
|
|
|
colormap->Desaturate == 0)
|
|
|
|
{
|
|
|
|
overlay = colormap->Fade;
|
|
|
|
overlay.a = BYTE(((vis->colormap - colormap->Maps) >> 8) * 255 / NUMCOLORMAPS);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
usecolormapstyle = true;
|
|
|
|
colormapstyle.Color = colormap->Color;
|
|
|
|
colormapstyle.Fade = colormap->Fade;
|
|
|
|
colormapstyle.Desaturate = colormap->Desaturate;
|
|
|
|
colormapstyle.FadeLevel = ((vis->colormap - colormap->Maps) >> 8) / float(NUMCOLORMAPS);
|
|
|
|
}
|
|
|
|
screen->DrawTexture(vis->pic,
|
|
|
|
viewwindowx + VisPSpritesX1[i],
|
Update to ZDoom r 1957:
- Changed all coordinates for DrawTexture() to floating point so that the
player sprites will retain the same precision they had when they were
rendered as part of the 3D view. (needed for propery alignment of flashes
on top of weapon sprites) It worked just fine for D3D, but software
rendering was another matter. I consequently did battle with imprecisions
in the whole masked texture drawing routines that had previously been
partially masked by only drawing on whole pixel boundaries. Particularly,
the tops of posts are calculated by multiplying by spryscale, and the
texture mapping coordinates are calculated by multiplying by dc_iscale
(where dc_iscale = 1 / spryscale). Since these are both 16.16 fixed point
values, there is a significant variance. For best results, the drawing
routines should only use one of these values, but that would mean
introducing division into the inner loop. If the division removed the
necessity for the fudge code in R_DrawMaskedColumn(), would it be worth it?
Or would the divide be slower than the fudging? Or would I be better off
doing it like Build and using transparent pixel checks instead, not
bothering with skipping transparent areas? For now, I chop off the
fractional part of the top coordinate for software drawing, since it was
the easiest thing to do (even if it wasn't the most correct thing to do).
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@594 b0f79afe-0144-0410-b225-9a4edf0717df
2009-11-01 07:23:43 +00:00
|
|
|
viewwindowy + viewheight/2 - (vis->texturemid / 65536.0) * (vis->yscale / 65536.0) - 0.5,
|
|
|
|
DTA_DestWidthF, FIXED2FLOAT(vis->pic->GetWidth() * vis->xscale),
|
|
|
|
DTA_DestHeightF, FIXED2FLOAT(vis->pic->GetHeight() * vis->yscale),
|
2009-09-20 20:51:32 +00:00
|
|
|
DTA_Translation, TranslationToTable(vis->Translation),
|
|
|
|
DTA_FlipX, flip,
|
|
|
|
DTA_TopOffset, 0,
|
|
|
|
DTA_LeftOffset, 0,
|
|
|
|
DTA_ClipLeft, viewwindowx,
|
|
|
|
DTA_ClipTop, viewwindowy,
|
|
|
|
DTA_ClipRight, viewwindowx + viewwidth,
|
|
|
|
DTA_ClipBottom, viewwindowy + viewheight,
|
|
|
|
DTA_Alpha, vis->alpha,
|
|
|
|
DTA_RenderStyle, vis->RenderStyle,
|
|
|
|
DTA_FillColor, vis->FillColor,
|
|
|
|
DTA_SpecialColormap, special,
|
2009-10-01 21:04:23 +00:00
|
|
|
DTA_ColorOverlay, overlay.d,
|
2009-09-20 20:51:32 +00:00
|
|
|
DTA_ColormapStyle, usecolormapstyle ? &colormapstyle : NULL,
|
|
|
|
TAG_DONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_SortVisSprites
|
|
|
|
//
|
|
|
|
// [RH] The old code for this function used a bubble sort, which was far less
|
|
|
|
// than optimal with large numbers of sprites. I changed it to use the
|
|
|
|
// stdlib qsort() function instead, and now it is a *lot* faster; the
|
|
|
|
// more vissprites that need to be sorted, the better the performance
|
|
|
|
// gain compared to the old function.
|
|
|
|
//
|
|
|
|
// Sort vissprites by depth, far to near
|
2009-12-18 09:11:54 +00:00
|
|
|
static bool sv_compare(vissprite_t *a, vissprite_t *b)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-12-18 09:11:54 +00:00
|
|
|
return a->idepth > b->idepth;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
static drawseg_t **drawsegsorter;
|
|
|
|
static int drawsegsortersize = 0;
|
|
|
|
|
|
|
|
// Sort vissprites by leftmost column, left to right
|
|
|
|
static int STACK_ARGS sv_comparex (const void *arg1, const void *arg2)
|
|
|
|
{
|
|
|
|
return (*(vissprite_t **)arg2)->x1 - (*(vissprite_t **)arg1)->x1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sort drawsegs by rightmost column, left to right
|
|
|
|
static int STACK_ARGS sd_comparex (const void *arg1, const void *arg2)
|
|
|
|
{
|
|
|
|
return (*(drawseg_t **)arg2)->x2 - (*(drawseg_t **)arg1)->x2;
|
|
|
|
}
|
|
|
|
|
|
|
|
CVAR (Bool, r_splitsprites, true, CVAR_ARCHIVE)
|
|
|
|
|
|
|
|
// Split up vissprites that intersect drawsegs
|
|
|
|
void R_SplitVisSprites ()
|
|
|
|
{
|
|
|
|
size_t start, stop;
|
|
|
|
size_t numdrawsegs = ds_p - firstdrawseg;
|
|
|
|
size_t numsprites;
|
|
|
|
size_t spr, dseg, dseg2;
|
|
|
|
|
|
|
|
if (!r_splitsprites)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (numdrawsegs == 0 || vissprite_p - firstvissprite == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Sort drawsegs from left to right
|
|
|
|
if (numdrawsegs > drawsegsortersize)
|
|
|
|
{
|
|
|
|
if (drawsegsorter != NULL)
|
|
|
|
delete[] drawsegsorter;
|
|
|
|
drawsegsortersize = numdrawsegs * 2;
|
|
|
|
drawsegsorter = new drawseg_t *[drawsegsortersize];
|
|
|
|
}
|
|
|
|
for (dseg = dseg2 = 0; dseg < numdrawsegs; ++dseg)
|
|
|
|
{
|
|
|
|
// Drawsegs that don't clip any sprites don't need to be considered.
|
|
|
|
if (firstdrawseg[dseg].silhouette)
|
|
|
|
{
|
|
|
|
drawsegsorter[dseg2++] = &firstdrawseg[dseg];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
numdrawsegs = dseg2;
|
|
|
|
if (numdrawsegs == 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
qsort (drawsegsorter, numdrawsegs, sizeof(drawseg_t *), sd_comparex);
|
|
|
|
|
|
|
|
// Now sort vissprites from left to right, and walk them simultaneously
|
|
|
|
// with the drawsegs, splitting any that intersect.
|
|
|
|
start = firstvissprite - vissprites;
|
|
|
|
|
|
|
|
int p = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
p++;
|
|
|
|
R_SortVisSprites (sv_comparex, start);
|
|
|
|
stop = vissprite_p - vissprites;
|
|
|
|
numsprites = stop - start;
|
|
|
|
|
|
|
|
spr = dseg = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
vissprite_t *vis = spritesorter[spr], *vis2;
|
|
|
|
|
|
|
|
// Skip drawsegs until we get to one that doesn't end before the sprite
|
|
|
|
// begins.
|
|
|
|
while (dseg < numdrawsegs && drawsegsorter[dseg]->x2 <= vis->x1)
|
|
|
|
{
|
|
|
|
dseg++;
|
|
|
|
}
|
|
|
|
// Now split the sprite against any drawsegs it intersects
|
|
|
|
for (dseg2 = dseg; dseg2 < numdrawsegs; dseg2++)
|
|
|
|
{
|
|
|
|
drawseg_t *ds = drawsegsorter[dseg2];
|
|
|
|
|
|
|
|
if (ds->x1 > vis->x2 || ds->x2 < vis->x1)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((vis->idepth < ds->siz1) != (vis->idepth < ds->siz2))
|
|
|
|
{ // The drawseg is crossed; find the x where the intersection occurs
|
|
|
|
int cross = Scale (vis->idepth - ds->siz1, ds->sx2 - ds->sx1, ds->siz2 - ds->siz1) + ds->sx1 + 1;
|
|
|
|
|
|
|
|
/* if (cross < ds->x1 || cross > ds->x2)
|
|
|
|
{ // The original seg is crossed, but the drawseg is not
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
*/ if (cross <= vis->x1 || cross >= vis->x2)
|
|
|
|
{ // Don't create 0-sized sprites
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
vis->bSplitSprite = true;
|
|
|
|
|
|
|
|
// Create a new vissprite for the right part of the sprite
|
|
|
|
vis2 = R_NewVisSprite ();
|
|
|
|
*vis2 = *vis;
|
|
|
|
vis2->startfrac += vis2->xiscale * (cross - vis2->x1);
|
|
|
|
vis->x2 = cross-1;
|
|
|
|
vis2->x1 = cross;
|
|
|
|
//vis2->alpha /= 2;
|
|
|
|
//vis2->RenderStyle = STYLE_Add;
|
|
|
|
|
|
|
|
if (vis->idepth < ds->siz1)
|
|
|
|
{ // Left is in back, right is in front
|
|
|
|
vis->sector = ds->curline->backsector;
|
|
|
|
vis2->sector = ds->curline->frontsector;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Right is in front, left is in back
|
|
|
|
vis->sector = ds->curline->frontsector;
|
|
|
|
vis2->sector = ds->curline->backsector;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (dseg < numdrawsegs && ++spr < numsprites);
|
|
|
|
|
|
|
|
// Repeat for any new sprites that were added.
|
|
|
|
}
|
|
|
|
while (start = stop, stop != vissprite_p - vissprites);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-12-18 09:11:54 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
static void swap(vissprite_t *&a, vissprite_t *&b)
|
|
|
|
{
|
|
|
|
vissprite_t *t = a;
|
|
|
|
a = b;
|
|
|
|
b = t;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void R_SortVisSprites (bool (*compare)(vissprite_t *, vissprite_t *), size_t first)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
vissprite_t **spr;
|
|
|
|
|
|
|
|
vsprcount = int(vissprite_p - &vissprites[first]);
|
|
|
|
|
|
|
|
if (vsprcount == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (spritesortersize < MaxVisSprites)
|
|
|
|
{
|
|
|
|
if (spritesorter != NULL)
|
|
|
|
delete[] spritesorter;
|
|
|
|
spritesorter = new vissprite_t *[MaxVisSprites];
|
|
|
|
spritesortersize = MaxVisSprites;
|
|
|
|
}
|
|
|
|
|
2009-12-18 09:11:54 +00:00
|
|
|
if (!(i_compatflags & COMPATF_SPRITESORT))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-12-18 09:11:54 +00:00
|
|
|
for (i = 0, spr = firstvissprite; i < vsprcount; i++, spr++)
|
|
|
|
{
|
|
|
|
spritesorter[i] = *spr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// If the compatibility option is on sprites of equal distance need to
|
|
|
|
// be sorted in inverse order. This is most easily achieved by
|
|
|
|
// filling the sort array backwards before the sort.
|
|
|
|
for (i = 0, spr = firstvissprite + vsprcount-1; i < vsprcount; i++, spr--)
|
|
|
|
{
|
|
|
|
spritesorter[i] = *spr;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2009-12-18 09:11:54 +00:00
|
|
|
std::stable_sort(&spritesorter[0], &spritesorter[vsprcount], compare);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawSprite
|
|
|
|
//
|
|
|
|
void R_DrawSprite (vissprite_t *spr)
|
|
|
|
{
|
|
|
|
static short clipbot[MAXWIDTH];
|
|
|
|
static short cliptop[MAXWIDTH];
|
|
|
|
drawseg_t *ds;
|
|
|
|
int i;
|
|
|
|
int r1, r2;
|
|
|
|
short topclip, botclip;
|
|
|
|
short *clip1, *clip2;
|
|
|
|
|
|
|
|
// [RH] Check for particles
|
|
|
|
if (spr->pic == NULL)
|
|
|
|
{
|
|
|
|
R_DrawParticle (spr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Quickly reject sprites with bad x ranges.
|
|
|
|
if (spr->x1 > spr->x2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// [RH] Sprites split behind a one-sided line can also be discarded.
|
|
|
|
if (spr->sector == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// [RH] Initialize the clipping arrays to their largest possible range
|
|
|
|
// instead of using a special "not clipped" value. This eliminates
|
|
|
|
// visual anomalies when looking down and should be faster, too.
|
|
|
|
topclip = 0;
|
|
|
|
botclip = viewheight;
|
|
|
|
|
|
|
|
// killough 3/27/98:
|
|
|
|
// Clip the sprite against deep water and/or fake ceilings.
|
|
|
|
// [RH] rewrote this to be based on which part of the sector is really visible
|
|
|
|
|
|
|
|
fixed_t scale = MulScale19 (InvZtoScale, spr->idepth);
|
|
|
|
|
|
|
|
if (spr->heightsec &&
|
|
|
|
!(spr->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
|
|
|
{ // only things in specially marked sectors
|
|
|
|
if (spr->FakeFlatStat != FAKED_AboveCeiling)
|
|
|
|
{
|
|
|
|
fixed_t h = spr->heightsec->floorplane.ZatPoint (spr->gx, spr->gy);
|
|
|
|
//h = (centeryfrac - FixedMul (h-viewz, spr->yscale)) >> FRACBITS;
|
|
|
|
h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS;
|
|
|
|
|
|
|
|
if (spr->FakeFlatStat == FAKED_BelowFloor)
|
|
|
|
{ // seen below floor: clip top
|
|
|
|
if (h > topclip)
|
|
|
|
{
|
|
|
|
topclip = MIN<short> (h, viewheight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // seen in the middle: clip bottom
|
|
|
|
if (h < botclip)
|
|
|
|
{
|
|
|
|
botclip = MAX<short> (0, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (spr->FakeFlatStat != FAKED_BelowFloor)
|
|
|
|
{
|
|
|
|
fixed_t h = spr->heightsec->ceilingplane.ZatPoint (spr->gx, spr->gy);
|
|
|
|
h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS;
|
|
|
|
|
|
|
|
if (spr->FakeFlatStat == FAKED_AboveCeiling)
|
|
|
|
{ // seen above ceiling: clip bottom
|
|
|
|
if (h < botclip)
|
|
|
|
{
|
|
|
|
botclip = MAX<short> (0, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // seen in the middle: clip top
|
|
|
|
if (h > topclip)
|
|
|
|
{
|
|
|
|
topclip = MIN<short> (h, viewheight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// killough 3/27/98: end special clipping for deep water / fake ceilings
|
|
|
|
else if (spr->floorclip)
|
|
|
|
{ // [RH] Move floorclip stuff from R_DrawVisSprite to here
|
|
|
|
int clip = ((centeryfrac - FixedMul (spr->texturemid -
|
|
|
|
(spr->pic->GetHeight() << FRACBITS) +
|
|
|
|
spr->floorclip, spr->yscale)) >> FRACBITS);
|
|
|
|
if (clip < botclip)
|
|
|
|
{
|
|
|
|
botclip = MAX<short> (0, clip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// [RH] Sprites that were split by a drawseg should also be clipped
|
|
|
|
// by the sector's floor and ceiling. (Not sure how/if to handle this
|
|
|
|
// with fake floors, since those already do clipping.)
|
|
|
|
if (spr->bSplitSprite &&
|
|
|
|
(spr->heightsec == NULL || (spr->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
|
|
|
|
{
|
|
|
|
fixed_t h = spr->sector->floorplane.ZatPoint (spr->gx, spr->gy);
|
|
|
|
h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS;
|
|
|
|
if (h < botclip)
|
|
|
|
{
|
|
|
|
botclip = MAX<short> (0, h);
|
|
|
|
}
|
|
|
|
h = spr->sector->ceilingplane.ZatPoint (spr->gx, spr->gy);
|
|
|
|
h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS;
|
|
|
|
if (h > topclip)
|
|
|
|
{
|
|
|
|
topclip = MIN<short> (h, viewheight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
i = spr->x2 - spr->x1 + 1;
|
|
|
|
clip1 = clipbot + spr->x1;
|
|
|
|
clip2 = cliptop + spr->x1;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
*clip1++ = botclip;
|
|
|
|
*clip2++ = topclip;
|
|
|
|
} while (--i);
|
|
|
|
|
|
|
|
// Scan drawsegs from end to start for obscuring segs.
|
|
|
|
// The first drawseg that is closer than the sprite is the clip seg.
|
|
|
|
|
|
|
|
// Modified by Lee Killough:
|
|
|
|
// (pointer check was originally nonportable
|
|
|
|
// and buggy, by going past LEFT end of array):
|
|
|
|
|
|
|
|
// for (ds=ds_p-1 ; ds >= drawsegs ; ds--) old buggy code
|
|
|
|
|
|
|
|
for (ds = ds_p; ds-- > firstdrawseg; ) // new -- killough
|
|
|
|
{
|
|
|
|
// determine if the drawseg obscures the sprite
|
|
|
|
if (ds->x1 > spr->x2 || ds->x2 < spr->x1 ||
|
|
|
|
(!(ds->silhouette & SIL_BOTH) && ds->maskedtexturecol == -1 &&
|
|
|
|
!ds->bFogBoundary) )
|
|
|
|
{
|
|
|
|
// does not cover sprite
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
r1 = MAX<int> (ds->x1, spr->x1);
|
|
|
|
r2 = MIN<int> (ds->x2, spr->x2);
|
|
|
|
|
2009-02-08 23:01:13 +00:00
|
|
|
fixed_t neardepth, fardepth;
|
|
|
|
if (ds->sz1 < ds->sz2)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2009-02-08 23:01:13 +00:00
|
|
|
neardepth = ds->sz1, fardepth = ds->sz2;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-02-08 23:01:13 +00:00
|
|
|
neardepth = ds->sz2, fardepth = ds->sz1;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2009-02-08 23:01:13 +00:00
|
|
|
if (neardepth > spr->depth || (fardepth > spr->depth &&
|
2008-01-27 11:25:03 +00:00
|
|
|
// Check if sprite is in front of draw seg:
|
2010-11-19 09:53:59 +00:00
|
|
|
DMulScale32(spr->gy - ds->curline->v1->y, ds->curline->v2->x - ds->curline->v1->x,
|
|
|
|
ds->curline->v1->x - spr->gx, ds->curline->v2->y - ds->curline->v1->y) <= 0))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// seg is behind sprite, so draw the mid texture if it has one
|
|
|
|
if (ds->maskedtexturecol != -1 || ds->bFogBoundary)
|
|
|
|
R_RenderMaskedSegRange (ds, r1, r2);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// clip this piece of the sprite
|
|
|
|
// killough 3/27/98: optimized and made much shorter
|
|
|
|
// [RH] Optimized further (at least for VC++;
|
|
|
|
// other compilers should be at least as good as before)
|
|
|
|
|
|
|
|
if (ds->silhouette & SIL_BOTTOM) //bottom sil
|
|
|
|
{
|
|
|
|
clip1 = clipbot + r1;
|
|
|
|
clip2 = openings + ds->sprbottomclip + r1 - ds->x1;
|
|
|
|
i = r2 - r1 + 1;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (*clip1 > *clip2)
|
|
|
|
*clip1 = *clip2;
|
|
|
|
clip1++;
|
|
|
|
clip2++;
|
|
|
|
} while (--i);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ds->silhouette & SIL_TOP) // top sil
|
|
|
|
{
|
|
|
|
clip1 = cliptop + r1;
|
|
|
|
clip2 = openings + ds->sprtopclip + r1 - ds->x1;
|
|
|
|
i = r2 - r1 + 1;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (*clip1 < *clip2)
|
|
|
|
*clip1 = *clip2;
|
|
|
|
clip1++;
|
|
|
|
clip2++;
|
|
|
|
} while (--i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// all clipping has been performed, so draw the sprite
|
|
|
|
|
|
|
|
mfloorclip = clipbot;
|
|
|
|
mceilingclip = cliptop;
|
|
|
|
R_DrawVisSprite (spr);
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// R_DrawMasked
|
|
|
|
//
|
|
|
|
void R_DrawMasked (void)
|
|
|
|
{
|
|
|
|
drawseg_t *ds;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
R_SplitVisSprites ();
|
|
|
|
#endif
|
|
|
|
R_SortVisSprites (sv_compare, firstvissprite - vissprites);
|
|
|
|
|
|
|
|
for (i = vsprcount; i > 0; i--)
|
|
|
|
{
|
|
|
|
R_DrawSprite (spritesorter[i-1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// render any remaining masked mid textures
|
|
|
|
|
|
|
|
// Modified by Lee Killough:
|
|
|
|
// (pointer check was originally nonportable
|
|
|
|
// and buggy, by going past LEFT end of array):
|
|
|
|
|
|
|
|
// for (ds=ds_p-1 ; ds >= drawsegs ; ds--) old buggy code
|
|
|
|
|
|
|
|
for (ds = ds_p; ds-- > firstdrawseg; ) // new -- killough
|
|
|
|
{
|
|
|
|
if (ds->maskedtexturecol != -1 || ds->bFogBoundary)
|
|
|
|
{
|
|
|
|
R_RenderMaskedSegRange (ds, ds->x1, ds->x2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw the psprites on top of everything but does not draw on side views
|
|
|
|
if (!viewangleoffset)
|
|
|
|
{
|
|
|
|
R_DrawPlayerSprites ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// [RH] Particle functions
|
|
|
|
//
|
|
|
|
|
|
|
|
// [BC] Allow the maximum number of particles to be specified by a cvar (so people
|
|
|
|
// with lots of nice hardware can have lots of particles!).
|
|
|
|
CUSTOM_CVAR( Int, r_maxparticles, 4000, CVAR_ARCHIVE )
|
|
|
|
{
|
|
|
|
if ( self == 0 )
|
|
|
|
self = 4000;
|
|
|
|
else if ( self < 100 )
|
|
|
|
self = 100;
|
|
|
|
|
|
|
|
if ( gamestate != GS_STARTUP )
|
|
|
|
{
|
|
|
|
R_DeinitParticles( );
|
|
|
|
R_InitParticles( );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_InitParticles ()
|
|
|
|
{
|
- Update to ZDoom r2187:
- Yet another piece of essentially broken code that has to go back in because some people had to abuse it:
Reinstated Doom's original code that made projectiles with the MF_NOCLIP flag set continue to exist even
though the movement itself was never properly handled.
Fortunately the game mode check formerly associated with this can be removed because none of the other games have
any projectiles using MF_NOCLIP so at least it's no longer restricted to Doom...
- The console separator bars now get converted to something printable in Unicode for the log.
- Fixed: Only the last line of multi-line log output received Unicode treatment.
- Add the game log to the crash report. I don't know why I didn't think to do this sooner.
Since we're already sending everything to a rich edit control hidden in the background,
we can just grab its contents for the report.
- Use code page 1252 when previewing text files in the crash dialog.
- Everything on the command line before the first switch with an unrecognized switch is
now added to -file. This was previously restricted to only .wad, .zip, .pk3, and .txt.
- You can now pass -file/-deh/-bex more than once on the command line, and they will all
have effect.
- Changed DArgs to use a TArray of FStrings instead of doing its own string vector management
in preparation for doing GatherFiles the "right" way.
- Fixed: DrawHudText() needs to verify that the character glyph is valid before accessing
its fields.
- V_GetFont() needs to check the font header.
- Added BMF (ByteMap Font) support. This was complicated somewhat by the fact that BMF can
specify a character advance separately from the glyph width. GetChar and GetCharWidth now
return this value in place of the glyph width. (For non-BMF fonts, these should still
return the same values as before.)
- Added A_CheckSightOrRange, with changes.
- Explicitly setting the charset for the EM_SETCHARFORMAT message seems to do what I want.
- Use the Unicode RichEdit control instead of the MBCS version, so as to enforce the use
of code page 1252 for output text. This is noticeable, for example, with the FMOD copyright
notice where the copyright symbol appears as ? (halfwidth katakana small U) with code page 932.
- Change the log window to use DejaVu Sans instead of Bitstream Vera Sans, because
Silverex's X-Chat comes with the former now. Unfortunately, I can't seem to actually
set the font when my system default code page is 932, since it wants to use some Kanji-
compatible font instead. I wonder if I can still use the Unicode RichEdit control with
Windows 9x. (Does it even matter? Windows 9x users make up less than 0.1% of all visitors
to zdoom.org these days.)
- Added -nostartup switch to disable the more graphical startup screens of Heretic, Hexen,
and Strife.
- Pretty sure the minimum FMOD version is 4.22.
- added an option to disable player translations in single player games.
- added a file 'fmod_version.txt' so that the source always comes with the information which FMod version to use.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@743 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-04 10:16:08 +00:00
|
|
|
const char *i;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
if ((i = Args->CheckValue ("-numparticles")))
|
2008-01-27 11:25:03 +00:00
|
|
|
NumParticles = atoi (i);
|
|
|
|
// [BC] Use r_maxparticles now.
|
|
|
|
else
|
|
|
|
NumParticles = r_maxparticles;
|
|
|
|
|
|
|
|
// This should be good, but eh...
|
|
|
|
if ( NumParticles < 100 )
|
|
|
|
NumParticles = 100;
|
|
|
|
|
2010-12-14 22:53:44 +00:00
|
|
|
R_DeinitParticles();
|
2008-01-27 11:25:03 +00:00
|
|
|
Particles = new particle_t[NumParticles];
|
|
|
|
R_ClearParticles ();
|
|
|
|
atterm (R_DeinitParticles);
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_DeinitParticles()
|
|
|
|
{
|
|
|
|
if (Particles != NULL)
|
|
|
|
{
|
|
|
|
delete[] Particles;
|
|
|
|
Particles = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_ClearParticles ()
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
memset (Particles, 0, NumParticles * sizeof(particle_t));
|
|
|
|
ActiveParticles = NO_PARTICLE;
|
|
|
|
InactiveParticles = 0;
|
|
|
|
for (i = 0; i < NumParticles-1; i++)
|
|
|
|
Particles[i].tnext = i + 1;
|
|
|
|
Particles[i].tnext = NO_PARTICLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Group particles by subsectors. Because particles are always
|
|
|
|
// in motion, there is little benefit to caching this information
|
|
|
|
// from one frame to the next.
|
|
|
|
|
|
|
|
void R_FindParticleSubsectors ()
|
|
|
|
{
|
|
|
|
if (ParticlesInSubsec.Size() < (size_t)numsubsectors)
|
|
|
|
{
|
|
|
|
ParticlesInSubsec.Reserve (numsubsectors - ParticlesInSubsec.Size());
|
|
|
|
}
|
|
|
|
|
|
|
|
clearbufshort (&ParticlesInSubsec[0], numsubsectors, NO_PARTICLE);
|
|
|
|
|
|
|
|
if (!r_particles)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (WORD i = ActiveParticles; i != NO_PARTICLE; i = Particles[i].tnext)
|
|
|
|
{
|
|
|
|
subsector_t *ssec = R_PointInSubsector (Particles[i].x, Particles[i].y);
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
int ssnum = int(ssec-subsectors);
|
2008-01-27 11:25:03 +00:00
|
|
|
Particles[i].subsector = ssec;
|
|
|
|
Particles[i].snext = ParticlesInSubsec[ssnum];
|
|
|
|
ParticlesInSubsec[ssnum] = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_ProjectParticle (particle_t *particle, const sector_t *sector, int shade, int fakeside)
|
|
|
|
{
|
|
|
|
fixed_t tr_x;
|
|
|
|
fixed_t tr_y;
|
|
|
|
fixed_t tx, ty;
|
|
|
|
fixed_t tz, tiz;
|
|
|
|
fixed_t xscale, yscale;
|
|
|
|
int x1, x2, y1, y2;
|
|
|
|
vissprite_t* vis;
|
|
|
|
sector_t* heightsec = NULL;
|
|
|
|
BYTE* map;
|
|
|
|
|
|
|
|
// transform the origin point
|
|
|
|
tr_x = particle->x - viewx;
|
|
|
|
tr_y = particle->y - viewy;
|
|
|
|
|
|
|
|
tz = DMulScale20 (tr_x, viewtancos, tr_y, viewtansin);
|
|
|
|
|
|
|
|
// particle is behind view plane?
|
|
|
|
if (tz < MINZ)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tx = DMulScale20 (tr_x, viewsin, -tr_y, viewcos);
|
|
|
|
|
|
|
|
// Flip for mirrors
|
|
|
|
if (MirrorFlags & RF_XFLIP)
|
|
|
|
{
|
|
|
|
tx = viewwidth - tx - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// too far off the side?
|
|
|
|
if (tz <= abs (tx))
|
|
|
|
return;
|
|
|
|
|
|
|
|
tiz = 268435456 / tz;
|
|
|
|
xscale = centerx * tiz;
|
|
|
|
|
|
|
|
// calculate edges of the shape
|
|
|
|
int psize = particle->size << (12-3);
|
|
|
|
|
|
|
|
x1 = MAX<int> (WindowLeft, (centerxfrac + MulScale12 (tx-psize, xscale)) >> FRACBITS);
|
|
|
|
x2 = MIN<int> (WindowRight, (centerxfrac + MulScale12 (tx+psize, xscale)) >> FRACBITS);
|
|
|
|
|
|
|
|
if (x1 >= x2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
yscale = MulScale16 (yaspectmul, xscale);
|
|
|
|
ty = particle->z - viewz;
|
|
|
|
psize <<= 4;
|
|
|
|
y1 = (centeryfrac - FixedMul (ty+psize, yscale)) >> FRACBITS;
|
|
|
|
y2 = (centeryfrac - FixedMul (ty-psize, yscale)) >> FRACBITS;
|
|
|
|
|
|
|
|
// Clip the particle now. Because it's a point and projected as its subsector is
|
|
|
|
// entered, we don't need to clip it to drawsegs like a normal sprite.
|
|
|
|
|
|
|
|
// Clip particles behind walls.
|
|
|
|
if (y1 < ceilingclip[x1]) y1 = ceilingclip[x1];
|
|
|
|
if (y1 < ceilingclip[x2-1]) y1 = ceilingclip[x2-1];
|
|
|
|
if (y2 >= floorclip[x1]) y2 = floorclip[x1] - 1;
|
|
|
|
if (y2 >= floorclip[x2-1]) y2 = floorclip[x2-1] - 1;
|
|
|
|
|
|
|
|
if (y1 > y2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Clip particles above the ceiling or below the floor.
|
2009-05-23 10:24:33 +00:00
|
|
|
heightsec = sector->GetHeightSec();
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
const secplane_t *topplane;
|
|
|
|
const secplane_t *botplane;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID toppic;
|
|
|
|
FTextureID botpic;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (heightsec) // only clip things which are in special sectors
|
|
|
|
{
|
|
|
|
if (fakeside == FAKED_AboveCeiling)
|
|
|
|
{
|
|
|
|
topplane = §or->ceilingplane;
|
|
|
|
botplane = &heightsec->ceilingplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
toppic = sector->GetTexture(sector_t::ceiling);
|
|
|
|
botpic = heightsec->GetTexture(sector_t::ceiling);
|
2008-01-27 11:25:03 +00:00
|
|
|
map = heightsec->ColorMap->Maps;
|
|
|
|
}
|
|
|
|
else if (fakeside == FAKED_BelowFloor)
|
|
|
|
{
|
|
|
|
topplane = &heightsec->floorplane;
|
|
|
|
botplane = §or->floorplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
toppic = heightsec->GetTexture(sector_t::floor);
|
|
|
|
botpic = sector->GetTexture(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
map = heightsec->ColorMap->Maps;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
topplane = &heightsec->ceilingplane;
|
|
|
|
botplane = &heightsec->floorplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
toppic = heightsec->GetTexture(sector_t::ceiling);
|
|
|
|
botpic = heightsec->GetTexture(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
map = sector->ColorMap->Maps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
topplane = §or->ceilingplane;
|
|
|
|
botplane = §or->floorplane;
|
2008-08-22 07:36:50 +00:00
|
|
|
toppic = sector->GetTexture(sector_t::ceiling);
|
|
|
|
botpic = sector->GetTexture(sector_t::floor);
|
2008-01-27 11:25:03 +00:00
|
|
|
map = sector->ColorMap->Maps;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (botpic != skyflatnum && particle->z < botplane->ZatPoint (particle->x, particle->y))
|
|
|
|
return;
|
|
|
|
if (toppic != skyflatnum && particle->z >= topplane->ZatPoint (particle->x, particle->y))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// store information in a vissprite
|
|
|
|
vis = R_NewVisSprite ();
|
|
|
|
vis->heightsec = heightsec;
|
|
|
|
vis->xscale = xscale;
|
|
|
|
// vis->yscale = FixedMul (xscale, InvZtoScale);
|
|
|
|
vis->yscale = xscale;
|
2009-02-08 23:01:13 +00:00
|
|
|
vis->depth = tz;
|
2008-01-27 11:25:03 +00:00
|
|
|
vis->idepth = (DWORD)DivScale32 (1, tz) >> 1;
|
|
|
|
vis->cx = tx;
|
|
|
|
vis->gx = particle->x;
|
|
|
|
vis->gy = particle->y;
|
|
|
|
vis->gz = y1;
|
|
|
|
vis->gzt = y2;
|
|
|
|
vis->x1 = x1;
|
|
|
|
vis->x2 = x2;
|
|
|
|
vis->Translation = 0;
|
|
|
|
vis->startfrac = particle->color;
|
|
|
|
vis->pic = NULL;
|
|
|
|
vis->renderflags = particle->trans;
|
|
|
|
vis->FakeFlatStat = fakeside;
|
|
|
|
vis->floorclip = 0;
|
|
|
|
vis->heightsec = heightsec;
|
|
|
|
|
2009-09-20 20:51:32 +00:00
|
|
|
if (fixedlightlev >= 0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
vis->colormap = map + fixedlightlev;
|
|
|
|
}
|
|
|
|
else if (fixedcolormap)
|
|
|
|
{
|
|
|
|
vis->colormap = fixedcolormap;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Using MulScale15 instead of 16 makes particles slightly more visible
|
|
|
|
// than regular sprites.
|
|
|
|
vis->colormap = map + (GETPALOOKUP (MulScale15 (tiz, r_SpriteVisibility),
|
|
|
|
shade) << COLORMAPSHIFT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void R_DrawMaskedSegsBehindParticle (const vissprite_t *vis)
|
|
|
|
{
|
|
|
|
const int x1 = vis->x1;
|
|
|
|
const int x2 = vis->x2;
|
|
|
|
|
|
|
|
// Draw any masked textures behind this particle so that when the
|
|
|
|
// particle is drawn, it will be in front of them.
|
|
|
|
for (unsigned int p = InterestingDrawsegs.Size(); p-- > FirstInterestingDrawseg; )
|
|
|
|
{
|
|
|
|
drawseg_t *ds = &drawsegs[InterestingDrawsegs[p]];
|
|
|
|
if (ds->x1 >= x2 || ds->x2 < x1)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (Scale (ds->siz2 - ds->siz1, (x2 + x1)/2 - ds->sx1, ds->sx2 - ds->sx1) + ds->siz1 < vis->idepth)
|
|
|
|
{
|
|
|
|
R_RenderMaskedSegRange (ds, MAX<int> (ds->x1, x1), MIN<int> (ds->x2, x2-1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_DrawParticle (vissprite_t *vis)
|
|
|
|
{
|
|
|
|
DWORD *bg2rgb;
|
|
|
|
int spacing;
|
|
|
|
BYTE *dest;
|
|
|
|
DWORD fg;
|
|
|
|
BYTE color = vis->colormap[vis->startfrac];
|
|
|
|
int yl = vis->gz;
|
|
|
|
int ycount = vis->gzt - yl + 1;
|
|
|
|
int x1 = vis->x1;
|
|
|
|
int countbase = vis->x2 - x1 + 1;
|
|
|
|
|
|
|
|
R_DrawMaskedSegsBehindParticle (vis);
|
|
|
|
|
|
|
|
// vis->renderflags holds translucency level (0-255)
|
|
|
|
{
|
|
|
|
fixed_t fglevel, bglevel;
|
|
|
|
DWORD *fg2rgb;
|
|
|
|
|
|
|
|
fglevel = ((vis->renderflags + 1) << 8) & ~0x3ff;
|
|
|
|
bglevel = FRACUNIT-fglevel;
|
|
|
|
fg2rgb = Col2RGB8[fglevel>>10];
|
|
|
|
bg2rgb = Col2RGB8[bglevel>>10];
|
|
|
|
fg = fg2rgb[color];
|
|
|
|
}
|
|
|
|
|
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
|
|
|
spacing = RenderTarget->GetPitch() - countbase;
|
2008-01-27 11:25:03 +00:00
|
|
|
dest = ylookup[yl] + x1 + dc_destorg;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
int count = countbase;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
DWORD bg = bg2rgb[*dest];
|
|
|
|
bg = (fg+bg) | 0x1f07c1f;
|
|
|
|
*dest++ = RGB32k[0][0][bg & (bg>>15)];
|
|
|
|
} while (--count);
|
|
|
|
dest += spacing;
|
|
|
|
} while (--ycount);
|
|
|
|
}
|