gzdoom-last-svn/src/p_user.cpp

2628 lines
66 KiB
C++
Raw Normal View History

// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:
// Player related stuff.
// Bobbing POV/weapon, movement.
// Pending weapon.
//
//-----------------------------------------------------------------------------
#include "templates.h"
#include "doomdef.h"
#include "d_event.h"
#include "p_local.h"
#include "doomstat.h"
#include "s_sound.h"
#include "i_system.h"
#include "r_draw.h"
#include "gi.h"
#include "m_random.h"
#include "p_pspr.h"
#include "p_enemy.h"
#include "s_sound.h"
#include "a_sharedglobal.h"
#include "a_keys.h"
#include "statnums.h"
#include "v_palette.h"
#include "v_video.h"
#include "w_wad.h"
#include "cmdlib.h"
#include "sbar.h"
#include "f_finale.h"
#include "c_console.h"
#include "doomdef.h"
#include "c_dispatch.h"
#include "tarray.h"
#include "thingdef/thingdef.h"
#include "g_level.h"
#include "d_net.h"
static FRandom pr_skullpop ("SkullPop");
// [RH] # of ticks to complete a turn180
#define TURN180_TICKS ((TICRATE / 4) + 1)
// Variables for prediction
CVAR (Bool, cl_noprediction, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
static player_t PredictionPlayerBackup;
static BYTE PredictionActorBackup[sizeof(AActor)];
static TArray<sector_t *> PredictionTouchingSectorsBackup;
// [GRB] Custom player classes
TArray<FPlayerClass> PlayerClasses;
FPlayerClass::FPlayerClass ()
{
Type = NULL;
Flags = 0;
}
FPlayerClass::FPlayerClass (const FPlayerClass &other)
{
Type = other.Type;
Flags = other.Flags;
Skins = other.Skins;
}
FPlayerClass::~FPlayerClass ()
{
}
bool FPlayerClass::CheckSkin (int skin)
{
for (unsigned int i = 0; i < Skins.Size (); i++)
{
if (Skins[i] == skin)
return true;
}
return false;
}
void SetupPlayerClasses ()
{
FPlayerClass newclass;
newclass.Flags = 0;
if (gameinfo.gametype == GAME_Doom)
{
newclass.Type = PClass::FindClass (NAME_DoomPlayer);
PlayerClasses.Push (newclass);
}
else if (gameinfo.gametype == GAME_Heretic)
{
newclass.Type = PClass::FindClass (NAME_HereticPlayer);
PlayerClasses.Push (newclass);
}
else if (gameinfo.gametype == GAME_Hexen)
{
newclass.Type = PClass::FindClass (NAME_FighterPlayer);
PlayerClasses.Push (newclass);
newclass.Type = PClass::FindClass (NAME_ClericPlayer);
PlayerClasses.Push (newclass);
newclass.Type = PClass::FindClass (NAME_MagePlayer);
PlayerClasses.Push (newclass);
}
else if (gameinfo.gametype == GAME_Strife)
{
newclass.Type = PClass::FindClass (NAME_StrifePlayer);
PlayerClasses.Push (newclass);
}
- Fixed: player.damagescreencolor was not implemented for the GL renderer. Update to ZDoom r1190: - Gave the PlayerPawn base class a default damage fade color instead of hacking it into the actor when actually used. - Fixed: The DamageFade color was not saved in savegames. - Added Blzut3's patch for a real Chex Quest game mode. - Fixed: SKIP_SUPER doesn't work for inventory items so it must be disabled for them - Fixed: Chex Quest doesn't have a HELP2 screen so it must not be used in the gameinfo. - Fixed: Default blood color is no longer red so P_DrawSplash2 must get it from the gameinfo instead. - Added new French language texts by DoomKn1ght_. - Blood default color is set in the gameinfo now so that Chex Quest can default to green instead of red. - Fixed: The version of CheckNumForFullName that checks for a specific WAD did not work. - Moved MAPINFO names into gameinfo structure. - Added Chex Quest support. Credits go to fraggle for creating a Dehacked patch that does most of the work. The rest includes a new MAPINFO and removal of the drop items from the monsters being used. - Added Win64 support to the crash report generator. (Pity that Win32 cannot be as informative.) - Added and fixed Boss death submission for random spawner. - Added functions to FActorInfo that can set the damage factors and pain chances to reduce the chance of new errors when working with these features. - Fixed: The handling of the deprecated FIRERESIST flag didn't work. There were 3 problems: * Actor defaults have no class information so HandleDeprecatedFlags needs to be passed a pointer to the ActorInfo. * The DamageFactors list is only created when needed so the code needs to check if it already exists. * damage factors are stored as fixed_t but this set a float. - Fixed: Timidity::Renderer::reset_voices() must completely zero the voices. Because this wasn't done, note_on() could try to access the sample for a voice that had never been played yet and access random memory. There may be other places where it's a problem, but this is where I noticed it, by chance. - Added a traditional Strife color set for the automap. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@166 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-01 19:08:19 +00:00
else if (gameinfo.gametype == GAME_Chex)
{
newclass.Type = PClass::FindClass (NAME_ChexPlayer);
PlayerClasses.Push (newclass);
}
}
CCMD (clearplayerclasses)
{
if (ParsingKeyConf)
{
PlayerClasses.Clear ();
}
}
CCMD (addplayerclass)
{
if (ParsingKeyConf && argv.argc () > 1)
{
const PClass *ti = PClass::FindClass (argv[1]);
if (!ti)
{
Printf ("Unknown player class '%s'\n", argv[1]);
}
else if (!ti->IsDescendantOf (RUNTIME_CLASS (APlayerPawn)))
{
Printf ("Invalid player class '%s'\n", argv[1]);
}
else if (ti->Meta.GetMetaString (APMETA_DisplayName) == NULL)
{
Printf ("Missing displayname for player class '%s'\n", argv[1]);
}
else
{
FPlayerClass newclass;
newclass.Type = ti;
newclass.Flags = 0;
int arg = 2;
while (arg < argv.argc ())
{
if (!stricmp (argv[arg], "nomenu"))
{
newclass.Flags |= PCF_NOMENU;
}
else
{
Printf ("Unknown flag '%s' for player class '%s'\n", argv[arg], argv[1]);
}
arg++;
}
PlayerClasses.Push (newclass);
}
}
}
CCMD (playerclasses)
{
for (unsigned int i = 0; i < PlayerClasses.Size (); i++)
{
Printf ("% 3d %s\n", i,
PlayerClasses[i].Type->Meta.GetMetaString (APMETA_DisplayName));
}
}
//
// Movement.
//
// 16 pixels of bob
#define MAXBOB 0x100000
bool onground;
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
// The player_t constructor. Since LogText is not a POD, we cannot just
// memset it all to 0.
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
player_t::player_t()
: mo(0),
playerstate(0),
cls(0),
DesiredFOV(0),
FOV(0),
viewz(0),
viewheight(0),
deltaviewheight(0),
bob(0),
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
velx(0),
vely(0),
centering(0),
turnticks(0),
attackdown(0),
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
usedown(0),
Update to ZDoom r1246: - Used the one unused byte in the state structure as a flag to tell what type the NextState parameter is. The code did some rather unsafe checks with it to determine its type. - moved all state related code into a new file: p_states.cpp. - merged all FindState functions. All the different variations are now inlined and call the same function to do the real work. - did some code cleanup and reorganization in thingdef.cpp. - Replaced the translation parser for TEXTURES with FRemapTable::AddToTranslation. - To get the game name the screenshot code might as well use the globally available GameNames array instead of creating its own list. - Moved backpack names for cheat into gameinfo. - Fixed: SNDINFO must be loaded before the textures. However, this required some changes to the MAPINFO parser which tried to access the texture manager to check if the level name patches exist. That check had to be moved to where the intermission screen is set up. - Fixed: 'bloodcolor' ignored the first parameter value when given a list of integers. Please note that this creates an incompatibility between old and new versions so if you want to create something that works with both 2.2.0 and current versions better use the string format version for the color parameter! - Rewrote the DECORATE property parser so that the parser is completely separated from the property handlers. This should allow reuse of all the handler code for a new format if Doomscript requires one. - Fixed: PClass::InitializeActorInfo copied too many bytes if a subclass's defaults were larger than the parent's. - Moved A_ChangeFlag to thingdef_codeptr.cpp. - Moved translation related code from thingdef_properties.cpp to r_translate.cpp and rewrote the translation parser to use FScanner instead of strtol. - replaced DECORATE's 'alpha default' by 'defaultalpha' for consistency. Since this was never used outside zdoom.pk3 it's not critical. - Removed support for game specific pickup messages because the only thing this was ever used for - Raven's invulnerability item - has already been split up into a Heretic and Hexen version. - Fixed: The Timidity config parser always tried to process the note number, even if it wasn't specified. - Fixed: When UpdateJoystickMenu() modifies the menu items for different controllers, the joystick axis selectors need to NULL the d.graycheck field, since this is shared by the axis sensitivity sliders' step values. - Fixed: The crosshair must be initialized after the texture manager because on the fly texture creation for graphics patches is no longer supported. - Fixed a few Linux compile errors. - Changed: Replaced weapons should not be given by generic cheats, only when explicitly giving them. - Changed 'give weapon' cheat so that in single player it only gives weapons belonging to the current game or are placed in a weapon slot to avoid giving the Chex Quest weapons in Doom and vice versa. - Fixed: The texture manager must be the first thing to be initialized because MAPINFO and DECORATE both can reference textures and letting them create their own textures is not safe. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@181 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-23 21:41:49 +00:00
oldbuttons(0),
health(0),
inventorytics(0),
CurrentPlayerClass(0),
backpack(0),
fragcount(0),
lastkilltime(0),
multicount(0),
spreecount(0),
ReadyWeapon(0),
PendingWeapon(0),
cheats(0),
refire(0),
inconsistant(0),
killcount(0),
itemcount(0),
secretcount(0),
damagecount(0),
bonuscount(0),
hazardcount(0),
poisoncount(0),
poisoner(0),
attacker(0),
extralight(0),
morphTics(0),
Update to ZDoom r894: - Eliminated all use of global variables used as output for P_CheckPosition and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because the global variables can be easily overwritten with certain DECORATE constructs. - Removed some unnecessary morphing code. - Fixed some bugs in the HIRESTEX parser. - Added floating point support and #include and #define tokens to FParseContext Not used yet. - replaced the value scanning code in FParseContext::GetToken with calls to strtol. - Changed XlatParseContext::FindToken to do a binary search over the valid token names. - Fixed: The check arrays for BlockThingsIterators were not properly freed and each iterator allocated a new one as a result. - Split the Xlat parser context class into a generic part that can be used for other Lemon-based parsers in the future and a smaller Xlat-specific part. - Changed: P_TeleportMove now always sets BlockingLine to NULL and P_FindFloorCeiling doesn't set it at all. The way it was set in PIT_FindFloorCeiling didn't look correct. (Note: It's amazing how easy it is to break P_TryMove et.al. with DECORATE if you just know which combinations of code pointers will cause problems. This definitely needs to be addressed.) - Changed P_FindFloorCeiling so that it doesn't need global variables anymore. I also moved the code to set the calling actor's information into this function because that's all it is used for. This also fixes another bug: - AInventory::BecomePickup called P_FindFloorCeiling to get proper position values for the item but never set the item's information to the return value of this call. - Removed the check for Heretic when playing *evillaugh when using the Chaos Device. This sound is not defined by the other games so it won't play by default. - Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags for the morph style so that the special behavior of these two items can be switched on and off. - Added Martin Howe's morph system enhancement. - Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere. - Rewrote BlockThingsIterator code not to use callbacks anymore. - Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but P_FindFloorCeiling never did that. - Merged Check_Sides and PIT_CrossLine into A_PainShootSkull. - Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was used. This also allowed to remove all the global variable saving in P_CreateSecNodeList. - Added a new FBlockLinesIterator class that doesn't need a callback function because debugging the previous bug proved to be a bit annoying because it involved a P_BlockLinesIterator loop. - Fixed: The MBF code to move monsters away from dropoffs did not work as intended due to some random decisions in P_DoNewChaseDir. When in the avoiding dropoff mode these are ignored now. This should cure the problem that monsters hanging over a dropoff tended to drop down. - Added a NOTIMEFREEZE flag that excludes actors from being affected by the time freezer powerup. - Changed: Empty pickup messages are no longer printed. - Changed secret sector drawing in automap so that lines with the ML_SECRET flag are only drawn as part of a secret sector if that secret has already been found, even if the option is set to always show secret sectors. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@88 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-08 22:32:52 +00:00
MorphedPlayerClass(0),
MorphStyle(0),
MorphExitFlash(0),
PremorphWeapon(0),
chickenPeck(0),
jumpTics(0),
respawn_time(0),
camera(0),
air_finished(0),
accuracy(0),
stamina(0),
savedyaw(0),
savedpitch(0),
angle(0),
dest(0),
prev(0),
enemy(0),
missile(0),
mate(0),
last_mate(0),
t_active(0),
t_respawn(0),
t_strafe(0),
t_react(0),
t_fight(0),
t_roam(0),
t_rocket(0),
isbot(0),
first_shot(0),
sleft(0),
allround(0),
oldx(0),
oldy(0),
BlendR(0),
BlendG(0),
BlendB(0),
BlendA(0),
LogText(),
crouching(0),
crouchdir(0),
crouchfactor(0),
crouchoffset(0),
- Update to ZDoom r858: - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it from doing prebuffering of the song. This was causing the Linux version to hang while waiting for input from the pipe, since Timidity hadn't been started yet. I tried using a select call in the FillStream() method, but it always seems to return the pipe as having nothing available. Unfortunately, the game still falls all over itself if Timidity isn't available. Instead of execvp failing nicely, X errors kill the game. I don't know why it's doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far) and set the snd_midipatchset cvar to point to it. It's faster and also sounds a whole lot better than the crappy freepats Ubuntu wants to install with Timidity++ (thank goodness I have the official patches from a real GUS so I don't need to use them). - GCC fixes. - Fixed: After starting new music the music volume has to be reset so that the song's relative volume takes effect. - Removed the arbitrary 1024 bytes limit when the file being played is a MIDI file. I had a D_DM2TTL that's only 990 bytes. - Restructured I_RegisterSong so that $mididevice works again and also supports selecting FMOD. - Added Jim' Linux fix. - Added MartinHowe's fix for mugshot display in status bars. - The garbage collector is now run one last time just before exiting the game. - Removed movie volume from the sound menu and renamed some of the other options to give the MIDI device name more room to display itself. - Moved the midi device selection into the main sound menu. - Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the default device. By default, it uses exactly the same DLS instruments as the Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set you want to use, set the snd_midipatchset cvar to specify where it should load the instruments from. - Changed the ProduceMIDI function to store its output into a TArray<BYTE>. An overloaded version wraps around it to continue to supply file-writing support for external Timidity++ usage. - Added an FMOD credits banner to comply with their non-commercial license. - Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather than a time in ms, this is now the length in samples of the DSP buffer. Also added the snd_buffercount cvar to offer complete control over the call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate below about 44kHz, you will need to set snd_buffersize to avoid long latencies. - Reimplemented the snd_output cvar for the FMOD Ex sound system. - Changed snd_samplerate default to 0. This now means to use the default sample rate. - Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and snd_hrtf available through the menu. - Split the HRTF effect selection into its own cvar: snd_hrtf. - Removed 96000 Hz option from the menu. It's still available through the cvar, if desired. - Fixed: If Windows sound init failed, retry with DirectSound. (Apparently, WASAPI doesn't work with more than two speakers and PCM-Float output at the same time.) - Fixed: Area sounds only played from the front speakers once you got within the 2D panning area. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
crouchviewdelta(0),
ConversationNPC(0),
ConversationPC(0),
ConversationNPCAngle(0),
ConversationFaceTalker(0)
{
memset (&cmd, 0, sizeof(cmd));
memset (&userinfo, 0, sizeof(userinfo));
memset (frags, 0, sizeof(frags));
memset (psprites, 0, sizeof(psprites));
memset (&skill, 0, sizeof(skill));
}
// This function supplements the pointer cleanup in dobject.cpp, because
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
// player_t is not derived from DObject. (I tried it, and DestroyScan was
// unable to properly determine the player object's type--possibly
// because it gets staticly allocated in an array.)
//
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
// This function checks all the DObject pointers in a player_t and NULLs any
// that match the pointer passed in. If you add any pointers that point to
// DObject (or a subclass), add them here too.
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
size_t player_t::FixPointers (const DObject *old, DObject *rep)
{
APlayerPawn *replacement = static_cast<APlayerPawn *>(rep);
size_t changed = 0;
if (mo == old) mo = replacement, changed++;
if (poisoner == old) poisoner = replacement, changed++;
if (attacker == old) attacker = replacement, changed++;
if (camera == old) camera = replacement, changed++;
if (dest == old) dest = replacement, changed++;
if (prev == old) prev = replacement, changed++;
if (enemy == old) enemy = replacement, changed++;
if (missile == old) missile = replacement, changed++;
if (mate == old) mate = replacement, changed++;
if (last_mate == old) last_mate = replacement, changed++;
if (ReadyWeapon == old) ReadyWeapon = static_cast<AWeapon *>(rep), changed++;
if (PendingWeapon == old) PendingWeapon = static_cast<AWeapon *>(rep), changed++;
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
if (PremorphWeapon == old) PremorphWeapon = static_cast<AWeapon *>(rep), changed++;
- Update to ZDoom r858: - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it from doing prebuffering of the song. This was causing the Linux version to hang while waiting for input from the pipe, since Timidity hadn't been started yet. I tried using a select call in the FillStream() method, but it always seems to return the pipe as having nothing available. Unfortunately, the game still falls all over itself if Timidity isn't available. Instead of execvp failing nicely, X errors kill the game. I don't know why it's doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far) and set the snd_midipatchset cvar to point to it. It's faster and also sounds a whole lot better than the crappy freepats Ubuntu wants to install with Timidity++ (thank goodness I have the official patches from a real GUS so I don't need to use them). - GCC fixes. - Fixed: After starting new music the music volume has to be reset so that the song's relative volume takes effect. - Removed the arbitrary 1024 bytes limit when the file being played is a MIDI file. I had a D_DM2TTL that's only 990 bytes. - Restructured I_RegisterSong so that $mididevice works again and also supports selecting FMOD. - Added Jim' Linux fix. - Added MartinHowe's fix for mugshot display in status bars. - The garbage collector is now run one last time just before exiting the game. - Removed movie volume from the sound menu and renamed some of the other options to give the MIDI device name more room to display itself. - Moved the midi device selection into the main sound menu. - Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the default device. By default, it uses exactly the same DLS instruments as the Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set you want to use, set the snd_midipatchset cvar to specify where it should load the instruments from. - Changed the ProduceMIDI function to store its output into a TArray<BYTE>. An overloaded version wraps around it to continue to supply file-writing support for external Timidity++ usage. - Added an FMOD credits banner to comply with their non-commercial license. - Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather than a time in ms, this is now the length in samples of the DSP buffer. Also added the snd_buffercount cvar to offer complete control over the call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate below about 44kHz, you will need to set snd_buffersize to avoid long latencies. - Reimplemented the snd_output cvar for the FMOD Ex sound system. - Changed snd_samplerate default to 0. This now means to use the default sample rate. - Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and snd_hrtf available through the menu. - Split the HRTF effect selection into its own cvar: snd_hrtf. - Removed 96000 Hz option from the menu. It's still available through the cvar, if desired. - Fixed: If Windows sound init failed, retry with DirectSound. (Apparently, WASAPI doesn't work with more than two speakers and PCM-Float output at the same time.) - Fixed: Area sounds only played from the front speakers once you got within the 2D panning area. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
if (ConversationNPC == old) ConversationNPC = replacement, changed++;
if (ConversationPC == old) ConversationPC = replacement, changed++;
return changed;
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
size_t player_t::PropagateMark()
{
GC::Mark(mo);
GC::Mark(poisoner);
GC::Mark(attacker);
GC::Mark(camera);
GC::Mark(dest);
GC::Mark(prev);
GC::Mark(enemy);
GC::Mark(missile);
GC::Mark(mate);
GC::Mark(last_mate);
GC::Mark(ReadyWeapon);
- Update to ZDoom r858: - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it from doing prebuffering of the song. This was causing the Linux version to hang while waiting for input from the pipe, since Timidity hadn't been started yet. I tried using a select call in the FillStream() method, but it always seems to return the pipe as having nothing available. Unfortunately, the game still falls all over itself if Timidity isn't available. Instead of execvp failing nicely, X errors kill the game. I don't know why it's doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far) and set the snd_midipatchset cvar to point to it. It's faster and also sounds a whole lot better than the crappy freepats Ubuntu wants to install with Timidity++ (thank goodness I have the official patches from a real GUS so I don't need to use them). - GCC fixes. - Fixed: After starting new music the music volume has to be reset so that the song's relative volume takes effect. - Removed the arbitrary 1024 bytes limit when the file being played is a MIDI file. I had a D_DM2TTL that's only 990 bytes. - Restructured I_RegisterSong so that $mididevice works again and also supports selecting FMOD. - Added Jim' Linux fix. - Added MartinHowe's fix for mugshot display in status bars. - The garbage collector is now run one last time just before exiting the game. - Removed movie volume from the sound menu and renamed some of the other options to give the MIDI device name more room to display itself. - Moved the midi device selection into the main sound menu. - Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the default device. By default, it uses exactly the same DLS instruments as the Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set you want to use, set the snd_midipatchset cvar to specify where it should load the instruments from. - Changed the ProduceMIDI function to store its output into a TArray<BYTE>. An overloaded version wraps around it to continue to supply file-writing support for external Timidity++ usage. - Added an FMOD credits banner to comply with their non-commercial license. - Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather than a time in ms, this is now the length in samples of the DSP buffer. Also added the snd_buffercount cvar to offer complete control over the call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate below about 44kHz, you will need to set snd_buffersize to avoid long latencies. - Reimplemented the snd_output cvar for the FMOD Ex sound system. - Changed snd_samplerate default to 0. This now means to use the default sample rate. - Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and snd_hrtf available through the menu. - Split the HRTF effect selection into its own cvar: snd_hrtf. - Removed 96000 Hz option from the menu. It's still available through the cvar, if desired. - Fixed: If Windows sound init failed, retry with DirectSound. (Apparently, WASAPI doesn't work with more than two speakers and PCM-Float output at the same time.) - Fixed: Area sounds only played from the front speakers once you got within the 2D panning area. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
GC::Mark(ConversationNPC);
GC::Mark(ConversationPC);
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
GC::Mark(PremorphWeapon);
if (PendingWeapon != WP_NOCHANGE)
{
GC::Mark(PendingWeapon);
}
return sizeof(*this);
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void player_t::SetLogNumber (int num)
{
char lumpname[16];
int lumpnum;
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 (lumpname, countof(lumpname), "LOG%d", num);
lumpnum = Wads.CheckNumForName (lumpname);
if (lumpnum == -1)
{
// Leave the log message alone if this one doesn't exist.
//SetLogText (lumpname);
}
else
{
int length=Wads.LumpLength(lumpnum);
char *data= new char[length+1];
Wads.ReadLump (lumpnum, data);
data[length]=0;
SetLogText (data);
delete[] data;
// Print log text to console
AddToConsole(-1, TEXTCOLOR_GOLD);
AddToConsole(-1, LogText);
AddToConsole(-1, "\n");
}
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void player_t::SetLogText (const char *text)
{
LogText = text;
}
int player_t::GetSpawnClass()
{
const PClass * type = PlayerClasses[CurrentPlayerClass].Type;
return static_cast<APlayerPawn*>(GetDefaultByType(type))->SpawnMask;
}
//===========================================================================
//
// APlayerPawn
//
//===========================================================================
IMPLEMENT_POINTY_CLASS (APlayerPawn)
DECLARE_POINTER(InvFirst)
DECLARE_POINTER(InvSel)
END_POINTERS
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
IMPLEMENT_CLASS (APlayerChunk)
void APlayerPawn::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << JumpZ
<< MaxHealth
<< RunHealth
<< SpawnMask
<< ForwardMove1
<< ForwardMove2
<< SideMove1
<< SideMove2
<< ScoreIcon
<< InvFirst
<< InvSel
- Fixed: player.damagescreencolor was not implemented for the GL renderer. Update to ZDoom r1190: - Gave the PlayerPawn base class a default damage fade color instead of hacking it into the actor when actually used. - Fixed: The DamageFade color was not saved in savegames. - Added Blzut3's patch for a real Chex Quest game mode. - Fixed: SKIP_SUPER doesn't work for inventory items so it must be disabled for them - Fixed: Chex Quest doesn't have a HELP2 screen so it must not be used in the gameinfo. - Fixed: Default blood color is no longer red so P_DrawSplash2 must get it from the gameinfo instead. - Added new French language texts by DoomKn1ght_. - Blood default color is set in the gameinfo now so that Chex Quest can default to green instead of red. - Fixed: The version of CheckNumForFullName that checks for a specific WAD did not work. - Moved MAPINFO names into gameinfo structure. - Added Chex Quest support. Credits go to fraggle for creating a Dehacked patch that does most of the work. The rest includes a new MAPINFO and removal of the drop items from the monsters being used. - Added Win64 support to the crash report generator. (Pity that Win32 cannot be as informative.) - Added and fixed Boss death submission for random spawner. - Added functions to FActorInfo that can set the damage factors and pain chances to reduce the chance of new errors when working with these features. - Fixed: The handling of the deprecated FIRERESIST flag didn't work. There were 3 problems: * Actor defaults have no class information so HandleDeprecatedFlags needs to be passed a pointer to the ActorInfo. * The DamageFactors list is only created when needed so the code needs to check if it already exists. * damage factors are stored as fixed_t but this set a float. - Fixed: Timidity::Renderer::reset_voices() must completely zero the voices. Because this wasn't done, note_on() could try to access the sample for a voice that had never been played yet and access random memory. There may be other places where it's a problem, but this is where I noticed it, by chance. - Added a traditional Strife color set for the automap. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@166 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-01 19:08:19 +00:00
<< MorphWeapon
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
<< DamageFade
<< PlayerFlags;
}
//===========================================================================
//
// APlayerPawn :: BeginPlay
//
//===========================================================================
void APlayerPawn::BeginPlay ()
{
Super::BeginPlay ();
ChangeStatNum (STAT_PLAYER);
// Check whether a PWADs normal sprite is to be combined with the base WADs
// crouch sprite. In such a case the sprites normally don't match and it is
// best to disable the crouch sprite.
if (crouchsprite > 0)
{
// This assumes that player sprites always exist in rotated form and
// that the front view is always a separate sprite. So far this is
// true for anything that exists.
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
FString normspritename = sprites[SpawnState->sprite].name;
FString crouchspritename = sprites[crouchsprite].name;
int spritenorm = Wads.CheckNumForName(normspritename + "A1", ns_sprites);
int spritecrouch = Wads.CheckNumForName(crouchspritename + "A1", ns_sprites);
if (spritenorm==-1 || spritecrouch ==-1)
{
// Sprites do not exist so it is best to disable the crouch sprite.
crouchsprite = 0;
return;
}
int wadnorm = Wads.GetLumpFile(spritenorm);
int wadcrouch = Wads.GetLumpFile(spritenorm);
if (wadnorm > FWadCollection::IWAD_FILENUM && wadcrouch <= FWadCollection::IWAD_FILENUM)
{
// Question: Add an option / disable crouching or do what?
crouchsprite = 0;
}
}
}
//===========================================================================
//
// APlayerPawn :: Tick
//
//===========================================================================
void APlayerPawn::Tick()
{
if (player != NULL && player->mo == this && player->morphTics == 0 && player->playerstate != PST_DEAD)
{
height = FixedMul(GetDefault()->height, player->crouchfactor);
}
else
{
if (health > 0) height = GetDefault()->height;
}
Super::Tick();
}
//===========================================================================
//
// APlayerPawn :: PostBeginPlay
//
//===========================================================================
void APlayerPawn::PostBeginPlay()
{
SetupWeaponSlots();
}
//===========================================================================
//
// APlayerPawn :: SetupWeaponSlots
//
// Sets up the default weapon slots for this player. If this is also the
// local player, determines local modifications and sends those across the
// network. Ignores voodoo dolls.
//
//===========================================================================
void APlayerPawn::SetupWeaponSlots()
{
if (player != NULL && player->mo == this)
{
player->weapons.StandardSetup(GetClass());
if (player - players == consoleplayer)
{ // If we're the local player, then there's a bit more work to do.
FWeaponSlots local_slots(player->weapons);
local_slots.LocalSetup(GetClass());
local_slots.SendDifferences(player->weapons);
}
}
}
//===========================================================================
//
// APlayerPawn :: AddInventory
//
//===========================================================================
void APlayerPawn::AddInventory (AInventory *item)
{
// Adding inventory to a voodoo doll should add it to the real player instead.
if (player != NULL && player->mo != this && player->mo != NULL)
{
player->mo->AddInventory (item);
return;
}
Super::AddInventory (item);
// If nothing is selected, select this item.
if (InvSel == NULL && (item->ItemFlags & IF_INVBAR))
{
InvSel = item;
}
}
//===========================================================================
//
// APlayerPawn :: RemoveInventory
//
//===========================================================================
void APlayerPawn::RemoveInventory (AInventory *item)
{
bool pickWeap = false;
// Since voodoo dolls aren't supposed to have an inventory, there should be
// no need to redirect them to the real player here as there is with AddInventory.
// If the item removed is the selected one, select something else, either the next
// item, if there is one, or the previous item.
if (player != NULL)
{
if (InvSel == item)
{
InvSel = item->NextInv ();
if (InvSel == NULL)
{
InvSel = item->PrevInv ();
}
}
if (InvFirst == item)
{
InvFirst = item->NextInv ();
if (InvFirst == NULL)
{
InvFirst = item->PrevInv ();
}
}
if (item == player->PendingWeapon)
{
player->PendingWeapon = WP_NOCHANGE;
}
if (item == player->ReadyWeapon)
{
// If the current weapon is removed, clear the refire counter and pick a new one.
pickWeap = true;
player->ReadyWeapon = NULL;
player->refire = 0;
}
}
Super::RemoveInventory (item);
if (pickWeap && player->mo == this && player->PendingWeapon == WP_NOCHANGE)
{
PickNewWeapon (NULL);
}
}
//===========================================================================
//
// APlayerPawn :: UseInventory
//
//===========================================================================
bool APlayerPawn::UseInventory (AInventory *item)
{
const PClass *itemtype = item->GetClass();
if (player->cheats & CF_TOTALLYFROZEN)
{ // You can't use items if you're totally frozen
return false;
}
if (( level.flags2 & LEVEL2_FROZEN ) && ( player == NULL || !( player->cheats & CF_TIMEFREEZE )))
{
// Time frozen
return false;
}
if (!Super::UseInventory (item))
{
// Heretic and Hexen advance the inventory cursor if the use failed.
// Should this behavior be retained?
return false;
}
if (player == &players[consoleplayer])
{
S_Sound (this, CHAN_ITEM, item->UseSound, 1, ATTN_NORM);
StatusBar->FlashItem (itemtype);
}
return true;
}
//===========================================================================
//
// APlayerPawn :: BestWeapon
//
// Returns the best weapon a player has, possibly restricted to a single
// type of ammo.
//
//===========================================================================
AWeapon *APlayerPawn::BestWeapon (const PClass *ammotype)
{
AWeapon *bestMatch = NULL;
int bestOrder = INT_MAX;
AInventory *item;
AWeapon *weap;
bool tomed = NULL != FindInventory (RUNTIME_CLASS(APowerWeaponLevel2));
// Find the best weapon the player has.
for (item = Inventory; item != NULL; item = item->Inventory)
{
if (!item->IsKindOf (RUNTIME_CLASS(AWeapon)))
continue;
weap = static_cast<AWeapon *> (item);
// Don't select it if it's worse than what was already found.
if (weap->SelectionOrder > bestOrder)
continue;
// Don't select it if its primary fire doesn't use the desired ammo.
if (ammotype != NULL &&
(weap->Ammo1 == NULL ||
weap->Ammo1->GetClass() != ammotype))
continue;
// Don't select it if the Tome is active and this isn't the powered-up version.
if (tomed && weap->SisterWeapon != NULL && weap->SisterWeapon->WeaponFlags & WIF_POWERED_UP)
continue;
// Don't select it if it's powered-up and the Tome is not active.
if (!tomed && weap->WeaponFlags & WIF_POWERED_UP)
continue;
// Don't select it if there isn't enough ammo to use its primary fire.
if (!(weap->WeaponFlags & WIF_AMMO_OPTIONAL) &&
!weap->CheckAmmo (AWeapon::PrimaryFire, false))
continue;
// This weapon is usable!
bestOrder = weap->SelectionOrder;
bestMatch = weap;
}
return bestMatch;
}
//===========================================================================
//
// APlayerPawn :: PickNewWeapon
//
// Picks a new weapon for this player. Used mostly for running out of ammo,
// but it also works when an ACS script explicitly takes the ready weapon
// away or the player picks up some ammo they had previously run out of.
//
//===========================================================================
AWeapon *APlayerPawn::PickNewWeapon (const PClass *ammotype)
{
AWeapon *best = BestWeapon (ammotype);
if (best != NULL)
{
player->PendingWeapon = best;
if (player->ReadyWeapon != NULL)
{
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetDownState());
}
else if (player->PendingWeapon != WP_NOCHANGE)
{
P_BringUpWeapon (player);
}
}
return best;
}
//===========================================================================
//
// APlayerPawn :: CheckWeaponSwitch
//
// Checks if weapons should be changed after picking up ammo
//
//===========================================================================
void APlayerPawn::CheckWeaponSwitch(const PClass *ammotype)
{
if (!player->userinfo.neverswitch &&
player->PendingWeapon == WP_NOCHANGE &&
(player->ReadyWeapon == NULL ||
(player->ReadyWeapon->WeaponFlags & WIF_WIMPY_WEAPON)))
{
AWeapon *best = BestWeapon (ammotype);
if (best != NULL && (player->ReadyWeapon == NULL ||
best->SelectionOrder < player->ReadyWeapon->SelectionOrder))
{
player->PendingWeapon = best;
}
}
}
//===========================================================================
//
// APlayerPawn :: GiveDeathmatchInventory
//
// Gives players items they should have in addition to their default
// inventory when playing deathmatch. (i.e. all keys)
//
//===========================================================================
void APlayerPawn::GiveDeathmatchInventory()
{
for (unsigned int i = 0; i < PClass::m_Types.Size(); ++i)
{
if (PClass::m_Types[i]->IsDescendantOf (RUNTIME_CLASS(AKey)))
{
AKey *key = (AKey *)GetDefaultByType (PClass::m_Types[i]);
if (key->KeyNumber != 0)
{
key = static_cast<AKey *>(Spawn (PClass::m_Types[i], 0,0,0, NO_REPLACE));
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
if (!key->CallTryPickup (this))
{
key->Destroy ();
}
}
}
}
}
//===========================================================================
//
// APlayerPawn :: FilterCoopRespawnInventory
//
// When respawning in coop, this function is called to walk through the dead
// player's inventory and modify it according to the current game flags so
// that it can be transferred to the new live player. This player currently
// has the default inventory, and the oldplayer has the inventory at the time
// of death.
//
//===========================================================================
void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer)
{
AInventory *item, *next, *defitem;
// If we're losing everything, this is really simple.
if (dmflags & DF_COOP_LOSE_INVENTORY)
{
oldplayer->DestroyAllInventory();
return;
}
if (dmflags & (DF_COOP_LOSE_KEYS |
DF_COOP_LOSE_WEAPONS |
DF_COOP_LOSE_AMMO |
DF_COOP_HALVE_AMMO |
DF_COOP_LOSE_ARMOR |
DF_COOP_LOSE_POWERUPS))
{
// Walk through the old player's inventory and destroy or modify
// according to dmflags.
for (item = oldplayer->Inventory; item != NULL; item = next)
{
next = item->Inventory;
// If this item is part of the default inventory, we never want
// to destroy it, although we might want to copy the default
// inventory amount.
defitem = FindInventory (item->GetClass());
if ((dmflags & DF_COOP_LOSE_KEYS) &&
defitem == NULL &&
item->IsKindOf(RUNTIME_CLASS(AKey)))
{
item->Destroy();
}
else if ((dmflags & DF_COOP_LOSE_WEAPONS) &&
defitem == NULL &&
item->IsKindOf(RUNTIME_CLASS(AWeapon)))
{
item->Destroy();
}
else if ((dmflags & DF_COOP_LOSE_ARMOR) &&
item->IsKindOf(RUNTIME_CLASS(AArmor)))
{
if (defitem != NULL)
{
item->Destroy();
}
else if (item->IsKindOf(RUNTIME_CLASS(ABasicArmor)))
{
static_cast<ABasicArmor*>(item)->SavePercent = static_cast<ABasicArmor*>(defitem)->SavePercent;
item->Amount = defitem->Amount;
}
else if (item->IsKindOf(RUNTIME_CLASS(AHexenArmor)))
{
static_cast<AHexenArmor*>(item)->Slots[0] = static_cast<AHexenArmor*>(defitem)->Slots[0];
static_cast<AHexenArmor*>(item)->Slots[1] = static_cast<AHexenArmor*>(defitem)->Slots[1];
static_cast<AHexenArmor*>(item)->Slots[2] = static_cast<AHexenArmor*>(defitem)->Slots[2];
static_cast<AHexenArmor*>(item)->Slots[3] = static_cast<AHexenArmor*>(defitem)->Slots[3];
}
}
else if ((dmflags & DF_COOP_LOSE_POWERUPS) &&
defitem == NULL &&
item->IsKindOf(RUNTIME_CLASS(APowerupGiver)))
{
item->Destroy();
}
else if ((dmflags & (DF_COOP_LOSE_AMMO | DF_COOP_HALVE_AMMO)) &&
item->IsKindOf(RUNTIME_CLASS(AAmmo)))
{
if (defitem == NULL)
{
if (dmflags & DF_COOP_LOSE_AMMO)
{
// Do NOT destroy the ammo, because a weapon might reference it.
item->Amount = 0;
}
else if (item->Amount > 1)
{
item->Amount /= 2;
}
}
else
{
// When set to lose ammo, you get to keep all your starting ammo.
// When set to halve ammo, you won't be left with less than your starting amount.
if (dmflags & DF_COOP_LOSE_AMMO)
{
item->Amount = defitem->Amount;
}
else if (item->Amount > 1)
{
item->Amount = MAX(item->Amount / 2, defitem->Amount);
}
}
}
}
}
// Now destroy the default inventory this player is holding and move
// over the old player's remaining inventory.
DestroyAllInventory();
ObtainInventory (oldplayer);
player->ReadyWeapon = NULL;
PickNewWeapon (NULL);
}
//===========================================================================
//
// APlayerPawn :: GetSoundClass
//
//===========================================================================
const char *APlayerPawn::GetSoundClass ()
{
if (player != NULL &&
(unsigned int)player->userinfo.skin >= PlayerClasses.Size () &&
(size_t)player->userinfo.skin < numskins)
{
return skins[player->userinfo.skin].name;
}
// [GRB]
const char *sclass = GetClass ()->Meta.GetMetaString (APMETA_SoundClass);
return sclass != NULL ? sclass : "player";
}
//===========================================================================
//
// APlayerPawn :: GetMaxHealth
//
// only needed because Boom screwed up Dehacked.
//
//===========================================================================
int APlayerPawn::GetMaxHealth() const
{
return MaxHealth > 0? MaxHealth : ((i_compatflags&COMPATF_DEHHEALTH)? 100 : deh.MaxHealth);
}
//===========================================================================
//
// APlayerPawn :: UpdateWaterLevel
//
// Plays surfacing and diving sounds, as appropriate.
//
//===========================================================================
bool APlayerPawn::UpdateWaterLevel (fixed_t oldz, bool splash)
{
int oldlevel = waterlevel;
bool retval = Super::UpdateWaterLevel (oldz, splash);
if (player != NULL)
{
if (oldlevel < 3 && waterlevel == 3)
{ // Our head just went under.
S_Sound (this, CHAN_VOICE, "*dive", 1, ATTN_NORM);
}
else if (oldlevel == 3 && waterlevel < 3)
{ // Our head just came up.
if (player->air_finished > level.time)
{ // We hadn't run out of air yet.
S_Sound (this, CHAN_VOICE, "*surface", 1, ATTN_NORM);
}
// If we were running out of air, then ResetAirSupply() will play *gasp.
}
}
return retval;
}
//===========================================================================
//
// APlayerPawn :: ResetAirSupply
//
// Gives the player a full "tank" of air. If they had previously completely
// run out of air, also plays the *gasp sound. Returns true if the player
// was drowning.
//
//===========================================================================
Update to ZDoom r1073: - Fixed: When Heretic's Mace was replaced by a non-child class A_SpawnMace still treated it as a mace and wrote into some undefined memory. - Fixed: A_BishopMissileWeave didn't initialize special2 for proper movement. - Added a speed parameter to A_SkullAttack. - Fixed: Black as first or only blood color didn't work. - Fixed: Sounds played in wi_stuff.cpp and f_finale.cpp need the CHAN_UI flag. - Fixed: Spawning a player could play the *gasp sound. - Fixed: SBARINFO's health display didn't scale to the proper maximum. - Added const char &operator[] (unsigned int index) to FString class. - Added Skulltag's Teleport_NoStop action special. - Fixed: Strife's EntityBoss didn't copy friendliness information to the sub-entities. - Fixed: Friendly spectral monsters should be able to hurt unfriendly ones and vice versa. - Fixed: In deathmatch specral missiles spawned by players should hurt other players. - Fixed: SpectralLightningBigBall didn't set the proper owner for the lightning projectiles it spawned. - Changed the EntityBoss's attack function to call the equivalent spectre functions instead of duplicating their code. - Gave many of Strife's code pointers that only had a number as name more meaningful names. - Fixed: All spectral attacks must set 'health' first before P_CheckMissileSpawn is called. - Added a compatibility option to play sector sounds from the precalculated center because some maps apparently abuse the behavior to make the sound play somewhere where it can't be heard by the player to fake silent movement. - Fixed: The S_Sound variant taking an actor must check if the actor is not NULL. - Fixed: ACS's ActivatorSound must check if the activator is valid. - Changed stats drawing so that multi-line strings can be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@132 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-19 23:52:06 +00:00
bool APlayerPawn::ResetAirSupply (bool playgasp)
{
bool wasdrowning = (player->air_finished < level.time);
Update to ZDoom r1073: - Fixed: When Heretic's Mace was replaced by a non-child class A_SpawnMace still treated it as a mace and wrote into some undefined memory. - Fixed: A_BishopMissileWeave didn't initialize special2 for proper movement. - Added a speed parameter to A_SkullAttack. - Fixed: Black as first or only blood color didn't work. - Fixed: Sounds played in wi_stuff.cpp and f_finale.cpp need the CHAN_UI flag. - Fixed: Spawning a player could play the *gasp sound. - Fixed: SBARINFO's health display didn't scale to the proper maximum. - Added const char &operator[] (unsigned int index) to FString class. - Added Skulltag's Teleport_NoStop action special. - Fixed: Strife's EntityBoss didn't copy friendliness information to the sub-entities. - Fixed: Friendly spectral monsters should be able to hurt unfriendly ones and vice versa. - Fixed: In deathmatch specral missiles spawned by players should hurt other players. - Fixed: SpectralLightningBigBall didn't set the proper owner for the lightning projectiles it spawned. - Changed the EntityBoss's attack function to call the equivalent spectre functions instead of duplicating their code. - Gave many of Strife's code pointers that only had a number as name more meaningful names. - Fixed: All spectral attacks must set 'health' first before P_CheckMissileSpawn is called. - Added a compatibility option to play sector sounds from the precalculated center because some maps apparently abuse the behavior to make the sound play somewhere where it can't be heard by the player to fake silent movement. - Fixed: The S_Sound variant taking an actor must check if the actor is not NULL. - Fixed: ACS's ActivatorSound must check if the activator is valid. - Changed stats drawing so that multi-line strings can be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@132 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-19 23:52:06 +00:00
if (playgasp && wasdrowning)
{
S_Sound (this, CHAN_VOICE, "*gasp", 1, ATTN_NORM);
}
- Update to ZDoom r1532: - Swapped snes_spc out for the full Game Music Emu library. - Fixed: The Hexen status bar still uses MAX_MANA for some calculations instead of MaxAmount. - Added Blzut3's submission for displaying underwater stats in SBARINFO. - Added Gez's AMMO_CHECKBOTH submission. - Added Gez's THRUSPECIES submission. - Added loading directories into the lump directory. - fixed: The Dehacked parser could not parse flag values with the highest bit set because it used atoi to convert the string into a number. - fixed: bouncing sounds were limited to inventory items. - Rewrote IWAD detection code to use the ResourceFile classes instead of reading the WAD directory directly. As a side effect it should now be possible to use Zip and 7z for IWADs, too. - Added 'EndTitle' nextmap option which goes to the regular title loop after the game has finished. - Added NOBOSSRIP flag. Note: we are now at flags6! - Added SetSkyScrollSpeed(int skyplane, fixed speed) ACS function. - Added THRUACTORS flag that disables all actor<->actor collision detection. - Added DONTSEEKINVISIBLE flag for missiles that can't home in on invisible targets. - Added SFX_TRANSFERPITCH flag to A_SpawnItemEx. - Added Ultimate Freedoom IWAD detection. - Added GetAirSupply and SetAirSupply functions to ACS. - Fixed: The *surface sound was not played when drowning was switched off by setting the level's air supply to 0. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@338 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-04 13:59:08 +00:00
if (level.airsupply> 0) player->air_finished = level.time + level.airsupply;
else player->air_finished = INT_MAX;
return wasdrowning;
}
//===========================================================================
//
// Animations
//
//===========================================================================
void APlayerPawn::PlayIdle ()
{
if (InStateSequence(state, SeeState))
SetState (SpawnState);
}
void APlayerPawn::PlayRunning ()
{
if (InStateSequence(state, SpawnState) && SeeState != NULL)
SetState (SeeState);
}
void APlayerPawn::PlayAttacking ()
{
if (MissileState != NULL) SetState (MissileState);
}
void APlayerPawn::PlayAttacking2 ()
{
if (MeleeState != NULL) SetState (MeleeState);
}
void APlayerPawn::ThrowPoisonBag ()
{
}
//===========================================================================
//
// APlayerPawn :: GiveDefaultInventory
//
//===========================================================================
void APlayerPawn::GiveDefaultInventory ()
{
Update to ZDoom r1418: - Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-08 23:01:13 +00:00
if (player == NULL) return;
// [GRB] Give inventory specified in DECORATE
player->health = GetDefault ()->health;
// HexenArmor must always be the first item in the inventory because
// it provides player class based protection that should not affect
// any other protection item.
fixed_t hx[5];
for(int i=0;i<5;i++)
{
hx[i] = GetClass()->Meta.GetMetaFixed(APMETA_Hexenarmor0+i);
}
GiveInventoryType (RUNTIME_CLASS(AHexenArmor));
AHexenArmor *harmor = FindInventory<AHexenArmor>();
harmor->Slots[4] = hx[0];
harmor->SlotsIncrement[0] = hx[1];
harmor->SlotsIncrement[1] = hx[2];
harmor->SlotsIncrement[2] = hx[3];
harmor->SlotsIncrement[3] = hx[4];
// BasicArmor must come right after that. It should not affect any
// other protection item as well but needs to process the damage
// before the HexenArmor does.
ABasicArmor *barmor = Spawn<ABasicArmor> (0,0,0, NO_REPLACE);
barmor->BecomeItem ();
barmor->SavePercent = 0;
barmor->Amount = 0;
AddInventory (barmor);
// Now add the items from the DECORATE definition
Update to ZDoom r1246: - Used the one unused byte in the state structure as a flag to tell what type the NextState parameter is. The code did some rather unsafe checks with it to determine its type. - moved all state related code into a new file: p_states.cpp. - merged all FindState functions. All the different variations are now inlined and call the same function to do the real work. - did some code cleanup and reorganization in thingdef.cpp. - Replaced the translation parser for TEXTURES with FRemapTable::AddToTranslation. - To get the game name the screenshot code might as well use the globally available GameNames array instead of creating its own list. - Moved backpack names for cheat into gameinfo. - Fixed: SNDINFO must be loaded before the textures. However, this required some changes to the MAPINFO parser which tried to access the texture manager to check if the level name patches exist. That check had to be moved to where the intermission screen is set up. - Fixed: 'bloodcolor' ignored the first parameter value when given a list of integers. Please note that this creates an incompatibility between old and new versions so if you want to create something that works with both 2.2.0 and current versions better use the string format version for the color parameter! - Rewrote the DECORATE property parser so that the parser is completely separated from the property handlers. This should allow reuse of all the handler code for a new format if Doomscript requires one. - Fixed: PClass::InitializeActorInfo copied too many bytes if a subclass's defaults were larger than the parent's. - Moved A_ChangeFlag to thingdef_codeptr.cpp. - Moved translation related code from thingdef_properties.cpp to r_translate.cpp and rewrote the translation parser to use FScanner instead of strtol. - replaced DECORATE's 'alpha default' by 'defaultalpha' for consistency. Since this was never used outside zdoom.pk3 it's not critical. - Removed support for game specific pickup messages because the only thing this was ever used for - Raven's invulnerability item - has already been split up into a Heretic and Hexen version. - Fixed: The Timidity config parser always tried to process the note number, even if it wasn't specified. - Fixed: When UpdateJoystickMenu() modifies the menu items for different controllers, the joystick axis selectors need to NULL the d.graycheck field, since this is shared by the axis sensitivity sliders' step values. - Fixed: The crosshair must be initialized after the texture manager because on the fly texture creation for graphics patches is no longer supported. - Fixed a few Linux compile errors. - Changed: Replaced weapons should not be given by generic cheats, only when explicitly giving them. - Changed 'give weapon' cheat so that in single player it only gives weapons belonging to the current game or are placed in a weapon slot to avoid giving the Chex Quest weapons in Doom and vice versa. - Fixed: The texture manager must be the first thing to be initialized because MAPINFO and DECORATE both can reference textures and letting them create their own textures is not safe. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@181 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-23 21:41:49 +00:00
FDropItem *di = GetDropItems();
while (di)
{
const PClass *ti = PClass::FindClass (di->Name);
if (ti)
{
AInventory *item = FindInventory (ti);
if (item != NULL)
{
item->Amount = clamp<int>(
item->Amount + (di->amount ? di->amount : ((AInventory *)item->GetDefault ())->Amount),
0, item->MaxAmount);
}
else
{
item = static_cast<AInventory *>(Spawn (ti, 0,0,0, NO_REPLACE));
item->ItemFlags|=IF_IGNORESKILL; // no skill multiplicators here
item->Amount = di->amount;
if (item->IsKindOf (RUNTIME_CLASS (AWeapon)))
{
// To allow better control any weapon is emptied of
// ammo before being given to the player.
static_cast<AWeapon*>(item)->AmmoGive1 =
static_cast<AWeapon*>(item)->AmmoGive2 = 0;
}
Update to ZDoom r1418: - Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-08 23:01:13 +00:00
AActor *check;
if (!item->CallTryPickup(this, &check))
{
Update to ZDoom r1418: - Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-08 23:01:13 +00:00
if (check != this)
{
// Player was morphed. This is illegal at game start.
// This problem is only detectable when it's too late to do something about it...
I_Error("Cannot give morph items when starting a game");
}
item->Destroy ();
item = NULL;
}
}
Update to ZDoom r1418: - Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-08 23:01:13 +00:00
if (item != NULL && item->IsKindOf (RUNTIME_CLASS (AWeapon)) &&
static_cast<AWeapon*>(item)->CheckAmmo(AWeapon::EitherFire, false))
{
player->ReadyWeapon = player->PendingWeapon = static_cast<AWeapon *> (item);
}
}
di = di->Next;
}
}
void APlayerPawn::MorphPlayerThink ()
{
}
void APlayerPawn::ActivateMorphWeapon ()
{
const PClass *morphweapon = PClass::FindClass (MorphWeapon);
player->PendingWeapon = WP_NOCHANGE;
player->psprites[ps_weapon].sy = WEAPONTOP;
if (morphweapon == NULL || !morphweapon->IsDescendantOf (RUNTIME_CLASS(AWeapon)))
{ // No weapon at all while morphed!
player->ReadyWeapon = NULL;
P_SetPsprite (player, ps_weapon, NULL);
}
else
{
player->ReadyWeapon = static_cast<AWeapon *>(player->mo->FindInventory (morphweapon));
if (player->ReadyWeapon == NULL)
{
player->ReadyWeapon = static_cast<AWeapon *>(player->mo->GiveInventoryType (morphweapon));
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
if (player->ReadyWeapon != NULL)
{
player->ReadyWeapon->GivenAsMorphWeapon = true; // flag is used only by new beastweap semantics in P_UndoPlayerMorph
}
}
if (player->ReadyWeapon != NULL)
{
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetReadyState());
}
else
{
P_SetPsprite (player, ps_weapon, NULL);
}
}
P_SetPsprite (player, ps_flash, NULL);
Update to ZDoom r905: - Added Martin Howe's morph system update. - Added support for defining composite textures in HIRESTEX. It is not fully tested and right now can't do much more than the old TEXTUREx method. - Added a few NULL pointer checks to the texture code. - Made duplicate class names in DECORATE non-fatal. There is really no stability concern here and the worst that can happen is that the wrong actor is spawned. This was a constant hassle when testing with WADs that contain duplicate resources. - Removed some GCC warnings. - Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp. - Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW failed compiling the new MIDI code. - Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char pointers, since "" is a constant. - Fixed: parsecontext.h was missing a newline at the end of the file. - Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In particular, this meant that every channel was almost certainly in mono mode, which can sound pretty bad if the song isn't meant to be played that way. - Added bank numbers to the MIDI precaching for Timidity, since I guess I do need to care about banks, if even the Duke MIDIs use various banks. - Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp shouldn't unconditionally link against it. - Fixed: pre_resample() was still disabled, and it left two samples at the end of the new wave data uninitialized. - Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get rid of timidity/tables.cpp, which conflicts in name with the main Doom tables.cpp. (And interestingly, VC++ automatically renamed the object file, so I wasn't aware of the problem with GCC.) - Added a Gets function to the FileReader class which I planned to use to enable Timidity to read its config and sound patches from Zips. I put this on hold though after finding out that the sound quality isn't even near that of Timidity++. - GCC-Fixes (FString::GetChars() for Printf calls) - Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag can be loaded - Changed the MIDIStreamer to send the all notes off controller to each channel when restarting the song, rather than emitting a single note off event which only has 1 in 127 chance of being for a note that's playing on that channel. Then I decided it would probably be a good idea to reset all the controllers as well. - Increasing the size of the internal Timidity stream buffer from 1/14 sec (copied from the OPL player) improved its sound dramatically, so apparently Timidity has issues with short stream buffers. It's now at 1/2 sec in length. However, there seems to be something weird going on with corazonazul_ff6boss.mid near the beginning where it stops and immediately restarts a guitar on the exact same note. - Added a new sound debugging cvar: snd_drawoutput, which can show various oscilloscopes and spectrums. - Eliminated some more global variables (onmobj, DoRipping, LastRipped, MissileActor, bulletpitch and linetarget.) - Internal TiMidity now plays music. Unfortunately, it doesn't sound right. :( - Changed the progdir global variable into an FString. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@90 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-12 18:59:23 +00:00
player->PendingWeapon = WP_NOCHANGE;
}
//===========================================================================
//
// APlayerPawn :: Die
//
//===========================================================================
void APlayerPawn::Die (AActor *source, AActor *inflictor)
{
Super::Die (source, inflictor);
if (player != NULL && player->mo == this) player->bonuscount = 0;
if (player != NULL && player->mo != this)
{ // Make the real player die, too
player->mo->Die (source, inflictor);
}
else
{
if (player != NULL && (dmflags2 & DF2_YES_WEAPONDROP))
{ // Voodoo dolls don't drop weapons
AWeapon *weap = player->ReadyWeapon;
if (weap != NULL)
{
AInventory *item;
if (weap->SpawnState != NULL &&
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
weap->SpawnState != ::GetDefault<AActor>()->SpawnState)
{
item = P_DropItem (this, weap->GetClass(), -1, 256);
if (item != NULL)
{
if (weap->AmmoGive1 && weap->Ammo1)
{
static_cast<AWeapon *>(item)->AmmoGive1 = weap->Ammo1->Amount;
}
if (weap->AmmoGive2 && weap->Ammo2)
{
static_cast<AWeapon *>(item)->AmmoGive2 = weap->Ammo2->Amount;
}
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'. Update to ZDoom r940: SBarInfo Update #18: - Simplified the DrawGraphic function in sbarinfo_display.cpp - Added xOffset, yOffset, and alpha to every drawing function in sbarinfo_display.cpp. So Strife popups can be handeled better and allow for other effects (translucent bars?). I'm thinking about making a struct for these five (also x and y) arguments so that the argument lists don't become a mess. - Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to DrawGraphic. - DrawKeyBar wasn't using screen->DrawTexture. - Added a Fade transition for popups. It takes two args fade in rate and fade out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete and so on). - Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible. - Fixed: When an instrument's envelope runs out, it does not immediately ramp to zero. Rather, it lets the remainder of the sample finish playing. - Fixed: When playing a MIDI file with EMIDI track designations to turn a track off, any ticks that had only events on the disabled track would cause the delay for that track to be thrown away, and the following notes on enabled tracks would play too soon. This could be heard quite clearly in xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing of tracks 13 and 14 (EP1 Melody and EP1 Echo). - Fixed: DFlashFader did some operations in its destructor that had to be moved to its Destroy method. - Fixed: Dropped weapons from dying players should not double ammo. - Fixed: When note_on() is called and another copy of the same note is already playing on the channel, it should stop it with finish_note(), not kill_note(). This can be clearly heard in the final cymbal crashes of D_DM2TTL where TiMidity cuts them off because the final cymbals are played with a velocity of 1 before the preceding cymbals have finished. (I wonder if I should be setting the self_nonexclusive flag for GUS patches to disable even this behavior, though, since gf1note.c doesn't turn off duplicate notes.) - Changed envelope handling to hopefully match the GUS player's. The most egregious mistake TiMidity makes is to treat bit 6 as an envelope enable bit. This is not what it does; every sample has an envelope. Rather, this is a "no sampled release" flag. Also, despite fiddling with the PATCH_SUSTAIN flag during instrument loading, TiMidity never actually used it. Nor did it do anything at all with the PATCH_FAST_REL flag. - Fixed: wbstartstruct's lump name fields were only 8 characters long and not properly zero-terminated when all 8 characters were used. - Fixed: Local sound sequence definitions caused a crash because a proper NULL check was missing. - Added translucent blending modes to FMultipatchTexture (not tested yet!) - Also changed all true color texture creation functions to use proper alpha values instead of inverted ones. - Changed FRemapTable so that all palette entries must contain proper alpha values. - Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check. - Changed: The boss brain's explosions play weapons/rocklx which is an unlimited sound. This can become extremely loud. Replaced with a new sound which is just an alias to weapons/rocklx but has a limit of 4. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
item->ItemFlags |= IF_IGNORESKILL;
}
}
else
{
item = P_DropItem (this, weap->AmmoType1, -1, 256);
if (item != NULL)
{
item->Amount = weap->Ammo1->Amount;
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'. Update to ZDoom r940: SBarInfo Update #18: - Simplified the DrawGraphic function in sbarinfo_display.cpp - Added xOffset, yOffset, and alpha to every drawing function in sbarinfo_display.cpp. So Strife popups can be handeled better and allow for other effects (translucent bars?). I'm thinking about making a struct for these five (also x and y) arguments so that the argument lists don't become a mess. - Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to DrawGraphic. - DrawKeyBar wasn't using screen->DrawTexture. - Added a Fade transition for popups. It takes two args fade in rate and fade out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete and so on). - Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible. - Fixed: When an instrument's envelope runs out, it does not immediately ramp to zero. Rather, it lets the remainder of the sample finish playing. - Fixed: When playing a MIDI file with EMIDI track designations to turn a track off, any ticks that had only events on the disabled track would cause the delay for that track to be thrown away, and the following notes on enabled tracks would play too soon. This could be heard quite clearly in xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing of tracks 13 and 14 (EP1 Melody and EP1 Echo). - Fixed: DFlashFader did some operations in its destructor that had to be moved to its Destroy method. - Fixed: Dropped weapons from dying players should not double ammo. - Fixed: When note_on() is called and another copy of the same note is already playing on the channel, it should stop it with finish_note(), not kill_note(). This can be clearly heard in the final cymbal crashes of D_DM2TTL where TiMidity cuts them off because the final cymbals are played with a velocity of 1 before the preceding cymbals have finished. (I wonder if I should be setting the self_nonexclusive flag for GUS patches to disable even this behavior, though, since gf1note.c doesn't turn off duplicate notes.) - Changed envelope handling to hopefully match the GUS player's. The most egregious mistake TiMidity makes is to treat bit 6 as an envelope enable bit. This is not what it does; every sample has an envelope. Rather, this is a "no sampled release" flag. Also, despite fiddling with the PATCH_SUSTAIN flag during instrument loading, TiMidity never actually used it. Nor did it do anything at all with the PATCH_FAST_REL flag. - Fixed: wbstartstruct's lump name fields were only 8 characters long and not properly zero-terminated when all 8 characters were used. - Fixed: Local sound sequence definitions caused a crash because a proper NULL check was missing. - Added translucent blending modes to FMultipatchTexture (not tested yet!) - Also changed all true color texture creation functions to use proper alpha values instead of inverted ones. - Changed FRemapTable so that all palette entries must contain proper alpha values. - Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check. - Changed: The boss brain's explosions play weapons/rocklx which is an unlimited sound. This can become extremely loud. Replaced with a new sound which is just an alias to weapons/rocklx but has a limit of 4. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
item->ItemFlags |= IF_IGNORESKILL;
}
item = P_DropItem (this, weap->AmmoType2, -1, 256);
if (item != NULL)
{
item->Amount = weap->Ammo2->Amount;
- Fixed: Fog for flooding floor textures into gaps created by missing wall textures didn't work since a parameter changes necessitated by ZDoom's render style 'enhancement'. Update to ZDoom r940: SBarInfo Update #18: - Simplified the DrawGraphic function in sbarinfo_display.cpp - Added xOffset, yOffset, and alpha to every drawing function in sbarinfo_display.cpp. So Strife popups can be handeled better and allow for other effects (translucent bars?). I'm thinking about making a struct for these five (also x and y) arguments so that the argument lists don't become a mess. - Changed DRAWIMAGE in sbarinfo_display.cpp to not use so many calls to DrawGraphic. - DrawKeyBar wasn't using screen->DrawTexture. - Added a Fade transition for popups. It takes two args fade in rate and fade out rate. Both are floats (1.0 = 1 tic to complete 0.5 = 2 tics to complete and so on). - Added a translucency arg to statusbars. 1.0 = opaque and 0.0 = invisible. - Fixed: When an instrument's envelope runs out, it does not immediately ramp to zero. Rather, it lets the remainder of the sample finish playing. - Fixed: When playing a MIDI file with EMIDI track designations to turn a track off, any ticks that had only events on the disabled track would cause the delay for that track to be thrown away, and the following notes on enabled tracks would play too soon. This could be heard quite clearly in xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing of tracks 13 and 14 (EP1 Melody and EP1 Echo). - Fixed: DFlashFader did some operations in its destructor that had to be moved to its Destroy method. - Fixed: Dropped weapons from dying players should not double ammo. - Fixed: When note_on() is called and another copy of the same note is already playing on the channel, it should stop it with finish_note(), not kill_note(). This can be clearly heard in the final cymbal crashes of D_DM2TTL where TiMidity cuts them off because the final cymbals are played with a velocity of 1 before the preceding cymbals have finished. (I wonder if I should be setting the self_nonexclusive flag for GUS patches to disable even this behavior, though, since gf1note.c doesn't turn off duplicate notes.) - Changed envelope handling to hopefully match the GUS player's. The most egregious mistake TiMidity makes is to treat bit 6 as an envelope enable bit. This is not what it does; every sample has an envelope. Rather, this is a "no sampled release" flag. Also, despite fiddling with the PATCH_SUSTAIN flag during instrument loading, TiMidity never actually used it. Nor did it do anything at all with the PATCH_FAST_REL flag. - Fixed: wbstartstruct's lump name fields were only 8 characters long and not properly zero-terminated when all 8 characters were used. - Fixed: Local sound sequence definitions caused a crash because a proper NULL check was missing. - Added translucent blending modes to FMultipatchTexture (not tested yet!) - Also changed all true color texture creation functions to use proper alpha values instead of inverted ones. - Changed FRemapTable so that all palette entries must contain proper alpha values. - Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check. - Changed: The boss brain's explosions play weapons/rocklx which is an unlimited sound. This can become extremely loud. Replaced with a new sound which is just an alias to weapons/rocklx but has a limit of 4. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@98 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-25 10:00:54 +00:00
item->ItemFlags |= IF_IGNORESKILL;
}
}
}
}
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
if (!multiplayer && (level.flags2 & LEVEL2_DEATHSLIDESHOW))
{
F_StartSlideshow ();
}
}
}
//===========================================================================
//
// APlayerPawn :: TweakSpeeds
//
//===========================================================================
void APlayerPawn::TweakSpeeds (int &forward, int &side)
{
// Strife's player can't run when its healh is below 10
if (health <= RunHealth)
{
forward = clamp(forward, -0x1900, 0x1900);
side = clamp(side, -0x1800, 0x1800);
}
// [GRB]
if ((unsigned int)(forward + 0x31ff) < 0x63ff)
{
forward = FixedMul (forward, ForwardMove1);
}
else
{
forward = FixedMul (forward, ForwardMove2);
}
if ((unsigned int)(side + 0x27ff) < 0x4fff)
{
side = FixedMul (side, SideMove1);
}
else
{
side = FixedMul (side, SideMove2);
}
if (!player->morphTics && Inventory != NULL)
{
fixed_t factor = Inventory->GetSpeedFactor ();
forward = FixedMul(forward, factor);
side = FixedMul(side, factor);
}
}
//===========================================================================
//
// A_PlayerScream
//
// try to find the appropriate death sound and use suitable
// replacements if necessary
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
{
int sound = 0;
int chan = CHAN_VOICE;
if (self->player == NULL || self->DeathSound != 0)
{
Update to ZDoom r1425: - Added MF5_CANTSEEK flag to prevent seeker missiles from homing in on certain actors and added an option to APowerInvisibility to set this flag when active. - Added map specific automap backgrounds. - Fixed: Voodoo dolls did not play a sound when dying. - Added colorized error messages to DECORATE and made a few more error conditions that do not block further parsing not immediately abort. - Made all errors in CreateNewActor not immediately fatal so that the rest of the DECORATE lump can be parsed normally to look for more errors. - Fixed: Defining classes with the same name as their immediate base class was legal. It should not be allowed that a class has another one with the same name in its ancestry. - Fixed: Formatting of the intermission screen on Heretic, Hexen and Strife was broken. Changed it to use WI_Drawpercent which does it properly and also allows showing percentage in these games now. - Fixed: The MAPINFO parser ignored missing terminating braces of the last block in the file. - Moved the V_InitFontColors() call earlier in the startup sequence so that colored error messages appear colored in the startup window. Also lightened up the "Flat" red to contrast better on the startup background. - Changed I_InitInput() to acquire the IDirectInput8A interface by using DirectInput8Create() instead of CoCreateInstance(). This allows the Steam GameOverlayRenderer.dll to properly hook it. - Stopped sending double the number of wheel events as appropriate to the console under Linux. - Added middle mouse button selection pasting for X systems. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@301 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-20 09:24:51 +00:00
if (self->DeathSound != 0)
{
S_Sound (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NORM);
}
else
{
S_Sound (self, CHAN_VOICE, "*death", 1, ATTN_NORM);
}
return;
}
// Handle the different player death screams
if ((((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
self->velz <= -39*FRACUNIT)
{
sound = S_FindSkinnedSound (self, "*splat");
chan = CHAN_BODY;
}
if (!sound && self->special1<10)
{ // Wimpy death sound
sound = S_FindSkinnedSoundEx (self, "*wimpydeath", self->player->LastDamageType);
}
if (!sound && self->health <= -50)
{
if (self->health > -100)
{ // Crazy death sound
sound = S_FindSkinnedSoundEx (self, "*crazydeath", self->player->LastDamageType);
}
if (!sound)
{ // Extreme death sound
sound = S_FindSkinnedSoundEx (self, "*xdeath", self->player->LastDamageType);
if (!sound)
{
sound = S_FindSkinnedSoundEx (self, "*gibbed", self->player->LastDamageType);
chan = CHAN_BODY;
}
}
}
if (!sound)
{ // Normal death sound
sound = S_FindSkinnedSoundEx (self, "*death", self->player->LastDamageType);
}
if (chan != CHAN_VOICE)
{
for (int i = 0; i < 8; ++i)
{ // Stop most playing sounds from this player.
// This is mainly to stop *land from messing up *splat.
if (i != CHAN_WEAPON && i != CHAN_VOICE)
{
S_StopSound (self, i);
}
}
}
S_Sound (self, chan, sound, 1, ATTN_NORM);
}
//----------------------------------------------------------------------------
//
// PROC A_SkullPop
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
APlayerPawn *mo;
player_t *player;
// [GRB] Parameterized version
if (!spawntype || !spawntype->IsDescendantOf (RUNTIME_CLASS (APlayerChunk)))
{
spawntype = PClass::FindClass("BloodySkull");
if (spawntype == NULL) return;
}
self->flags &= ~MF_SOLID;
mo = (APlayerPawn *)Spawn (spawntype, self->x, self->y, self->z + 48*FRACUNIT, NO_REPLACE);
//mo->target = self;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
mo->velx = pr_skullpop.Random2() << 9;
mo->vely = pr_skullpop.Random2() << 9;
mo->velz = 2*FRACUNIT + (pr_skullpop() << 6);
// Attach player mobj to bloody skull
player = self->player;
self->player = NULL;
mo->ObtainInventory (self);
mo->player = player;
mo->health = self->health;
mo->angle = self->angle;
if (player != NULL)
{
player->mo = mo;
if (player->camera == self)
{
player->camera = mo;
}
player->damagecount = 32;
}
}
//----------------------------------------------------------------------------
//
// PROC A_CheckSkullDone
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_CheckPlayerDone)
{
if (self->player == NULL)
{
self->Destroy ();
}
}
//===========================================================================
//
// P_CheckPlayerSprites
//
// Here's the place where crouching sprites are handled
// This must be called each frame before rendering
//
//===========================================================================
void P_CheckPlayerSprites()
{
for(int i=0; i<MAXPLAYERS; i++)
{
player_t * player = &players[i];
APlayerPawn * mo = player->mo;
if (playeringame[i] && mo != NULL)
{
int crouchspriteno;
fixed_t defscaleY = mo->GetDefault()->scaleY;
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
fixed_t defscaleX = mo->GetDefault()->scaleX;
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
if (player->userinfo.skin != 0 && !(player->mo->flags4 & MF4_NOSKIN))
{
- Fixed: Warped textures didn't work anymore because the default speed was 0. - Fixed: When a suspended FraggleScript script was restarted all its variables were destroyed. Update to ZDoom r952: - Fixed: FString::StripRight() stripped the final character of the string if there were no designated characters to strip at the end of it. - Added support for Shoutcast/Icecast playlists. - Added an error message when a playlist could not be opened. - Added support for PLS format playlists, in addition to M3U. - Changed FPlayList to use an array of FStrings. - Fixed: Playlists required every song to be specified by an absolute path. - Fixed a copy-and-paste error in win32/i_main.cpp for 64-bit mode. - Tweaked OPL centering a little. - Added dynamic recentering for the OPL synth. The chip has four basic waveforms, and three of them are non-negative. This can cause a tendency for the resulting output waveform to go into very high ranges depending on the timbres used, and Heretic's exemplify this problem. - Reduced the OPL volume level slightly. - Fixed: The waveform view from snd_drawoutput was upside-down. - Various fixes for compiling working 64-bit binaries with Visual C++. The number of changes was pleasantly small, and a cursory check seems to show everything working alright. - Separated the skin scale values into separate X and Y values so that skins automatically generated for different player classes can use both the scaling values that can be set for the actor. - Fixed: Any MIDI ticks that contain only events that are interpreted by the MIDI parser and not passed on to the MIDI device would mess up timing for future events. - Changed EMIDI controller 110-113 handling to more accurately match the EMIDI specs: Track designations and exclusions should be ignored past the initial beat, and EMIDI program change and volume events should be ignored unless they were used in the initial beat. - Fixed: When FMOD::System::init() returns FMOD_ERR_OUTPUT_CREATEBUFFER, it could also be because the user selected PCM-Float output, but the driver doesn't support it (even if it claims to *cough*Audigy XP drivers*cough*). git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@101 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-01 21:45:22 +00:00
defscaleY = skins[player->userinfo.skin].ScaleY;
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
defscaleX = skins[player->userinfo.skin].ScaleX;
}
// Set the crouch sprite
if (player->crouchfactor < FRACUNIT*3/4)
{
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 (mo->sprite == mo->SpawnState->sprite || mo->sprite == mo->crouchsprite)
{
crouchspriteno = mo->crouchsprite;
}
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
else if (!(player->mo->flags4 & MF4_NOSKIN) &&
(mo->sprite == skins[player->userinfo.skin].sprite ||
mo->sprite == skins[player->userinfo.skin].crouchsprite))
{
crouchspriteno = skins[player->userinfo.skin].crouchsprite;
}
else
{
// no sprite -> squash the existing one
crouchspriteno = -1;
}
if (crouchspriteno > 0)
{
mo->sprite = crouchspriteno;
mo->scaleY = defscaleY;
}
else if (player->playerstate != PST_DEAD)
{
mo->scaleY = player->crouchfactor < FRACUNIT*3/4 ? defscaleY/2 : defscaleY;
}
}
else // Set the normal sprite
{
if (mo->sprite == mo->crouchsprite)
{
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
mo->sprite = mo->SpawnState->sprite;
}
else if (mo->sprite == skins[player->userinfo.skin].crouchsprite)
{
mo->sprite = skins[player->userinfo.skin].sprite;
}
mo->scaleY = defscaleY;
}
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
mo->scaleX = defscaleX;
}
}
}
/*
==================
=
= P_Thrust
=
= moves the given origin along a given angle
=
==================
*/
void P_SideThrust (player_t *player, angle_t angle, fixed_t move)
{
angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velx += FixedMul (move, finecosine[angle]);
player->mo->vely += FixedMul (move, finesine[angle]);
}
void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move)
{
angle >>= ANGLETOFINESHIFT;
if ((player->mo->waterlevel || (player->mo->flags & MF_NOGRAVITY))
&& player->mo->pitch != 0)
{
angle_t pitch = (angle_t)player->mo->pitch >> ANGLETOFINESHIFT;
fixed_t zpush = FixedMul (move, finesine[pitch]);
if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0)
zpush = 0;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velz -= zpush;
move = FixedMul (move, finecosine[pitch]);
}
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velx += FixedMul (move, finecosine[angle]);
player->mo->vely += FixedMul (move, finesine[angle]);
}
//
// P_Bob
// Same as P_Thrust, but only affects bobbing.
//
// killough 10/98: We apply thrust separately between the real physical player
// and the part which affects bobbing. This way, bobbing only comes from player
// motion, nothing external, avoiding many problems, e.g. bobbing should not
// occur on conveyors, unless the player walks on one, and bobbing should be
// reduced at a regular rate, even on ice (where the player coasts).
//
void P_Bob (player_t *player, angle_t angle, fixed_t move)
{
angle >>= ANGLETOFINESHIFT;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->velx += FixedMul(move, finecosine[angle]);
player->vely += FixedMul(move, finesine[angle]);
}
/*
==================
=
= P_CalcHeight
=
=
Calculate the walking / running height adjustment
=
==================
*/
void P_CalcHeight (player_t *player)
{
int angle;
fixed_t bob;
bool still = false;
// Regular movement bobbing
// (needs to be calculated for gun swing even if not on ground)
// killough 10/98: Make bobbing depend only on player-applied motion.
//
// Note: don't reduce bobbing here if on ice: if you reduce bobbing here,
// it causes bobbing jerkiness when the player moves from ice to non-ice,
// and vice-versa.
if ((player->mo->flags & MF_NOGRAVITY) && !onground)
{
player->bob = FRACUNIT / 2;
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->bob = DMulScale16 (player->velx, player->velx, player->vely, player->vely);
if (player->bob == 0)
{
still = true;
}
else
{
player->bob = FixedMul (player->bob, player->userinfo.MoveBob);
if (player->bob > MAXBOB)
player->bob = MAXBOB;
}
}
fixed_t defaultviewheight = player->mo->ViewHeight + player->crouchviewdelta;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (player->cheats & CF_NOVELOCITY)
{
player->viewz = player->mo->z + defaultviewheight;
if (player->viewz > player->mo->ceilingz-4*FRACUNIT)
player->viewz = player->mo->ceilingz-4*FRACUNIT;
return;
}
if (still)
{
if (player->health > 0)
{
angle = DivScale13 (level.time, 120*TICRATE/35) & FINEMASK;
bob = FixedMul (player->userinfo.StillBob, finesine[angle]);
}
else
{
bob = 0;
}
}
else
{
// DivScale 13 because FINEANGLES == (1<<13)
angle = DivScale13 (level.time, 20*TICRATE/35) & FINEMASK;
bob = FixedMul (player->bob>>(player->mo->waterlevel > 1 ? 2 : 1), finesine[angle]);
}
// move viewheight
if (player->playerstate == PST_LIVE)
{
player->viewheight += player->deltaviewheight;
if (player->viewheight > defaultviewheight)
{
player->viewheight = defaultviewheight;
player->deltaviewheight = 0;
}
else if (player->viewheight < (defaultviewheight>>1))
{
player->viewheight = defaultviewheight>>1;
if (player->deltaviewheight <= 0)
player->deltaviewheight = 1;
}
if (player->deltaviewheight)
{
player->deltaviewheight += FRACUNIT/4;
if (!player->deltaviewheight)
player->deltaviewheight = 1;
}
}
if (player->morphTics)
{
bob = 0;
}
player->viewz = player->mo->z + player->viewheight + bob;
if (player->mo->floorclip && player->playerstate != PST_DEAD
&& player->mo->z <= player->mo->floorz)
{
player->viewz -= player->mo->floorclip;
}
if (player->viewz > player->mo->ceilingz - 4*FRACUNIT)
{
player->viewz = player->mo->ceilingz - 4*FRACUNIT;
}
if (player->viewz < player->mo->floorz + 4*FRACUNIT)
{
player->viewz = player->mo->floorz + 4*FRACUNIT;
}
}
/*
=================
=
= P_MovePlayer
=
=================
*/
CUSTOM_CVAR (Float, sv_aircontrol, 0.00390625f, CVAR_SERVERINFO|CVAR_NOSAVE)
{
level.aircontrol = (fixed_t)(self * 65536.f);
G_AirControlChanged ();
}
void P_MovePlayer (player_t *player)
{
ticcmd_t *cmd = &player->cmd;
APlayerPawn *mo = player->mo;
// [RH] 180-degree turn overrides all other yaws
if (player->turnticks)
{
player->turnticks--;
mo->angle += (ANGLE_180 / TURN180_TICKS);
}
else
{
mo->angle += cmd->ucmd.yaw << 16;
}
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
onground = (mo->z <= mo->floorz) || (mo->flags2 & MF2_ONMOBJ) || (mo->BounceFlags & BOUNCE_MBF);
// killough 10/98:
//
// We must apply thrust to the player and bobbing separately, to avoid
// anomalies. The thrust applied to bobbing is always the same strength on
// ice, because the player still "works just as hard" to move, while the
// thrust applied to the movement varies with 'movefactor'.
if (cmd->ucmd.forwardmove | cmd->ucmd.sidemove)
{
fixed_t forwardmove, sidemove;
int bobfactor;
int friction, movefactor;
int fm, sm;
movefactor = P_GetMoveFactor (mo, &friction);
bobfactor = friction < ORIG_FRICTION ? movefactor : ORIG_FRICTION_FACTOR;
if (!onground && !(player->mo->flags & MF_NOGRAVITY) && !player->mo->waterlevel)
{
// [RH] allow very limited movement if not on ground.
movefactor = FixedMul (movefactor, level.aircontrol);
bobfactor = FixedMul (bobfactor, level.aircontrol);
}
fm = cmd->ucmd.forwardmove;
sm = cmd->ucmd.sidemove;
mo->TweakSpeeds (fm, sm);
fm = FixedMul (fm, player->mo->Speed);
sm = FixedMul (sm, player->mo->Speed);
// When crouching speed and bobbing have to be reduced
if (player->morphTics==0 && player->crouchfactor != FRACUNIT)
{
fm = FixedMul(fm, player->crouchfactor);
sm = FixedMul(sm, player->crouchfactor);
bobfactor = FixedMul(bobfactor, player->crouchfactor);
}
forwardmove = Scale (fm, movefactor * 35, TICRATE << 8);
sidemove = Scale (sm, movefactor * 35, TICRATE << 8);
if (forwardmove)
{
P_Bob (player, mo->angle, (cmd->ucmd.forwardmove * bobfactor) >> 8);
P_ForwardThrust (player, mo->angle, forwardmove);
}
if (sidemove)
{
P_Bob (player, mo->angle-ANG90, (cmd->ucmd.sidemove * bobfactor) >> 8);
P_SideThrust (player, mo->angle, sidemove);
}
if (debugfile)
{
fprintf (debugfile, "move player for pl %d%c: (%d,%d,%d) (%d,%d) %d %d w%d [", int(player-players),
player->cheats&CF_PREDICTING?'p':' ',
player->mo->x, player->mo->y, player->mo->z,forwardmove, sidemove, movefactor, friction, player->mo->waterlevel);
msecnode_t *n = player->mo->touching_sectorlist;
while (n != NULL)
{
fprintf (debugfile, "%td ", n->m_sector-sectors);
n = n->m_tnext;
}
fprintf (debugfile, "]\n");
}
if (!(player->cheats & CF_PREDICTING) && (forwardmove|sidemove))
{
player->mo->PlayRunning ();
}
if (player->cheats & CF_REVERTPLEASE)
{
player->cheats &= ~CF_REVERTPLEASE;
player->camera = player->mo;
}
}
}
//==========================================================================
//
// P_FallingDamage
//
//==========================================================================
void P_FallingDamage (AActor *actor)
{
int damagestyle;
int damage;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
fixed_t vel;
damagestyle = ((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX);
if (damagestyle == 0)
return;
- Fixed: The hitscan tracer had the current sector point to a temporary variable when 3D floors were involved. Update to ZDoom r965: - Fixed: SPAC_AnyCross didn't work. - Fixed: Pushable doors must also check for SPAC_MPush. - Fixed: P_LoadThings2 did not adjust the byte order for the thingid field. - Changed: HIRESTEX 'define' textures now replace existing textures of type MiscPatch with the same name. - Added UDMF line trigger types MonsterUse and MonsterPush. - Separated skill and class filter bits from FMapThing::flags so that UDMF can define up to 16 of each. Also separated easy/baby and hard/nightmare and changed default MAPINFO definitions. - Fixed: FWadCollection::MergeLumps() did not initialize the flags for any marker lumps it inserted. - Fixed: Need write barriers when modifying SequenceListHead. - Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of GUS patch flags, envelopes, and volume levels, while trying to be closer to TiMidity++ than original TiMidity. - Renamed timidity_config and timidity_voices to midi_config and midi_voices respectively. - Changed: Crosshair drawing uses the current player class's default health instead of 100 to calculate the color for the crosshair. - Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated all user settable flags from MoreFlags into their own Flags variable. - Reduced volume, expression, and panning controllers back to 7 bits. - Added very basic Soundfont support to the internal TiMidity. Things missing: filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or may not be compatible with TiMidity++'s soundfont extensions. - Changed all thing coordinates that were stored as shorts into fixed_t. - Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so that it is easier to add new features in the UDMF map format. - Added some initial code to read UDMF maps. - Added support for quoted strings to the TiMidity config parser. - Split off the slope creation code from p_Setup.cpp into its own file. - Separated the linedef activation types into a bit mask that allows combination of all types on the same linedef. Also added a 'first side only' flag. This is not usable from Hexen or Doom format maps though but in preparation of the UDMF format discussed here: http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/ - Changed linedef's alpha property from a byte to fixed point after seeing that 255 wasn't handled to be fully opaque. - fixed a GCC warning in fmodsound.cpp - Fixed: Warped textures didn't work anymore because the default speed was 0. - Fixed: I had instrument vibrato setting the tremolo_sweep_increment value in the instrument loader, effectively disabling vibrato. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE)
return;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
vel = abs(actor->velz);
// Since Hexen falling damage is stronger than ZDoom's, it takes
// precedence. ZDoom falling damage may not be as strong, but it
// gets felt sooner.
switch (damagestyle)
{
case DF_FORCE_FALLINGHX: // Hexen falling damage
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (vel <= 23*FRACUNIT)
{ // Not fast enough to hurt
return;
}
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (vel >= 63*FRACUNIT)
{ // automatic death
damage = 1000000;
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
vel = FixedMul (vel, 16*FRACUNIT/23);
damage = ((FixedMul (vel, vel) / 10) >> FRACBITS) - 24;
if (actor->velz > -39*FRACUNIT && damage > actor->health
&& actor->health != 1)
{ // No-death threshold
damage = actor->health-1;
}
}
break;
case DF_FORCE_FALLINGZD: // ZDoom falling damage
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (vel <= 19*FRACUNIT)
{ // Not fast enough to hurt
return;
}
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (vel >= 84*FRACUNIT)
{ // automatic death
damage = 1000000;
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
damage = ((MulScale23 (vel, vel*11) >> FRACBITS) - 30) / 2;
if (damage < 1)
{
damage = 1;
}
}
break;
case DF_FORCE_FALLINGST: // Strife falling damage
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (vel <= 20*FRACUNIT)
{ // Not fast enough to hurt
return;
}
// The minimum amount of damage you take from falling in Strife
// is 52. Ouch!
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
damage = vel / 25000;
break;
default:
return;
}
if (actor->player)
{
S_Sound (actor, CHAN_AUTO, "*land", 1, ATTN_NORM);
P_NoiseAlert (actor, actor, true);
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if (damage == 1000000 && (actor->player->cheats & (CF_GODMODE | CF_BUDDHA)))
{
damage = 999;
}
}
P_DamageMobj (actor, NULL, NULL, damage, NAME_Falling);
}
//==========================================================================
//
// P_DeathThink
//
//==========================================================================
void P_DeathThink (player_t *player)
{
int dir;
angle_t delta;
int lookDelta;
P_MovePsprites (player);
onground = (player->mo->z <= player->mo->floorz);
if (player->mo->IsKindOf (RUNTIME_CLASS(APlayerChunk)))
{ // Flying bloody skull or flying ice chunk
player->viewheight = 6 * FRACUNIT;
player->deltaviewheight = 0;
if (onground)
{
if (player->mo->pitch > -(int)ANGLE_1*19)
{
lookDelta = (-(int)ANGLE_1*19 - player->mo->pitch) / 8;
player->mo->pitch += lookDelta;
}
}
}
else if (!(player->mo->flags & MF_ICECORPSE))
{ // Fall to ground (if not frozen)
player->deltaviewheight = 0;
if (player->viewheight > 6*FRACUNIT)
{
player->viewheight -= FRACUNIT;
}
if (player->viewheight < 6*FRACUNIT)
{
player->viewheight = 6*FRACUNIT;
}
if (player->mo->pitch < 0)
{
player->mo->pitch += ANGLE_1*3;
}
else if (player->mo->pitch > 0)
{
player->mo->pitch -= ANGLE_1*3;
}
if (abs(player->mo->pitch) < ANGLE_1*3)
{
player->mo->pitch = 0;
}
}
P_CalcHeight (player);
if (player->attacker && player->attacker != player->mo)
{ // Watch killer
dir = P_FaceMobj (player->mo, player->attacker, &delta);
if (delta < ANGLE_1*10)
{ // Looking at killer, so fade damage and poison counters
if (player->damagecount)
{
player->damagecount--;
}
if (player->poisoncount)
{
player->poisoncount--;
}
}
delta /= 8;
if (delta > ANGLE_1*5)
{
delta = ANGLE_1*5;
}
if (dir)
{ // Turn clockwise
player->mo->angle += delta;
}
else
{ // Turn counter clockwise
player->mo->angle -= delta;
}
}
else
{
if (player->damagecount)
{
player->damagecount--;
}
if (player->poisoncount)
{
player->poisoncount--;
}
}
if ((player->cmd.ucmd.buttons & BT_USE ||
((multiplayer || alwaysapplydmflags) && (dmflags & DF_FORCE_RESPAWN))) && !(dmflags2 & DF2_NO_RESPAWN))
{
if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && !player->isbot))
{
player->cls = NULL; // Force a new class if the player is using a random class
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
player->playerstate = (multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN)) ? PST_REBORN : PST_ENTER;
if (player->mo->special1 > 2)
{
player->mo->special1 = 0;
}
}
}
}
//----------------------------------------------------------------------------
//
// PROC P_CrouchMove
//
//----------------------------------------------------------------------------
void P_CrouchMove(player_t * player, int direction)
{
fixed_t defaultheight = player->mo->GetDefault()->height;
fixed_t savedheight = player->mo->height;
fixed_t crouchspeed = direction * CROUCHSPEED;
fixed_t oldheight = player->viewheight;
player->crouchdir = (signed char) direction;
player->crouchfactor += crouchspeed;
// check whether the move is ok
player->mo->height = FixedMul(defaultheight, player->crouchfactor);
if (!P_TryMove(player->mo, player->mo->x, player->mo->y, false, false))
{
player->mo->height = savedheight;
if (direction > 0)
{
// doesn't fit
player->crouchfactor -= crouchspeed;
return;
}
}
player->mo->height = savedheight;
player->crouchfactor = clamp<fixed_t>(player->crouchfactor, FRACUNIT/2, FRACUNIT);
player->viewheight = FixedMul(player->mo->ViewHeight, player->crouchfactor);
player->crouchviewdelta = player->viewheight - player->mo->ViewHeight;
// Check for eyes going above/below fake floor due to crouching motion.
P_CheckFakeFloorTriggers(player->mo, player->mo->z + oldheight, true);
}
//----------------------------------------------------------------------------
//
// PROC P_PlayerThink
//
//----------------------------------------------------------------------------
void P_PlayerThink (player_t *player)
{
ticcmd_t *cmd;
if (player->mo == NULL)
{
I_Error ("No player %td start\n", player - players + 1);
}
if (debugfile && !(player->cheats & CF_PREDICTING))
{
fprintf (debugfile, "tic %d for pl %td: (%d, %d, %d, %u) b:%02x p:%d y:%d f:%d s:%d u:%d\n",
gametic, player-players, player->mo->x, player->mo->y, player->mo->z,
player->mo->angle>>ANGLETOFINESHIFT, player->cmd.ucmd.buttons,
player->cmd.ucmd.pitch, player->cmd.ucmd.yaw, player->cmd.ucmd.forwardmove,
player->cmd.ucmd.sidemove, player->cmd.ucmd.upmove);
}
// [RH] Zoom the player's FOV
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
float desired = player->DesiredFOV;
// Adjust FOV using on the currently held weapon.
if (player->playerstate != PST_DEAD && // No adjustment while dead.
player->ReadyWeapon != NULL && // No adjustment if no weapon.
player->ReadyWeapon->FOVScale != 0) // No adjustment if the adjustment is zero.
{
// A negative scale is used top prevent G_AddViewAngle/G_AddViewPitch
// from scaling with the FOV scale.
desired *= fabs(player->ReadyWeapon->FOVScale);
}
if (player->FOV != desired)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (fabsf (player->FOV - desired) < 7.f)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->FOV = desired;
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
float zoom = MAX(7.f, fabsf(player->FOV - desired) * 0.025f);
if (player->FOV > desired)
{
player->FOV = player->FOV - zoom;
}
else
{
player->FOV = player->FOV + zoom;
}
}
}
if (player->inventorytics)
{
player->inventorytics--;
}
// No-clip cheat
if (player->cheats & CF_NOCLIP)
{
player->mo->flags |= MF_NOCLIP;
}
else
{
player->mo->flags &= ~MF_NOCLIP;
}
cmd = &player->cmd;
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
// Make unmodified copies for ACS's GetPlayerInput.
player->original_oldbuttons = player->original_cmd.buttons;
player->original_cmd = cmd->ucmd;
if (player->mo->flags & MF_JUSTATTACKED)
{ // Chainsaw/Gauntlets attack auto forward motion
cmd->ucmd.yaw = 0;
cmd->ucmd.forwardmove = 0xc800/2;
cmd->ucmd.sidemove = 0;
player->mo->flags &= ~MF_JUSTATTACKED;
}
bool totallyfrozen = (player->cheats & CF_TOTALLYFROZEN || gamestate == GS_TITLELEVEL ||
(( level.flags2 & LEVEL2_FROZEN ) && ( player == NULL || !( player->cheats & CF_TIMEFREEZE )))
);
// [RH] Being totally frozen zeros out most input parameters.
if (totallyfrozen)
{
if (gamestate == GS_TITLELEVEL)
{
cmd->ucmd.buttons = 0;
}
else
{
cmd->ucmd.buttons &= BT_USE;
}
cmd->ucmd.pitch = 0;
cmd->ucmd.yaw = 0;
cmd->ucmd.roll = 0;
cmd->ucmd.forwardmove = 0;
cmd->ucmd.sidemove = 0;
cmd->ucmd.upmove = 0;
player->turnticks = 0;
}
else if (player->cheats & CF_FROZEN)
{
cmd->ucmd.forwardmove = 0;
cmd->ucmd.sidemove = 0;
cmd->ucmd.upmove = 0;
}
// Handle crouching
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
if (player->cmd.ucmd.buttons & BT_JUMP)
{
player->cmd.ucmd.buttons &= ~BT_CROUCH;
}
if (player->morphTics == 0 && player->health > 0 && level.IsCrouchingAllowed())
{
if (!totallyfrozen)
{
int crouchdir = player->crouching;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (crouchdir == 0)
{
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
crouchdir = (player->cmd.ucmd.buttons & BT_CROUCH)? -1 : 1;
}
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
else if (player->cmd.ucmd.buttons & BT_CROUCH)
{
player->crouching=0;
}
if (crouchdir == 1 && player->crouchfactor < FRACUNIT &&
player->mo->z + player->mo->height < player->mo->ceilingz)
{
P_CrouchMove(player, 1);
}
else if (crouchdir == -1 && player->crouchfactor > FRACUNIT/2)
{
P_CrouchMove(player, -1);
}
}
}
else
{
player->Uncrouch();
}
player->crouchoffset = -FixedMul(player->mo->ViewHeight, (FRACUNIT - player->crouchfactor));
if (player->playerstate == PST_DEAD)
{
player->Uncrouch();
P_DeathThink (player);
return;
}
if (player->jumpTics)
{
player->jumpTics--;
}
if (player->morphTics && !(player->cheats & CF_PREDICTING))
{
player->mo->MorphPlayerThink ();
}
// [RH] Look up/down stuff
if (!level.IsFreelookAllowed())
{
player->mo->pitch = 0;
}
else
{
int look = cmd->ucmd.pitch << 16;
// The player's view pitch is clamped between -32 and +56 degrees,
// which translates to about half a screen height up and (more than)
// one full screen height down from straight ahead when view panning
// is used.
if (look)
{
if (look == -32768 << 16)
{ // center view
player->mo->pitch = 0;
}
else
{
player->mo->pitch -= look;
if (look > 0)
{ // look up
player->mo->pitch = MAX(player->mo->pitch, screen->GetMaxViewPitch(false));
}
else
{ // look down
player->mo->pitch = MIN(player->mo->pitch, screen->GetMaxViewPitch(true));
}
}
}
}
// [RH] Check for fast turn around
if (cmd->ucmd.buttons & BT_TURN180 && !(player->oldbuttons & BT_TURN180))
{
player->turnticks = TURN180_TICKS;
}
// Handle movement
if (player->mo->reactiontime)
{ // Player is frozen
player->mo->reactiontime--;
}
else
{
P_MovePlayer (player);
// [RH] check for jump
if (cmd->ucmd.buttons & BT_JUMP)
{
if (player->crouchoffset!=0)
{
// Jumping while crouching will force an un-crouch but not jump
player->crouching = 1;
}
else
if (player->mo->waterlevel >= 2)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velz = 4*FRACUNIT;
}
else if (player->mo->flags & MF_NOGRAVITY)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velz = 3*FRACUNIT;
}
else if (level.IsJumpingAllowed() && onground && !player->jumpTics)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
fixed_t jumpvelz = player->mo->JumpZ * 35 / TICRATE;
// [BC] If the player has the high jump power, double his jump velocity.
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if ( player->cheats & CF_HIGHJUMP ) jumpvelz *= 2;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velz += jumpvelz;
S_Sound (player->mo, CHAN_BODY, "*jump", 1, ATTN_NORM);
player->mo->flags2 &= ~MF2_ONMOBJ;
player->jumpTics = 18*TICRATE/35;
}
}
if (cmd->ucmd.upmove == -32768)
{ // Only land if in the air
if ((player->mo->flags & MF_NOGRAVITY) && player->mo->waterlevel < 2)
{
//player->mo->flags2 &= ~MF2_FLY;
player->mo->flags &= ~MF_NOGRAVITY;
}
}
else if (cmd->ucmd.upmove != 0)
{
// Clamp the speed to some reasonable maximum.
int magnitude = abs (cmd->ucmd.upmove);
if (magnitude > 0x300)
{
cmd->ucmd.upmove = ksgn (cmd->ucmd.upmove) * 0x300;
}
if (player->mo->waterlevel >= 2 || (player->mo->flags2 & MF2_FLY))
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
player->mo->velz = cmd->ucmd.upmove << 9;
if (player->mo->waterlevel < 2 && !(player->mo->flags & MF_NOGRAVITY))
{
player->mo->flags2 |= MF2_FLY;
player->mo->flags |= MF_NOGRAVITY;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (player->mo->velz <= -39*FRACUNIT)
{ // Stop falling scream
S_StopSound (player->mo, CHAN_VOICE);
}
}
}
else if (cmd->ucmd.upmove > 0 && !(player->cheats & CF_PREDICTING))
{
AInventory *fly = player->mo->FindInventory (NAME_ArtiFly);
if (fly != NULL)
{
player->mo->UseInventory (fly);
}
}
}
}
P_CalcHeight (player);
if (!(player->cheats & CF_PREDICTING))
{
P_PlayerOnSpecial3DFloor (player);
if (player->mo->Sector->special || player->mo->Sector->damage)
{
P_PlayerInSpecialSector (player);
}
P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo));
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (player->mo->velz <= -35*FRACUNIT &&
player->mo->velz >= -40*FRACUNIT && !player->morphTics &&
player->mo->waterlevel == 0)
{
int id = S_FindSkinnedSound (player->mo, "*falling");
if (id != 0 && !S_IsActorPlayingSomething (player->mo, CHAN_VOICE, id))
{
S_Sound (player->mo, CHAN_VOICE, id, 1, ATTN_NORM);
}
}
// check for use
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
if ((cmd->ucmd.buttons & BT_USE) && !player->usedown)
{
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
player->usedown = true;
P_UseLines (player);
}
Update to ZDoom r2047: - Fixed: Decals could spread to walls which had a decal-less texture or were flagged not to have decals. - Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value from their StickToWall call and left unplaced decals behind if that happened. - Reintroduced Doom.exe's player_t::usedown variable so that respawning a player does not immediately activate switches. oldbuttons was not usable for this. This also required that CopyPlayer preserves this info. - Fixed: When restarting the music there was a NULL pointer check missing so it crashed when the game was started wi - Fixed: If the Use key is used to respawn the player it must be cleared so that it doesn't trigger any subsequent actions after respawning. - Fixed: Resurrecting a monster did not restore flags5 and flags6. - Fixed: Projectiles which killed a non-monster were unable to determine what precisely they hit because MF_CORPSE is only valid for monsters. A new flag, MF6_KILLED that gets set for all objects that die, was added for this case. - Added a generic A_Weave function that exposes all possible options of A_BishopMissileWeave and A_CStaffMissileSlither. These 2 functions are no longer needed from DECORATE and therefore deprecated. - The options menu no longer scales up so quickly, so it can fit wider text onscreen. In addition, it now uses the whole height available to it. Also, at lower resolutions, items on the compatibility options menu now cut off the beginning of the option label rather than the option setting, making this menu useable where previously it was not. - Added a channel parameter to the sector overload of SN_StopSequence() so it can be properly paired with calls to SN_StartSequence(). - Fixed: P_CheckPlayerSprites() ignored the MF4_NOSKIN flag. It now also sets the X scale, so switching skins while morphed does not produce weird stretching upon unmorphing. - Fixed: Calling S_ChangeMusic() with the same song but a different looping flag now restarts the song so that the new looping setting can be applied. (This was easier than modifying every music handler to support modifying loop changes on the fly, which seems like overkill.) - Fixed: savepatchsize was declared incorrectly in d_dehacked.cpp:DoInclude(). - Changed AFastProjectile::Effect() so that it sets the spawned trail to face same direction as the projectile. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@672 b0f79afe-0144-0410-b225-9a4edf0717df
2009-12-25 12:10:12 +00:00
else
{
player->usedown = false;
}
// Morph counter
if (player->morphTics)
{
if (player->chickenPeck)
{ // Chicken attack counter
player->chickenPeck -= 3;
}
if (!--player->morphTics)
{ // Attempt to undo the chicken/pig
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
P_UndoPlayerMorph (player, player);
}
}
// Cycle psprites
P_MovePsprites (player);
// Other Counters
if (player->damagecount)
player->damagecount--;
if (player->bonuscount)
player->bonuscount--;
if (player->hazardcount)
{
player->hazardcount--;
if (!(level.time & 31) && player->hazardcount > 16*TICRATE)
P_DamageMobj (player->mo, NULL, NULL, 5, NAME_Slime);
}
if (player->poisoncount && !(level.time & 15))
{
player->poisoncount -= 5;
if (player->poisoncount < 0)
{
player->poisoncount = 0;
}
P_PoisonDamage (player, player->poisoner, 1, true);
}
// [BC] Apply regeneration.
if (( level.time & 31 ) == 0 && ( player->cheats & CF_REGENERATION ) && ( player->health ))
{
if ( P_GiveBody( player->mo, 5 ))
{
S_Sound(player->mo, CHAN_ITEM, "*regenerate", 1, ATTN_NORM );
}
}
// Apply degeneration.
if (dmflags2 & DF2_YES_DEGENERATION)
{
if ((level.time % TICRATE) == 0 && player->health > deh.MaxHealth)
{
if (player->health - 5 < deh.MaxHealth)
player->health = deh.MaxHealth;
else
player->health--;
player->mo->health = player->health;
}
}
// Handle air supply
- Update to ZDoom r1532: - Swapped snes_spc out for the full Game Music Emu library. - Fixed: The Hexen status bar still uses MAX_MANA for some calculations instead of MaxAmount. - Added Blzut3's submission for displaying underwater stats in SBARINFO. - Added Gez's AMMO_CHECKBOTH submission. - Added Gez's THRUSPECIES submission. - Added loading directories into the lump directory. - fixed: The Dehacked parser could not parse flag values with the highest bit set because it used atoi to convert the string into a number. - fixed: bouncing sounds were limited to inventory items. - Rewrote IWAD detection code to use the ResourceFile classes instead of reading the WAD directory directly. As a side effect it should now be possible to use Zip and 7z for IWADs, too. - Added 'EndTitle' nextmap option which goes to the regular title loop after the game has finished. - Added NOBOSSRIP flag. Note: we are now at flags6! - Added SetSkyScrollSpeed(int skyplane, fixed speed) ACS function. - Added THRUACTORS flag that disables all actor<->actor collision detection. - Added DONTSEEKINVISIBLE flag for missiles that can't home in on invisible targets. - Added SFX_TRANSFERPITCH flag to A_SpawnItemEx. - Added Ultimate Freedoom IWAD detection. - Added GetAirSupply and SetAirSupply functions to ACS. - Fixed: The *surface sound was not played when drowning was switched off by setting the level's air supply to 0. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@338 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-04 13:59:08 +00:00
//if (level.airsupply > 0)
{
if (player->mo->waterlevel < 3 ||
(player->mo->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE))
{
player->mo->ResetAirSupply ();
}
else if (player->air_finished <= level.time && !(level.time & 31))
{
P_DamageMobj (player->mo, NULL, NULL, 2 + ((level.time-player->air_finished)/TICRATE), NAME_Drowning);
}
}
}
}
void P_PredictPlayer (player_t *player)
{
int maxtic;
if (cl_noprediction ||
singletics ||
demoplayback ||
player->mo == NULL ||
player != &players[consoleplayer] ||
player->playerstate != PST_LIVE ||
!netgame ||
/*player->morphTics ||*/
(player->cheats & CF_PREDICTING))
{
return;
}
maxtic = maketic;
if (gametic == maxtic)
{
return;
}
// Save original values for restoration later
PredictionPlayerBackup = *player;
AActor *act = player->mo;
memcpy (PredictionActorBackup, &act->x, sizeof(AActor)-((BYTE *)&act->x-(BYTE *)act));
act->flags &= ~MF_PICKUP;
act->flags2 &= ~MF2_PUSHWALL;
player->cheats |= CF_PREDICTING;
// The ordering of the touching_sectorlist needs to remain unchanged
msecnode_t *mnode = act->touching_sectorlist;
PredictionTouchingSectorsBackup.Clear ();
while (mnode != NULL)
{
PredictionTouchingSectorsBackup.Push (mnode->m_sector);
mnode = mnode->m_tnext;
}
// Blockmap ordering also needs to stay the same, so unlink the block nodes
// without releasing them. (They will be used again in P_UnpredictPlayer).
FBlockNode *block = act->BlockNode;
while (block != NULL)
{
if (block->NextActor != NULL)
{
block->NextActor->PrevActor = block->PrevActor;
}
*(block->PrevActor) = block->NextActor;
block = block->NextBlock;
}
act->BlockNode = NULL;
for (int i = gametic; i < maxtic; ++i)
{
player->cmd = localcmds[i % LOCALCMDTICS];
P_PlayerThink (player);
player->mo->Tick ();
}
}
extern msecnode_t *P_AddSecnode (sector_t *s, AActor *thing, msecnode_t *nextnode);
void P_UnPredictPlayer ()
{
player_t *player = &players[consoleplayer];
if (player->cheats & CF_PREDICTING)
{
AActor *act = player->mo;
*player = PredictionPlayerBackup;
act->UnlinkFromWorld ();
memcpy (&act->x, PredictionActorBackup, sizeof(AActor)-((BYTE *)&act->x-(BYTE *)act));
// Make the sector_list match the player's touching_sectorlist before it got predicted.
P_DelSeclist (sector_list);
sector_list = NULL;
for (unsigned int i = PredictionTouchingSectorsBackup.Size (); i-- > 0; )
{
sector_list = P_AddSecnode (PredictionTouchingSectorsBackup[i], act, sector_list);
}
// The blockmap ordering needs to remain unchanged, too. Right now, act has the right
// pointers, so temporarily set its MF_NOBLOCKMAP flag so that LinkToWorld() does not
// mess with them.
act->flags |= MF_NOBLOCKMAP;
act->LinkToWorld ();
act->flags &= ~MF_NOBLOCKMAP;
// Now fix the pointers in the blocknode chain
FBlockNode *block = act->BlockNode;
while (block != NULL)
{
*(block->PrevActor) = block;
if (block->NextActor != NULL)
{
block->NextActor->PrevActor = &block->NextActor;
}
block = block->NextBlock;
}
}
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void player_t::Serialize (FArchive &arc)
{
int i;
arc << cls
<< mo
<< camera
<< playerstate
<< cmd
<< userinfo
<< DesiredFOV << FOV
<< viewz
<< viewheight
<< deltaviewheight
<< bob
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
<< velx
<< vely
<< centering
<< health
<< inventorytics
<< backpack
<< fragcount
<< spreecount
<< multicount
<< lastkilltime
<< ReadyWeapon << PendingWeapon
<< cheats
<< refire
<< inconsistant
<< killcount
<< itemcount
<< secretcount
<< damagecount
<< bonuscount
<< hazardcount
<< poisoncount
<< poisoner
<< attacker
<< extralight;
if (SaveVersion < 1858)
{
int fixedmap;
arc << fixedmap;
fixedcolormap = NOFIXEDCOLORMAP;
fixedlightlevel = -1;
if (fixedmap >= NUMCOLORMAPS)
{
fixedcolormap = fixedmap - NUMCOLORMAPS;
}
else if (fixedmap > 0)
{
fixedlightlevel = fixedmap;
}
}
else if (SaveVersion < 1893)
{
int ll;
arc << fixedcolormap << ll;
fixedlightlevel = ll;
}
else
{
arc << fixedcolormap << fixedlightlevel;
}
arc << morphTics
Update to ZDoom r894: - Eliminated all use of global variables used as output for P_CheckPosition and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because the global variables can be easily overwritten with certain DECORATE constructs. - Removed some unnecessary morphing code. - Fixed some bugs in the HIRESTEX parser. - Added floating point support and #include and #define tokens to FParseContext Not used yet. - replaced the value scanning code in FParseContext::GetToken with calls to strtol. - Changed XlatParseContext::FindToken to do a binary search over the valid token names. - Fixed: The check arrays for BlockThingsIterators were not properly freed and each iterator allocated a new one as a result. - Split the Xlat parser context class into a generic part that can be used for other Lemon-based parsers in the future and a smaller Xlat-specific part. - Changed: P_TeleportMove now always sets BlockingLine to NULL and P_FindFloorCeiling doesn't set it at all. The way it was set in PIT_FindFloorCeiling didn't look correct. (Note: It's amazing how easy it is to break P_TryMove et.al. with DECORATE if you just know which combinations of code pointers will cause problems. This definitely needs to be addressed.) - Changed P_FindFloorCeiling so that it doesn't need global variables anymore. I also moved the code to set the calling actor's information into this function because that's all it is used for. This also fixes another bug: - AInventory::BecomePickup called P_FindFloorCeiling to get proper position values for the item but never set the item's information to the return value of this call. - Removed the check for Heretic when playing *evillaugh when using the Chaos Device. This sound is not defined by the other games so it won't play by default. - Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags for the morph style so that the special behavior of these two items can be switched on and off. - Added Martin Howe's morph system enhancement. - Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere. - Rewrote BlockThingsIterator code not to use callbacks anymore. - Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but P_FindFloorCeiling never did that. - Merged Check_Sides and PIT_CrossLine into A_PainShootSkull. - Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was used. This also allowed to remove all the global variable saving in P_CreateSecNodeList. - Added a new FBlockLinesIterator class that doesn't need a callback function because debugging the previous bug proved to be a bit annoying because it involved a P_BlockLinesIterator loop. - Fixed: The MBF code to move monsters away from dropoffs did not work as intended due to some random decisions in P_DoNewChaseDir. When in the avoiding dropoff mode these are ignored now. This should cure the problem that monsters hanging over a dropoff tended to drop down. - Added a NOTIMEFREEZE flag that excludes actors from being affected by the time freezer powerup. - Changed: Empty pickup messages are no longer printed. - Changed secret sector drawing in automap so that lines with the ML_SECRET flag are only drawn as part of a secret sector if that secret has already been found, even if the option is set to always show secret sectors. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@88 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-08 22:32:52 +00:00
<< MorphedPlayerClass
<< MorphStyle
<< MorphExitFlash
<< PremorphWeapon
<< chickenPeck
<< jumpTics
<< respawn_time
<< air_finished
<< turnticks
<< oldbuttons
<< isbot
<< BlendR
<< BlendG
<< BlendB
<< BlendA
<< accuracy << stamina
- Update to ZDoom r858: - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it from doing prebuffering of the song. This was causing the Linux version to hang while waiting for input from the pipe, since Timidity hadn't been started yet. I tried using a select call in the FillStream() method, but it always seems to return the pipe as having nothing available. Unfortunately, the game still falls all over itself if Timidity isn't available. Instead of execvp failing nicely, X errors kill the game. I don't know why it's doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far) and set the snd_midipatchset cvar to point to it. It's faster and also sounds a whole lot better than the crappy freepats Ubuntu wants to install with Timidity++ (thank goodness I have the official patches from a real GUS so I don't need to use them). - GCC fixes. - Fixed: After starting new music the music volume has to be reset so that the song's relative volume takes effect. - Removed the arbitrary 1024 bytes limit when the file being played is a MIDI file. I had a D_DM2TTL that's only 990 bytes. - Restructured I_RegisterSong so that $mididevice works again and also supports selecting FMOD. - Added Jim' Linux fix. - Added MartinHowe's fix for mugshot display in status bars. - The garbage collector is now run one last time just before exiting the game. - Removed movie volume from the sound menu and renamed some of the other options to give the MIDI device name more room to display itself. - Moved the midi device selection into the main sound menu. - Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the default device. By default, it uses exactly the same DLS instruments as the Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set you want to use, set the snd_midipatchset cvar to specify where it should load the instruments from. - Changed the ProduceMIDI function to store its output into a TArray<BYTE>. An overloaded version wraps around it to continue to supply file-writing support for external Timidity++ usage. - Added an FMOD credits banner to comply with their non-commercial license. - Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather than a time in ms, this is now the length in samples of the DSP buffer. Also added the snd_buffercount cvar to offer complete control over the call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate below about 44kHz, you will need to set snd_buffersize to avoid long latencies. - Reimplemented the snd_output cvar for the FMOD Ex sound system. - Changed snd_samplerate default to 0. This now means to use the default sample rate. - Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and snd_hrtf available through the menu. - Split the HRTF effect selection into its own cvar: snd_hrtf. - Removed 96000 Hz option from the menu. It's still available through the cvar, if desired. - Fixed: If Windows sound init failed, retry with DirectSound. (Apparently, WASAPI doesn't work with more than two speakers and PCM-Float output at the same time.) - Fixed: Area sounds only played from the front speakers once you got within the 2D panning area. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
<< LogText
<< ConversationNPC
<< ConversationPC
<< ConversationNPCAngle
<< ConversationFaceTalker;
for (i = 0; i < MAXPLAYERS; i++)
arc << frags[i];
for (i = 0; i < NUMPSPRITES; i++)
arc << psprites[i];
arc << CurrentPlayerClass;
arc << crouchfactor
<< crouching
<< crouchdir
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
<< crouchviewdelta
<< original_cmd
<< original_oldbuttons;
if (isbot)
{
arc << angle
<< dest
<< prev
<< enemy
<< missile
<< mate
<< last_mate
<< skill
<< t_active
<< t_respawn
<< t_strafe
<< t_react
<< t_fight
<< t_roam
<< t_rocket
<< first_shot
<< sleft
<< allround
<< oldx
<< oldy;
}
else
{
dest = prev = enemy = missile = mate = last_mate = NULL;
}
if (arc.IsLoading ())
{
// If the player reloaded because they pressed +use after dying, we
// don't want +use to still be down after the game is loaded.
oldbuttons = ~0;
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
original_oldbuttons = ~0;
}
}