2008-01-27 11:25:03 +00:00
|
|
|
/*
|
|
|
|
** c_dispatch.cpp
|
|
|
|
** Functions for executing console commands and aliases
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 1998-2007 Randy Heit
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
// HEADER FILES ------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "cmdlib.h"
|
|
|
|
#include "c_console.h"
|
|
|
|
#include "c_dispatch.h"
|
|
|
|
#include "m_argv.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "d_player.h"
|
|
|
|
#include "configfile.h"
|
|
|
|
#include "m_crc32.h"
|
|
|
|
#include "v_text.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "d_net.h"
|
2009-06-04 13:59:08 +00:00
|
|
|
#include "d_main.h"
|
2011-07-06 18:59:20 +00:00
|
|
|
#include "farchive.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// MACROS ------------------------------------------------------------------
|
|
|
|
|
|
|
|
// TYPES -------------------------------------------------------------------
|
|
|
|
|
|
|
|
class DWaitingCommand : public DThinker
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DWaitingCommand, DThinker)
|
|
|
|
public:
|
|
|
|
DWaitingCommand (const char *cmd, int tics);
|
|
|
|
~DWaitingCommand ();
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
void Tick ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DWaitingCommand ();
|
|
|
|
|
|
|
|
char *Command;
|
|
|
|
int TicsLeft;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DStoredCommand : public DThinker
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DStoredCommand, DThinker)
|
|
|
|
public:
|
|
|
|
DStoredCommand (FConsoleCommand *com, const char *cmd);
|
|
|
|
~DStoredCommand ();
|
|
|
|
void Tick ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DStoredCommand ();
|
|
|
|
|
|
|
|
FConsoleCommand *Command;
|
|
|
|
char *Text;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FActionMap
|
|
|
|
{
|
|
|
|
unsigned int Key; // value from passing Name to MakeKey()
|
|
|
|
FButtonStatus *Button;
|
|
|
|
char Name[12];
|
|
|
|
};
|
|
|
|
|
|
|
|
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
|
|
|
|
|
|
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
|
|
|
|
|
|
|
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
|
|
|
|
- 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
|
|
|
static long ParseCommandLine (const char *args, int *argc, char **argv, bool no_escapes);
|
2008-01-27 11:25:03 +00:00
|
|
|
static FConsoleCommand *FindNameInHashTable (FConsoleCommand **table, const char *name, size_t namelen);
|
|
|
|
static FConsoleCommand *ScanChainForName (FConsoleCommand *start, const char *name, size_t namelen, FConsoleCommand **prev);
|
|
|
|
|
|
|
|
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
|
|
|
|
|
|
|
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
|
|
|
|
|
|
|
CVAR (Bool, lookspring, true, CVAR_ARCHIVE); // Generate centerview when -mlook encountered?
|
|
|
|
|
|
|
|
FConsoleCommand *Commands[FConsoleCommand::HASH_SIZE];
|
|
|
|
FButtonStatus Button_Mlook, Button_Klook, Button_Use, Button_AltAttack,
|
|
|
|
Button_Attack, Button_Speed, Button_MoveRight, Button_MoveLeft,
|
|
|
|
Button_Strafe, Button_LookDown, Button_LookUp, Button_Back,
|
|
|
|
Button_Forward, Button_Right, Button_Left, Button_MoveDown,
|
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
|
|
|
Button_MoveUp, Button_Jump, Button_ShowScores, Button_Crouch,
|
|
|
|
Button_Zoom, Button_Reload,
|
2010-08-27 17:42:01 +00:00
|
|
|
Button_User1, Button_User2, Button_User3, Button_User4,
|
|
|
|
Button_AM_PanLeft, Button_AM_PanRight, Button_AM_PanDown, Button_AM_PanUp,
|
|
|
|
Button_AM_ZoomIn, Button_AM_ZoomOut;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
bool ParsingKeyConf;
|
|
|
|
|
|
|
|
// To add new actions, go to the console and type "key <action name>".
|
|
|
|
// This will give you the key value to use in the first column. Then
|
|
|
|
// insert your new action into this list so that the keys remain sorted
|
|
|
|
// in ascending order. No two keys can be identical. If yours matches
|
|
|
|
// an existing key, change the name of your action.
|
|
|
|
|
|
|
|
FActionMap ActionMaps[] =
|
|
|
|
{
|
2010-08-27 17:42:01 +00:00
|
|
|
{ 0x0d52d67b, &Button_AM_PanLeft, "am_panleft"},
|
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
|
|
|
{ 0x125f5226, &Button_User2, "user2" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0x1eefa611, &Button_Jump, "jump" },
|
|
|
|
{ 0x201f1c55, &Button_Right, "right" },
|
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
|
|
|
{ 0x20ccc4d5, &Button_Zoom, "zoom" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0x23a99cd7, &Button_Back, "back" },
|
2010-08-27 17:42:01 +00:00
|
|
|
{ 0x41df90c2, &Button_AM_ZoomIn, "am_zoomin"},
|
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
|
|
|
{ 0x426b69e7, &Button_Reload, "reload" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0x4463f43a, &Button_LookDown, "lookdown" },
|
2010-08-27 17:42:01 +00:00
|
|
|
{ 0x51f7a334, &Button_AM_ZoomOut, "am_zoomout"},
|
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
|
|
|
{ 0x534c30ee, &Button_User4, "user4" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0x5622bf42, &Button_Attack, "attack" },
|
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
|
|
|
{ 0x577712d0, &Button_User1, "user1" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0x57c25cb2, &Button_Klook, "klook" },
|
|
|
|
{ 0x59f3e907, &Button_Forward, "forward" },
|
|
|
|
{ 0x6167ce99, &Button_MoveDown, "movedown" },
|
|
|
|
{ 0x676885b8, &Button_AltAttack, "altattack" },
|
|
|
|
{ 0x6fa41b84, &Button_MoveLeft, "moveleft" },
|
|
|
|
{ 0x818f08e6, &Button_MoveRight, "moveright" },
|
2010-08-27 17:42:01 +00:00
|
|
|
{ 0x8197097b, &Button_AM_PanRight, "am_panright"},
|
|
|
|
{ 0x8d89955e, &Button_AM_PanUp, "am_panup"} ,
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0xa2b62d8b, &Button_Mlook, "mlook" },
|
|
|
|
{ 0xab2c3e71, &Button_Crouch, "crouch" },
|
|
|
|
{ 0xb000b483, &Button_Left, "left" },
|
|
|
|
{ 0xb62b1e49, &Button_LookUp, "lookup" },
|
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
|
|
|
{ 0xb6f8fe92, &Button_User3, "user3" },
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0xb7e6a54b, &Button_Strafe, "strafe" },
|
2010-08-27 17:42:01 +00:00
|
|
|
{ 0xce301c81, &Button_AM_PanDown, "am_pandown"},
|
2008-01-27 11:25:03 +00:00
|
|
|
{ 0xd5897c73, &Button_ShowScores, "showscores" },
|
|
|
|
{ 0xe0ccb317, &Button_Speed, "speed" },
|
|
|
|
{ 0xe0cfc260, &Button_Use, "use" },
|
|
|
|
{ 0xfdd701c7, &Button_MoveUp, "moveup" },
|
|
|
|
};
|
|
|
|
#define NUM_ACTIONS countof(ActionMaps)
|
|
|
|
|
2010-08-27 17:42:01 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
|
|
|
|
|
|
|
static const char *KeyConfCommands[] =
|
|
|
|
{
|
|
|
|
"alias",
|
|
|
|
"defaultbind",
|
|
|
|
"addkeysection",
|
|
|
|
"addmenukey",
|
|
|
|
"addslotdefault",
|
|
|
|
"weaponsection",
|
|
|
|
"setslot",
|
|
|
|
"addplayerclass",
|
|
|
|
"clearplayerclasses"
|
|
|
|
};
|
|
|
|
|
|
|
|
// CODE --------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPLEMENT_CLASS (DWaitingCommand)
|
|
|
|
|
|
|
|
void DWaitingCommand::Serialize (FArchive &arc)
|
|
|
|
{
|
|
|
|
Super::Serialize (arc);
|
|
|
|
arc << Command << TicsLeft;
|
|
|
|
}
|
|
|
|
|
|
|
|
DWaitingCommand::DWaitingCommand ()
|
|
|
|
{
|
|
|
|
Command = NULL;
|
|
|
|
TicsLeft = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
DWaitingCommand::DWaitingCommand (const char *cmd, int tics)
|
|
|
|
{
|
|
|
|
Command = copystring (cmd);
|
|
|
|
TicsLeft = tics+1;
|
|
|
|
}
|
|
|
|
|
|
|
|
DWaitingCommand::~DWaitingCommand ()
|
|
|
|
{
|
|
|
|
if (Command != NULL)
|
|
|
|
{
|
|
|
|
delete[] Command;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DWaitingCommand::Tick ()
|
|
|
|
{
|
|
|
|
if (--TicsLeft == 0)
|
|
|
|
{
|
|
|
|
AddCommandString (Command);
|
|
|
|
Destroy ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
IMPLEMENT_CLASS (DStoredCommand)
|
|
|
|
|
|
|
|
DStoredCommand::DStoredCommand ()
|
|
|
|
{
|
|
|
|
Text = NULL;
|
|
|
|
Destroy ();
|
|
|
|
}
|
|
|
|
|
|
|
|
DStoredCommand::DStoredCommand (FConsoleCommand *command, const char *args)
|
|
|
|
{
|
|
|
|
Command = command;
|
|
|
|
Text = copystring (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
DStoredCommand::~DStoredCommand ()
|
|
|
|
{
|
|
|
|
if (Text != NULL)
|
|
|
|
{
|
|
|
|
delete[] Text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DStoredCommand::Tick ()
|
|
|
|
{
|
|
|
|
if (Text != NULL && Command != NULL)
|
|
|
|
{
|
|
|
|
FCommandLine args (Text);
|
|
|
|
Command->Run (args, players[consoleplayer].mo, 0);
|
|
|
|
}
|
|
|
|
Destroy ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ListActionCommands (const char *pattern)
|
|
|
|
{
|
|
|
|
char matcher[16];
|
|
|
|
unsigned int i;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < NUM_ACTIONS; ++i)
|
|
|
|
{
|
|
|
|
if (pattern == NULL || CheckWildcards (pattern,
|
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 (matcher, countof(matcher), "+%s", ActionMaps[i].Name), matcher)))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
Printf ("+%s\n", ActionMaps[i].Name);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (pattern == NULL || CheckWildcards (pattern,
|
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 (matcher, countof(matcher), "-%s", ActionMaps[i].Name), matcher)))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
Printf ("-%s\n", ActionMaps[i].Name);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ======================================================================== */
|
|
|
|
|
|
|
|
/* By Paul Hsieh (C) 2004, 2005. Covered under the Paul Hsieh derivative
|
|
|
|
license. See:
|
|
|
|
http://www.azillionmonkeys.com/qed/weblicense.html for license details.
|
|
|
|
|
|
|
|
http://www.azillionmonkeys.com/qed/hash.html */
|
|
|
|
|
|
|
|
#undef get16bits
|
|
|
|
#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
|
|
|
|
|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
|
|
|
|
#define get16bits(d) (*((const WORD *) (d)))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined (get16bits)
|
|
|
|
#define get16bits(d) ((((DWORD)(((const BYTE *)(d))[1])) << 8)\
|
|
|
|
+(DWORD)(((const BYTE *)(d))[0]) )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
DWORD SuperFastHash (const char *data, size_t len)
|
|
|
|
{
|
|
|
|
DWORD hash = 0, tmp;
|
|
|
|
size_t rem;
|
|
|
|
|
|
|
|
if (len == 0 || data == NULL) return 0;
|
|
|
|
|
|
|
|
rem = len & 3;
|
|
|
|
len >>= 2;
|
|
|
|
|
|
|
|
/* Main loop */
|
|
|
|
for (;len > 0; len--)
|
|
|
|
{
|
|
|
|
hash += get16bits (data);
|
|
|
|
tmp = (get16bits (data+2) << 11) ^ hash;
|
|
|
|
hash = (hash << 16) ^ tmp;
|
|
|
|
data += 2*sizeof (WORD);
|
|
|
|
hash += hash >> 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle end cases */
|
|
|
|
switch (rem)
|
|
|
|
{
|
|
|
|
case 3: hash += get16bits (data);
|
|
|
|
hash ^= hash << 16;
|
|
|
|
hash ^= data[sizeof (WORD)] << 18;
|
|
|
|
hash += hash >> 11;
|
|
|
|
break;
|
|
|
|
case 2: hash += get16bits (data);
|
|
|
|
hash ^= hash << 11;
|
|
|
|
hash += hash >> 17;
|
|
|
|
break;
|
|
|
|
case 1: hash += *data;
|
|
|
|
hash ^= hash << 10;
|
|
|
|
hash += hash >> 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Force "avalanching" of final 127 bits */
|
|
|
|
hash ^= hash << 3;
|
|
|
|
hash += hash >> 5;
|
|
|
|
hash ^= hash << 4;
|
|
|
|
hash += hash >> 17;
|
|
|
|
hash ^= hash << 25;
|
|
|
|
hash += hash >> 6;
|
|
|
|
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* A modified version to do a case-insensitive hash */
|
|
|
|
|
|
|
|
#undef get16bits
|
|
|
|
#define get16bits(d) ((((DWORD)tolower(((const BYTE *)(d))[1])) << 8)\
|
|
|
|
+(DWORD)tolower(((const BYTE *)(d))[0]) )
|
|
|
|
|
|
|
|
DWORD SuperFastHashI (const char *data, size_t len)
|
|
|
|
{
|
|
|
|
DWORD hash = 0, tmp;
|
|
|
|
size_t rem;
|
|
|
|
|
|
|
|
if (len <= 0 || data == NULL) return 0;
|
|
|
|
|
|
|
|
rem = len & 3;
|
|
|
|
len >>= 2;
|
|
|
|
|
|
|
|
/* Main loop */
|
|
|
|
for (;len > 0; len--)
|
|
|
|
{
|
|
|
|
hash += get16bits (data);
|
|
|
|
tmp = (get16bits (data+2) << 11) ^ hash;
|
|
|
|
hash = (hash << 16) ^ tmp;
|
|
|
|
data += 2*sizeof (WORD);
|
|
|
|
hash += hash >> 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle end cases */
|
|
|
|
switch (rem)
|
|
|
|
{
|
|
|
|
case 3: hash += get16bits (data);
|
|
|
|
hash ^= hash << 16;
|
|
|
|
hash ^= tolower(data[sizeof (WORD)]) << 18;
|
|
|
|
hash += hash >> 11;
|
|
|
|
break;
|
|
|
|
case 2: hash += get16bits (data);
|
|
|
|
hash ^= hash << 11;
|
|
|
|
hash += hash >> 17;
|
|
|
|
break;
|
|
|
|
case 1: hash += tolower(*data);
|
|
|
|
hash ^= hash << 10;
|
|
|
|
hash += hash >> 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Force "avalanching" of final 127 bits */
|
|
|
|
hash ^= hash << 3;
|
|
|
|
hash += hash >> 5;
|
|
|
|
hash ^= hash << 4;
|
|
|
|
hash += hash >> 17;
|
|
|
|
hash ^= hash << 25;
|
|
|
|
hash += hash >> 6;
|
|
|
|
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ======================================================================== */
|
|
|
|
|
|
|
|
unsigned int MakeKey (const char *s)
|
|
|
|
{
|
|
|
|
if (s == NULL)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return SuperFastHashI (s, strlen (s));
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int MakeKey (const char *s, size_t len)
|
|
|
|
{
|
|
|
|
return SuperFastHashI (s, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FindButton scans through the actionbits[] array
|
|
|
|
// for a matching key and returns an index or -1 if
|
|
|
|
// the key could not be found. This uses binary search,
|
|
|
|
// so actionbits[] must be sorted in ascending order.
|
|
|
|
|
|
|
|
FButtonStatus *FindButton (unsigned int key)
|
|
|
|
{
|
|
|
|
const FActionMap *bit;
|
|
|
|
|
|
|
|
bit = BinarySearch<FActionMap, unsigned int>
|
|
|
|
(ActionMaps, NUM_ACTIONS, &FActionMap::Key, key);
|
|
|
|
return bit ? bit->Button : NULL;
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
bool FButtonStatus::PressKey (int keynum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int i, open;
|
|
|
|
|
|
|
|
keynum &= KEY_DBLCLICKED-1;
|
|
|
|
|
|
|
|
if (keynum == 0)
|
|
|
|
{ // Issued from console instead of a key, so force on
|
|
|
|
Keys[0] = 0xffff;
|
|
|
|
for (i = MAX_KEYS-1; i > 0; --i)
|
|
|
|
{
|
|
|
|
Keys[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (i = MAX_KEYS-1, open = -1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
if (Keys[i] == 0)
|
|
|
|
{
|
|
|
|
open = i;
|
|
|
|
}
|
|
|
|
else if (Keys[i] == keynum)
|
|
|
|
{ // Key is already down; do nothing
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (open < 0)
|
|
|
|
{ // No free key slots, so do nothing
|
|
|
|
Printf ("More than %u keys pressed for a single action!\n", MAX_KEYS);
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
Keys[open] = keynum;
|
|
|
|
}
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
BYTE wasdown = bDown;
|
2008-01-27 11:25:03 +00:00
|
|
|
bDown = bWentDown = true;
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
// Returns true if this key caused the button to go down.
|
|
|
|
return !wasdown;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
bool FButtonStatus::ReleaseKey (int keynum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int i, numdown, match;
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
BYTE wasdown = bDown;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
keynum &= KEY_DBLCLICKED-1;
|
|
|
|
|
|
|
|
if (keynum == 0)
|
|
|
|
{ // Issued from console instead of a key, so force off
|
|
|
|
for (i = MAX_KEYS-1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
Keys[i] = 0;
|
|
|
|
}
|
|
|
|
bWentUp = true;
|
|
|
|
bDown = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (i = MAX_KEYS-1, numdown = 0, match = -1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
if (Keys[i] != 0)
|
|
|
|
{
|
|
|
|
++numdown;
|
|
|
|
if (Keys[i] == keynum)
|
|
|
|
{
|
|
|
|
match = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (match < 0)
|
|
|
|
{ // Key was not down; do nothing
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
return false;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
Keys[match] = 0;
|
|
|
|
bWentUp = true;
|
|
|
|
if (--numdown == 0)
|
|
|
|
{
|
|
|
|
bDown = false;
|
|
|
|
}
|
|
|
|
}
|
Update to ZDoom r1747:
- Added A_Mushroom compatibility option for Dehacked.
- Added Gez's submission for interhubamount DECORATE property.
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
parameter but to force it for Dehacked mods some minor hacks using the
Misc1 variable were needed.
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off
by one. Most notably as a result, the blast radius was used as the thrust,
so it sent you flying far faster than it should have.
- Restored the reactiontime countdown for A_SpawnFly, since some Dehacked
mod could conceivable rely on it. The deadline is now kept in special2
and used in preference as long as it is non-zero.
- Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
- gdtoa now performs all type aliasing through unions. -Wall has been added
to the GCC flags for the library to help verify this.
- Changed A_SpawnFly to do nothing if reactiontime is 0. Reactiontime was
originally a counter, so if it started at 0, A_SpawnFly would effectively
never spawn anything. Fixes Dehacked patches that use A_SpawnSound to
play a sound without shooting boss cubes, since it also calls A_SpawnFly.
- Joystick devices now send key up events for any buttons that are held
down when they are destroyed.
- Changed the joystick enable-y menu items to be nonrepeatable so that you
can't create several device scans per second. Changing them with a
controller is also disabled so that you can't, for example, toggle XInput
support using an XInput controller and have things go haywire when the
game receives an infinite number of key down events when the controller
is reinitialized with the other input system.
- Changed menu input to use a consolidated set of buttons, so most menus
can be navigated with a controller as well as a keyboard.
- Changed the way that X/Y analog axes are converted to digital axes.
Previously, this was done by checking if each axis was outside its deadzone.
Now they are checked together based on their angle, so straight up/down/
left/right are much easier to achieve.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@406 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-02 17:00:19 +00:00
|
|
|
// Returns true if releasing this key caused the button to go up.
|
|
|
|
return wasdown && !bDown;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ResetButtonTriggers ()
|
|
|
|
{
|
|
|
|
for (int i = NUM_ACTIONS-1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
ActionMaps[i].Button->ResetTriggers ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ResetButtonStates ()
|
|
|
|
{
|
|
|
|
for (int i = NUM_ACTIONS-1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
FButtonStatus *button = ActionMaps[i].Button;
|
|
|
|
|
|
|
|
if (button != &Button_Mlook && button != &Button_Klook)
|
|
|
|
{
|
|
|
|
button->ReleaseKey (0);
|
|
|
|
}
|
|
|
|
button->ResetTriggers ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void C_DoCommand (const char *cmd, int keynum)
|
|
|
|
{
|
|
|
|
FConsoleCommand *com;
|
|
|
|
const char *end;
|
|
|
|
const char *beg;
|
|
|
|
|
|
|
|
// Skip any beginning whitespace
|
|
|
|
while (*cmd && *cmd <= ' ')
|
|
|
|
cmd++;
|
|
|
|
|
|
|
|
// Find end of the command name
|
|
|
|
if (*cmd == '\"')
|
|
|
|
{
|
|
|
|
for (end = beg = cmd+1; *end && *end != '\"'; ++end)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
beg = cmd;
|
|
|
|
for (end = cmd+1; *end > ' '; ++end)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
const size_t len = end - beg;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (ParsingKeyConf)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = countof(KeyConfCommands)-1; i >= 0; --i)
|
|
|
|
{
|
|
|
|
if (strnicmp (beg, KeyConfCommands[i], len) == 0 &&
|
|
|
|
KeyConfCommands[i][len] == 0)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i < 0)
|
|
|
|
{
|
|
|
|
Printf ("Invalid command for KEYCONF: %s\n", beg);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if this is an action
|
|
|
|
if (*beg == '+' || *beg == '-')
|
|
|
|
{
|
|
|
|
FButtonStatus *button;
|
|
|
|
|
|
|
|
button = FindButton (MakeKey (beg + 1, end - beg - 1));
|
|
|
|
if (button != NULL)
|
|
|
|
{
|
|
|
|
if (*beg == '+')
|
|
|
|
{
|
|
|
|
button->PressKey (keynum);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
button->ReleaseKey (keynum);
|
|
|
|
if (button == &Button_Mlook && lookspring)
|
|
|
|
{
|
|
|
|
Net_WriteByte (DEM_CENTERVIEW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parse it as a normal command
|
|
|
|
// Checking for matching commands follows this search order:
|
|
|
|
// 1. Check the Commands[] hash table
|
|
|
|
// 2. Check the CVars list
|
|
|
|
|
|
|
|
if ( (com = FindNameInHashTable (Commands, beg, len)) )
|
|
|
|
{
|
|
|
|
if (gamestate != GS_STARTUP || ParsingKeyConf ||
|
|
|
|
(len == 3 && strnicmp (beg, "set", 3) == 0) ||
|
|
|
|
(len == 7 && strnicmp (beg, "logfile", 7) == 0) ||
|
|
|
|
(len == 9 && strnicmp (beg, "unbindall", 9) == 0) ||
|
|
|
|
(len == 4 && strnicmp (beg, "bind", 4) == 0) ||
|
|
|
|
(len == 4 && strnicmp (beg, "exec", 4) == 0) ||
|
|
|
|
(len ==10 && strnicmp (beg, "doublebind", 10) == 0) ||
|
|
|
|
(len == 6 && strnicmp (beg, "pullin", 6) == 0)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
FCommandLine args (beg);
|
|
|
|
com->Run (args, players[consoleplayer].mo, keynum);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
new DStoredCommand (com, beg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Check for any console vars that match the command
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
FBaseCVar *var = FindCVarSub (beg, int(len));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (var != NULL)
|
|
|
|
{
|
|
|
|
FCommandLine args (beg);
|
|
|
|
|
|
|
|
if (args.argc() >= 2)
|
|
|
|
{ // Set the variable
|
|
|
|
var->CmdSet (args[1]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Get the variable's value
|
|
|
|
UCVarValue val = var->GetGenericRep (CVAR_String);
|
|
|
|
Printf ("\"%s\" is \"%s\"\n", var->GetName(), val.String);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // We don't know how to handle this command
|
|
|
|
char cmdname[64];
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
size_t minlen = MIN<size_t> (len, 63);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
memcpy (cmdname, beg, minlen);
|
|
|
|
cmdname[len] = 0;
|
|
|
|
Printf ("Unknown command \"%s\"\n", cmdname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void AddCommandString (char *cmd, int keynum)
|
|
|
|
{
|
|
|
|
char *brkpt;
|
|
|
|
int more;
|
|
|
|
|
|
|
|
if (cmd)
|
|
|
|
{
|
|
|
|
while (*cmd)
|
|
|
|
{
|
|
|
|
brkpt = cmd;
|
|
|
|
while (*brkpt != ';' && *brkpt != '\0')
|
|
|
|
{
|
|
|
|
if (*brkpt == '\"')
|
|
|
|
{
|
|
|
|
brkpt++;
|
|
|
|
while (*brkpt != '\0' && (*brkpt != '\"' || *(brkpt-1) == '\\'))
|
|
|
|
brkpt++;
|
|
|
|
}
|
|
|
|
if (*brkpt != '\0')
|
|
|
|
brkpt++;
|
|
|
|
}
|
|
|
|
if (*brkpt == ';')
|
|
|
|
{
|
|
|
|
*brkpt = '\0';
|
|
|
|
more = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
more = 0;
|
|
|
|
}
|
|
|
|
// Intercept wait commands here. Note: wait must be lowercase
|
|
|
|
while (*cmd && *cmd <= ' ')
|
|
|
|
cmd++;
|
|
|
|
if (*cmd)
|
|
|
|
{
|
|
|
|
if (!ParsingKeyConf &&
|
|
|
|
cmd[0] == 'w' && cmd[1] == 'a' && cmd[2] == 'i' && cmd[3] == 't' &&
|
|
|
|
(cmd[4] == 0 || cmd[4] == ' '))
|
|
|
|
{
|
|
|
|
int tics;
|
|
|
|
|
|
|
|
if (cmd[4] == ' ')
|
|
|
|
{
|
|
|
|
tics = strtol (cmd + 5, NULL, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tics = 1;
|
|
|
|
}
|
|
|
|
if (tics > 0)
|
|
|
|
{
|
|
|
|
if (more)
|
|
|
|
{ // The remainder of the command will be executed later
|
|
|
|
// Note that deferred commands lose track of which key
|
|
|
|
// (if any) they were pressed from.
|
|
|
|
*brkpt = ';';
|
|
|
|
new DWaitingCommand (brkpt, tics+1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
C_DoCommand (cmd, keynum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (more)
|
|
|
|
{
|
|
|
|
*brkpt = ';';
|
|
|
|
}
|
|
|
|
cmd = brkpt + more;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ParseCommandLine
|
|
|
|
//
|
|
|
|
// Parse a command line (passed in args). If argc is non-NULL, it will
|
|
|
|
// be set to the number of arguments. If argv is non-NULL, it will be
|
|
|
|
// filled with pointers to each argument; argv[0] should be initialized
|
|
|
|
// to point to a buffer large enough to hold all the arguments. The
|
|
|
|
// return value is the necessary size of this buffer.
|
|
|
|
//
|
|
|
|
// Special processing:
|
|
|
|
// Inside quoted strings, \" becomes just "
|
|
|
|
// \\ becomes just a single backslash
|
|
|
|
// \c becomes just TEXTCOLOR_ESCAPE
|
|
|
|
// $<cvar> is replaced by the contents of <cvar>
|
|
|
|
|
- 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
|
|
|
static long ParseCommandLine (const char *args, int *argc, char **argv, bool no_escapes)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int count;
|
|
|
|
char *buffplace;
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
buffplace = NULL;
|
|
|
|
if (argv != NULL)
|
|
|
|
{
|
|
|
|
buffplace = argv[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
while (*args <= ' ' && *args)
|
|
|
|
{ // skip white space
|
|
|
|
args++;
|
|
|
|
}
|
|
|
|
if (*args == 0)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (*args == '\"')
|
|
|
|
{ // read quoted string
|
|
|
|
char stuff;
|
|
|
|
if (argv != NULL)
|
|
|
|
{
|
|
|
|
argv[count] = buffplace;
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
args++;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
stuff = *args++;
|
- 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 (!no_escapes && stuff == '\\' && *args == '\"')
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
stuff = '\"', args++;
|
|
|
|
}
|
- 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
|
|
|
else if (!no_escapes && stuff == '\\' && *args == '\\')
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
args++;
|
|
|
|
}
|
- 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
|
|
|
else if (!no_escapes && stuff == '\\' && *args == 'c')
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
stuff = TEXTCOLOR_ESCAPE, args++;
|
|
|
|
}
|
|
|
|
else if (stuff == '\"')
|
|
|
|
{
|
|
|
|
stuff = 0;
|
|
|
|
}
|
|
|
|
else if (stuff == 0)
|
|
|
|
{
|
|
|
|
args--;
|
|
|
|
}
|
|
|
|
if (argv != NULL)
|
|
|
|
{
|
|
|
|
*buffplace = stuff;
|
|
|
|
}
|
|
|
|
buffplace++;
|
|
|
|
} while (stuff);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // read unquoted string
|
|
|
|
const char *start = args++, *end;
|
|
|
|
FBaseCVar *var;
|
|
|
|
UCVarValue val;
|
|
|
|
|
|
|
|
while (*args && *args > ' ' && *args != '\"')
|
|
|
|
args++;
|
Update to ZDoom r1585:
- Added ACS GetChar function.
- Added Gez's submission for polyobjects being able to crush corpses but made
it an explicit MAPINFO option only.
- Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were
still triggered.
These #pragmas were responsible for >90% of the GCC warnings that were not
listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
parameter handling of the sound functions for attenuation was changed.
Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values.
Also added the option to specify attenuation with direct values in addition
to the predefined names.
- fixed a few Heretic actors:
* The pod generator's attacksound was wrong
* The teleglitter generators need different flags if they are supposed to work
with z-aware spawning of the glitter.
* The knight's axes need the THRUGHOST flag.
- Fixed non-POD passing in G_BuildSaveName() and other things GCC warned
about.
- Added support for imploded zips.
- Fixed: Some missile spawning functions ignored the FastSpeed setting.
- Fixed: P_CheckSwitchRange tried to access a line's backsector without
checking if it is valid.
- Fixed: Fast projectile could not be frozen by the Time freezer.
- Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight,
SetActivator, SetActivatorToTarget.
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species.
- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC.
- Fixed: The short lump name for embedded files must be cleared so that they
are not found by a normal lump search.
- Added AProp_Notarget actor property.
- Fixed: TraceBleed was missing a NULL pointer check,
- Fixed: P_RandomChaseDir could crash for friendly monsters that belong to
a player which left the game.
- Changed A_PodGrow so that it plays the generator's attack sound instead of
"misc/podgrow".
- Added transference of a select few flags from PowerProtection to its owner.
- Added actor type parameters to A_PodPain() and A_MakePod().
- The savegame path is now passed through NicePath(), since it's user-
specifiable.
- Added save_dir cvar. When non-empty, it controls where savegames go.
- SBARINFO update:
* Added the ability to center things with fullscreenoffsets enabled. Due
to some limitations the syntax is [-]<integer> [+ center].
* Fixed: the translucent flag on drawinventorybar didn't work quite right.
* Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The
fullscreen inventory bar wasn't scaled correctly.
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
- Added more compatibility settings, submitted by Gez.
- Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.
- Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.
- Maps defined with Hexen-style MAPINFOs now run their scripts in the proper
order.
- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before
checking for the end marker. On 32-bit systems, this is -1, but on 64-bit
systems, it is a very large integer that is highly unlikely to be in mapped
memory.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
|
|
|
if (*start == '$' && (var = FindCVarSub (start+1, int(args-start-1))))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
val = var->GetGenericRep (CVAR_String);
|
|
|
|
start = val.String;
|
|
|
|
end = start + strlen (start);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
end = args;
|
|
|
|
}
|
|
|
|
if (argv != NULL)
|
|
|
|
{
|
|
|
|
argv[count] = buffplace;
|
|
|
|
while (start < end)
|
|
|
|
*buffplace++ = *start++;
|
|
|
|
*buffplace++ = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
buffplace += end - start + 1;
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (argc != NULL)
|
|
|
|
{
|
|
|
|
*argc = count;
|
|
|
|
}
|
|
|
|
return (long)(buffplace - (char *)0);
|
|
|
|
}
|
|
|
|
|
- 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
|
|
|
FCommandLine::FCommandLine (const char *commandline, bool no_escapes)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
cmd = commandline;
|
|
|
|
_argc = -1;
|
|
|
|
_argv = NULL;
|
- 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
|
|
|
noescapes = no_escapes;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FCommandLine::~FCommandLine ()
|
|
|
|
{
|
|
|
|
if (_argv != NULL)
|
|
|
|
{
|
|
|
|
delete[] _argv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
- 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
|
|
|
void FCommandLine::Shift()
|
|
|
|
{
|
|
|
|
// Only valid after _argv has been filled.
|
|
|
|
for (int i = 1; i < _argc; ++i)
|
|
|
|
{
|
|
|
|
_argv[i - 1] = _argv[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
int FCommandLine::argc ()
|
|
|
|
{
|
|
|
|
if (_argc == -1)
|
|
|
|
{
|
- 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
|
|
|
argsize = ParseCommandLine (cmd, &_argc, NULL, noescapes);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return _argc;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *FCommandLine::operator[] (int i)
|
|
|
|
{
|
|
|
|
if (_argv == NULL)
|
|
|
|
{
|
|
|
|
int count = argc();
|
|
|
|
_argv = new char *[count + (argsize+sizeof(char*)-1)/sizeof(char*)];
|
|
|
|
_argv[0] = (char *)_argv + count*sizeof(char *);
|
- 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
|
|
|
ParseCommandLine (cmd, NULL, _argv, noescapes);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
return _argv[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
static FConsoleCommand *ScanChainForName (FConsoleCommand *start, const char *name, size_t namelen, FConsoleCommand **prev)
|
|
|
|
{
|
|
|
|
int comp;
|
|
|
|
|
|
|
|
*prev = NULL;
|
|
|
|
while (start)
|
|
|
|
{
|
|
|
|
comp = strnicmp (start->m_Name, name, namelen);
|
|
|
|
if (comp > 0)
|
|
|
|
return NULL;
|
|
|
|
else if (comp == 0 && start->m_Name[namelen] == 0)
|
|
|
|
return start;
|
|
|
|
|
|
|
|
*prev = start;
|
|
|
|
start = start->m_Next;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static FConsoleCommand *FindNameInHashTable (FConsoleCommand **table, const char *name, size_t namelen)
|
|
|
|
{
|
|
|
|
FConsoleCommand *dummy;
|
|
|
|
|
|
|
|
return ScanChainForName (table[MakeKey (name, namelen) % FConsoleCommand::HASH_SIZE], name, namelen, &dummy);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FConsoleCommand::AddToHash (FConsoleCommand **table)
|
|
|
|
{
|
|
|
|
unsigned int key;
|
|
|
|
FConsoleCommand *insert, **bucket;
|
|
|
|
|
|
|
|
key = MakeKey (m_Name);
|
|
|
|
bucket = &table[key % HASH_SIZE];
|
|
|
|
|
|
|
|
if (ScanChainForName (*bucket, m_Name, strlen (m_Name), &insert))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (insert)
|
|
|
|
{
|
|
|
|
m_Next = insert->m_Next;
|
|
|
|
if (m_Next)
|
|
|
|
m_Next->m_Prev = &m_Next;
|
|
|
|
insert->m_Next = this;
|
|
|
|
m_Prev = &insert->m_Next;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Next = *bucket;
|
|
|
|
*bucket = this;
|
|
|
|
m_Prev = bucket;
|
|
|
|
if (m_Next)
|
|
|
|
m_Next->m_Prev = &m_Next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
FConsoleCommand::FConsoleCommand (const char *name, CCmdRun runFunc)
|
|
|
|
: m_RunFunc (runFunc)
|
|
|
|
{
|
|
|
|
static bool firstTime = true;
|
|
|
|
|
|
|
|
if (firstTime)
|
|
|
|
{
|
|
|
|
char tname[16];
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
firstTime = false;
|
|
|
|
|
|
|
|
// Add all the action commands for tab completion
|
|
|
|
for (i = 0; i < NUM_ACTIONS; i++)
|
|
|
|
{
|
|
|
|
strcpy (&tname[1], ActionMaps[i].Name);
|
|
|
|
tname[0] = '+';
|
|
|
|
C_AddTabCommand (tname);
|
|
|
|
tname[0] = '-';
|
|
|
|
C_AddTabCommand (tname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int ag = strcmp (name, "kill");
|
|
|
|
if (ag == 0)
|
|
|
|
ag=0;
|
|
|
|
m_Name = copystring (name);
|
|
|
|
|
|
|
|
if (!AddToHash (Commands))
|
|
|
|
Printf ("FConsoleCommand c'tor: %s exists\n", name);
|
|
|
|
else
|
|
|
|
C_AddTabCommand (name);
|
|
|
|
}
|
|
|
|
|
|
|
|
FConsoleCommand::~FConsoleCommand ()
|
|
|
|
{
|
|
|
|
*m_Prev = m_Next;
|
|
|
|
if (m_Next)
|
|
|
|
m_Next->m_Prev = m_Prev;
|
|
|
|
C_RemoveTabCommand (m_Name);
|
|
|
|
delete[] m_Name;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleCommand::Run (FCommandLine &argv, APlayerPawn *who, int key)
|
|
|
|
{
|
|
|
|
m_RunFunc (argv, who, key);
|
|
|
|
}
|
|
|
|
|
|
|
|
FConsoleAlias::FConsoleAlias (const char *name, const char *command, bool noSave)
|
|
|
|
: FConsoleCommand (name, NULL),
|
|
|
|
bRunning(false), bKill(false)
|
|
|
|
{
|
|
|
|
m_Command[noSave] = command;
|
|
|
|
m_Command[!noSave] = FString();
|
|
|
|
// If the command contains % characters, assume they are parameter markers
|
|
|
|
// for substitution when the command is executed.
|
|
|
|
bDoSubstitution = (strchr (command, '%') != NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
FConsoleAlias::~FConsoleAlias ()
|
|
|
|
{
|
|
|
|
m_Command[1] = m_Command[0] = FString();
|
|
|
|
}
|
|
|
|
|
2013-01-12 14:29:18 +00:00
|
|
|
// Given an argument vector, reconstitute the command line it could have been produced from.
|
- Update to ZDoom r2187:
- Yet another piece of essentially broken code that has to go back in because some people had to abuse it:
Reinstated Doom's original code that made projectiles with the MF_NOCLIP flag set continue to exist even
though the movement itself was never properly handled.
Fortunately the game mode check formerly associated with this can be removed because none of the other games have
any projectiles using MF_NOCLIP so at least it's no longer restricted to Doom...
- The console separator bars now get converted to something printable in Unicode for the log.
- Fixed: Only the last line of multi-line log output received Unicode treatment.
- Add the game log to the crash report. I don't know why I didn't think to do this sooner.
Since we're already sending everything to a rich edit control hidden in the background,
we can just grab its contents for the report.
- Use code page 1252 when previewing text files in the crash dialog.
- Everything on the command line before the first switch with an unrecognized switch is
now added to -file. This was previously restricted to only .wad, .zip, .pk3, and .txt.
- You can now pass -file/-deh/-bex more than once on the command line, and they will all
have effect.
- Changed DArgs to use a TArray of FStrings instead of doing its own string vector management
in preparation for doing GatherFiles the "right" way.
- Fixed: DrawHudText() needs to verify that the character glyph is valid before accessing
its fields.
- V_GetFont() needs to check the font header.
- Added BMF (ByteMap Font) support. This was complicated somewhat by the fact that BMF can
specify a character advance separately from the glyph width. GetChar and GetCharWidth now
return this value in place of the glyph width. (For non-BMF fonts, these should still
return the same values as before.)
- Added A_CheckSightOrRange, with changes.
- Explicitly setting the charset for the EM_SETCHARFORMAT message seems to do what I want.
- Use the Unicode RichEdit control instead of the MBCS version, so as to enforce the use
of code page 1252 for output text. This is noticeable, for example, with the FMOD copyright
notice where the copyright symbol appears as ? (halfwidth katakana small U) with code page 932.
- Change the log window to use DejaVu Sans instead of Bitstream Vera Sans, because
Silverex's X-Chat comes with the former now. Unfortunately, I can't seem to actually
set the font when my system default code page is 932, since it wants to use some Kanji-
compatible font instead. I wonder if I can still use the Unicode RichEdit control with
Windows 9x. (Does it even matter? Windows 9x users make up less than 0.1% of all visitors
to zdoom.org these days.)
- Added -nostartup switch to disable the more graphical startup screens of Heretic, Hexen,
and Strife.
- Pretty sure the minimum FMOD version is 4.22.
- added an option to disable player translations in single player games.
- added a file 'fmod_version.txt' so that the source always comes with the information which FMod version to use.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@743 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-04 10:16:08 +00:00
|
|
|
FString BuildString (int argc, FString *argv)
|
|
|
|
{
|
|
|
|
if (argc == 1)
|
|
|
|
{
|
|
|
|
return *argv;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FString buf;
|
|
|
|
int arg;
|
|
|
|
|
|
|
|
for (arg = 0; arg < argc; arg++)
|
|
|
|
{
|
2013-01-12 14:29:18 +00:00
|
|
|
if (strchr(argv[arg], '"'))
|
|
|
|
{ // If it contains one or more quotes, we need to escape them.
|
|
|
|
buf << '"';
|
|
|
|
long substr_start = 0, quotepos;
|
|
|
|
while ((quotepos = argv[arg].IndexOf('"', substr_start)) >= 0)
|
|
|
|
{
|
|
|
|
if (substr_start < quotepos)
|
|
|
|
{
|
|
|
|
buf << argv[arg].Mid(substr_start, quotepos - substr_start);
|
|
|
|
}
|
|
|
|
buf << "\\\"";
|
|
|
|
substr_start = quotepos + 1;
|
|
|
|
}
|
|
|
|
buf << argv[arg].Mid(substr_start) << "\" ";
|
|
|
|
}
|
|
|
|
else if (strchr(argv[arg], ' '))
|
|
|
|
{ // If it contains a space, it needs to be quoted.
|
- Update to ZDoom r2187:
- Yet another piece of essentially broken code that has to go back in because some people had to abuse it:
Reinstated Doom's original code that made projectiles with the MF_NOCLIP flag set continue to exist even
though the movement itself was never properly handled.
Fortunately the game mode check formerly associated with this can be removed because none of the other games have
any projectiles using MF_NOCLIP so at least it's no longer restricted to Doom...
- The console separator bars now get converted to something printable in Unicode for the log.
- Fixed: Only the last line of multi-line log output received Unicode treatment.
- Add the game log to the crash report. I don't know why I didn't think to do this sooner.
Since we're already sending everything to a rich edit control hidden in the background,
we can just grab its contents for the report.
- Use code page 1252 when previewing text files in the crash dialog.
- Everything on the command line before the first switch with an unrecognized switch is
now added to -file. This was previously restricted to only .wad, .zip, .pk3, and .txt.
- You can now pass -file/-deh/-bex more than once on the command line, and they will all
have effect.
- Changed DArgs to use a TArray of FStrings instead of doing its own string vector management
in preparation for doing GatherFiles the "right" way.
- Fixed: DrawHudText() needs to verify that the character glyph is valid before accessing
its fields.
- V_GetFont() needs to check the font header.
- Added BMF (ByteMap Font) support. This was complicated somewhat by the fact that BMF can
specify a character advance separately from the glyph width. GetChar and GetCharWidth now
return this value in place of the glyph width. (For non-BMF fonts, these should still
return the same values as before.)
- Added A_CheckSightOrRange, with changes.
- Explicitly setting the charset for the EM_SETCHARFORMAT message seems to do what I want.
- Use the Unicode RichEdit control instead of the MBCS version, so as to enforce the use
of code page 1252 for output text. This is noticeable, for example, with the FMOD copyright
notice where the copyright symbol appears as ? (halfwidth katakana small U) with code page 932.
- Change the log window to use DejaVu Sans instead of Bitstream Vera Sans, because
Silverex's X-Chat comes with the former now. Unfortunately, I can't seem to actually
set the font when my system default code page is 932, since it wants to use some Kanji-
compatible font instead. I wonder if I can still use the Unicode RichEdit control with
Windows 9x. (Does it even matter? Windows 9x users make up less than 0.1% of all visitors
to zdoom.org these days.)
- Added -nostartup switch to disable the more graphical startup screens of Heretic, Hexen,
and Strife.
- Pretty sure the minimum FMOD version is 4.22.
- added an option to disable player translations in single player games.
- added a file 'fmod_version.txt' so that the source always comes with the information which FMod version to use.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@743 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-04 10:16:08 +00:00
|
|
|
buf << '"' << argv[arg] << "\" ";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
buf << argv[arg] << ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// SubstituteAliasParams
|
|
|
|
//
|
|
|
|
// Given an command line and a set of arguments, replace instances of
|
|
|
|
// %x or %{x} in the command line with argument x. If argument x does not
|
|
|
|
// exist, then the empty string is substituted in its place.
|
|
|
|
//
|
|
|
|
// Substitution is not done inside of quoted strings.
|
|
|
|
//
|
|
|
|
// To avoid a substitution, use %%. The %% will be replaced by a single %.
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
FString SubstituteAliasParams (FString &command, FCommandLine &args)
|
|
|
|
{
|
|
|
|
// Do substitution by replacing %x with the argument x.
|
|
|
|
// If there is no argument x, then %x is simply removed.
|
|
|
|
|
|
|
|
// For some reason, strtoul's stop parameter is non-const.
|
|
|
|
char *p = command.LockBuffer(), *start = p;
|
|
|
|
unsigned long argnum;
|
|
|
|
FString buf;
|
|
|
|
|
|
|
|
while (*p != '\0')
|
|
|
|
{
|
|
|
|
if (*p == '%' && ((p[1] >= '0' && p[1] <= '9') || p[1] == '{' || p[1] == '%'))
|
|
|
|
{
|
|
|
|
if (p[1] == '%')
|
|
|
|
{
|
|
|
|
// Do not substitute. Just collapse to a single %.
|
|
|
|
buf.AppendCStrPart (start, p - start + 1);
|
|
|
|
start = p = p + 2;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do a substitution. Output what came before this.
|
|
|
|
buf.AppendCStrPart (start, p - start);
|
|
|
|
|
|
|
|
// Extract the argument number and substitute the corresponding argument.
|
|
|
|
argnum = strtoul (p + 1 + (p[1] == '{'), &start, 10);
|
|
|
|
if ((p[1] != '{' || *start == '}') && argnum < (unsigned long)args.argc())
|
|
|
|
{
|
|
|
|
buf += args[argnum];
|
|
|
|
}
|
|
|
|
p = (start += (p[1] == '{' && *start == '}'));
|
|
|
|
}
|
|
|
|
else if (*p == '"')
|
|
|
|
{
|
|
|
|
// Don't substitute inside quoted strings.
|
|
|
|
p++;
|
|
|
|
while (*p != '\0' && (*p != '"' || *(p-1) == '\\'))
|
|
|
|
p++;
|
|
|
|
if (*p != '\0')
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Return whatever was after the final substitution.
|
|
|
|
if (p > start)
|
|
|
|
{
|
|
|
|
buf.AppendCStrPart (start, p - start);
|
|
|
|
}
|
|
|
|
command.UnlockBuffer();
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int DumpHash (FConsoleCommand **table, bool aliases, const char *pattern=NULL)
|
|
|
|
{
|
|
|
|
int bucket, count;
|
|
|
|
FConsoleCommand *cmd;
|
|
|
|
|
|
|
|
for (bucket = count = 0; bucket < FConsoleCommand::HASH_SIZE; bucket++)
|
|
|
|
{
|
|
|
|
cmd = table[bucket];
|
|
|
|
while (cmd)
|
|
|
|
{
|
|
|
|
if (CheckWildcards (pattern, cmd->m_Name))
|
|
|
|
{
|
|
|
|
if (cmd->IsAlias())
|
|
|
|
{
|
|
|
|
if (aliases)
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
static_cast<FConsoleAlias *>(cmd)->PrintAlias ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!aliases)
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
cmd->PrintCommand ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cmd = cmd->m_Next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleAlias::PrintAlias ()
|
|
|
|
{
|
|
|
|
if (m_Command[0])
|
|
|
|
{
|
|
|
|
Printf (TEXTCOLOR_YELLOW "%s : %s\n", m_Name, m_Command[0].GetChars());
|
|
|
|
}
|
|
|
|
if (m_Command[1])
|
|
|
|
{
|
|
|
|
Printf (TEXTCOLOR_ORANGE "%s : %s\n", m_Name, m_Command[1].GetChars());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleAlias::Archive (FConfigFile *f)
|
|
|
|
{
|
|
|
|
if (f != NULL && !m_Command[0].IsEmpty())
|
|
|
|
{
|
|
|
|
f->SetValueForKey ("Name", m_Name, true);
|
|
|
|
f->SetValueForKey ("Command", m_Command[0], true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void C_ArchiveAliases (FConfigFile *f)
|
|
|
|
{
|
|
|
|
int bucket;
|
|
|
|
FConsoleCommand *alias;
|
|
|
|
|
|
|
|
for (bucket = 0; bucket < FConsoleCommand::HASH_SIZE; bucket++)
|
|
|
|
{
|
|
|
|
alias = Commands[bucket];
|
|
|
|
while (alias)
|
|
|
|
{
|
|
|
|
if (alias->IsAlias())
|
|
|
|
static_cast<FConsoleAlias *>(alias)->Archive (f);
|
|
|
|
alias = alias->m_Next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-14 22:53:44 +00:00
|
|
|
void C_ClearAliases ()
|
|
|
|
{
|
|
|
|
int bucket;
|
|
|
|
FConsoleCommand *alias;
|
|
|
|
|
|
|
|
for (bucket = 0; bucket < FConsoleCommand::HASH_SIZE; bucket++)
|
|
|
|
{
|
|
|
|
alias = Commands[bucket];
|
|
|
|
while (alias)
|
|
|
|
{
|
|
|
|
FConsoleCommand *next = alias->m_Next;
|
|
|
|
if (alias->IsAlias())
|
|
|
|
static_cast<FConsoleAlias *>(alias)->SafeDelete();
|
|
|
|
alias = next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD(clearaliases)
|
|
|
|
{
|
|
|
|
C_ClearAliases();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// This is called only by the ini parser.
|
|
|
|
void C_SetAlias (const char *name, const char *cmd)
|
|
|
|
{
|
|
|
|
FConsoleCommand *prev, *alias, **chain;
|
|
|
|
|
|
|
|
chain = &Commands[MakeKey (name) % FConsoleCommand::HASH_SIZE];
|
|
|
|
alias = ScanChainForName (*chain, name, strlen (name), &prev);
|
|
|
|
if (alias != NULL)
|
|
|
|
{
|
|
|
|
if (!alias->IsAlias ())
|
|
|
|
{
|
|
|
|
//Printf (PRINT_BOLD, "%s is a command and cannot be an alias.\n", name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delete alias;
|
|
|
|
}
|
|
|
|
new FConsoleAlias (name, cmd, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (alias)
|
|
|
|
{
|
|
|
|
FConsoleCommand *prev, *alias, **chain;
|
|
|
|
|
|
|
|
if (argv.argc() == 1)
|
|
|
|
{
|
|
|
|
Printf ("Current alias commands:\n");
|
|
|
|
DumpHash (Commands, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
chain = &Commands[MakeKey (argv[1]) % FConsoleCommand::HASH_SIZE];
|
|
|
|
|
|
|
|
if (argv.argc() == 2)
|
|
|
|
{ // Remove the alias
|
|
|
|
|
|
|
|
if ( (alias = ScanChainForName (*chain, argv[1], strlen (argv[1]), &prev)))
|
|
|
|
{
|
|
|
|
if (alias->IsAlias ())
|
|
|
|
{
|
|
|
|
static_cast<FConsoleAlias *> (alias)->SafeDelete ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("%s is a normal command\n", alias->m_Name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Add/change the alias
|
|
|
|
|
|
|
|
alias = ScanChainForName (*chain, argv[1], strlen (argv[1]), &prev);
|
|
|
|
if (alias != NULL)
|
|
|
|
{
|
|
|
|
if (alias->IsAlias ())
|
|
|
|
{
|
|
|
|
static_cast<FConsoleAlias *> (alias)->Realias (argv[2], ParsingKeyConf);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Printf ("%s is a normal command\n", alias->m_Name);
|
|
|
|
alias = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
alias = new FConsoleAlias (argv[1], argv[2], ParsingKeyConf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (cmdlist)
|
|
|
|
{
|
|
|
|
int count;
|
|
|
|
const char *filter = (argv.argc() == 1 ? NULL : argv[1]);
|
|
|
|
|
|
|
|
count = ListActionCommands (filter);
|
|
|
|
count += DumpHash (Commands, false, filter);
|
|
|
|
Printf ("%d commands\n", count);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (key)
|
|
|
|
{
|
|
|
|
if (argv.argc() > 1)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 1; i < argv.argc(); ++i)
|
|
|
|
{
|
|
|
|
unsigned int key = MakeKey (argv[i]);
|
|
|
|
Printf (" 0x%08x\n", key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute any console commands specified on the command line.
|
|
|
|
// These all begin with '+' as opposed to '-'.
|
|
|
|
void C_ExecCmdLineParams ()
|
|
|
|
{
|
2008-03-12 15:21:17 +00:00
|
|
|
for (int currArg = 1; currArg < Args->NumArgs(); )
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-12 15:21:17 +00:00
|
|
|
if (*Args->GetArg (currArg++) == '+')
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
FString cmdString;
|
|
|
|
int cmdlen = 1;
|
|
|
|
int argstart = currArg - 1;
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
while (currArg < Args->NumArgs())
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-12 15:21:17 +00:00
|
|
|
if (*Args->GetArg (currArg) == '-' || *Args->GetArg (currArg) == '+')
|
2008-01-27 11:25:03 +00:00
|
|
|
break;
|
|
|
|
currArg++;
|
|
|
|
cmdlen++;
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
cmdString = BuildString (cmdlen, Args->GetArgList (argstart));
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!cmdString.IsEmpty())
|
|
|
|
{
|
|
|
|
C_DoCommand (&cmdString[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FConsoleCommand::IsAlias ()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FConsoleAlias::IsAlias ()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleAlias::Run (FCommandLine &args, APlayerPawn *who, int key)
|
|
|
|
{
|
|
|
|
if (bRunning)
|
|
|
|
{
|
|
|
|
Printf ("Alias %s tried to recurse.\n", m_Name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int index = !m_Command[1].IsEmpty();
|
|
|
|
FString savedcommand = m_Command[index], mycommand;
|
|
|
|
m_Command[index] = FString();
|
|
|
|
|
|
|
|
if (bDoSubstitution)
|
|
|
|
{
|
|
|
|
mycommand = SubstituteAliasParams (savedcommand, args);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mycommand = savedcommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
bRunning = true;
|
|
|
|
AddCommandString (mycommand.LockBuffer(), key);
|
|
|
|
mycommand.UnlockBuffer();
|
|
|
|
bRunning = false;
|
|
|
|
if (m_Command[index].IsEmpty())
|
|
|
|
{ // The alias is unchanged, so put the command back so it can be used again.
|
|
|
|
// If the command had been non-empty, then that means that executing this
|
|
|
|
// alias caused it to realias itself, so the old command will be forgotten
|
|
|
|
// once this function returns.
|
|
|
|
m_Command[index] = savedcommand;
|
|
|
|
}
|
|
|
|
if (bKill)
|
|
|
|
{ // The alias wants to remove itself
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleAlias::Realias (const char *command, bool noSave)
|
|
|
|
{
|
|
|
|
if (!noSave && !m_Command[1].IsEmpty())
|
|
|
|
{
|
|
|
|
noSave = true;
|
|
|
|
}
|
|
|
|
m_Command[noSave] = command;
|
|
|
|
|
|
|
|
// If the command contains % characters, assume they are parameter markers
|
|
|
|
// for substitution when the command is executed.
|
|
|
|
bDoSubstitution = (strchr (command, '%') != NULL);
|
|
|
|
bKill = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FConsoleAlias::SafeDelete ()
|
|
|
|
{
|
|
|
|
if (!bRunning)
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bKill = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static BYTE PullinBad = 2;
|
|
|
|
static const char *PullinFile;
|
2010-01-01 16:43:08 +00:00
|
|
|
extern TArray<FString> allwads;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
int C_ExecFile (const char *file, bool usePullin)
|
|
|
|
{
|
|
|
|
FILE *f;
|
|
|
|
char cmd[4096];
|
|
|
|
int retval = 0;
|
|
|
|
|
|
|
|
BYTE pullinSaved = PullinBad;
|
|
|
|
const char *fileSaved = PullinFile;
|
|
|
|
|
|
|
|
if ( (f = fopen (file, "r")) )
|
|
|
|
{
|
|
|
|
PullinBad = 1-usePullin;
|
|
|
|
PullinFile = file;
|
|
|
|
|
|
|
|
while (fgets (cmd, 4095, f))
|
|
|
|
{
|
|
|
|
// Comments begin with //
|
|
|
|
char *stop = cmd + strlen (cmd) - 1;
|
|
|
|
char *comment = cmd;
|
|
|
|
int inQuote = 0;
|
|
|
|
|
|
|
|
if (*stop == '\n')
|
|
|
|
*stop-- = 0;
|
|
|
|
|
|
|
|
while (comment < stop)
|
|
|
|
{
|
|
|
|
if (*comment == '\"')
|
|
|
|
{
|
|
|
|
inQuote ^= 1;
|
|
|
|
}
|
|
|
|
else if (!inQuote && *comment == '/' && *(comment + 1) == '/')
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
comment++;
|
|
|
|
}
|
|
|
|
if (comment == cmd)
|
|
|
|
{ // Comment at line beginning
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else if (comment < stop)
|
|
|
|
{ // Comment in middle of line
|
|
|
|
*comment = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
AddCommandString (cmd);
|
|
|
|
}
|
|
|
|
if (!feof (f))
|
|
|
|
{
|
|
|
|
retval = 2;
|
|
|
|
}
|
|
|
|
fclose (f);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
retval = 1;
|
|
|
|
}
|
|
|
|
PullinBad = pullinSaved;
|
|
|
|
PullinFile = fileSaved;
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
CCMD (pullin)
|
|
|
|
{
|
|
|
|
if (PullinBad == 2)
|
|
|
|
{
|
|
|
|
Printf ("This command is only valid from .cfg\n"
|
|
|
|
"files and only when used at startup.\n");
|
|
|
|
}
|
|
|
|
else if (argv.argc() > 1)
|
|
|
|
{
|
|
|
|
const char *lastSlash;
|
|
|
|
|
|
|
|
#ifdef unix
|
|
|
|
lastSlash = strrchr (PullinFile, '/');
|
|
|
|
#else
|
|
|
|
const char *lastSlash1, *lastSlash2;
|
|
|
|
|
|
|
|
lastSlash1 = strrchr (PullinFile, '/');
|
|
|
|
lastSlash2 = strrchr (PullinFile, '\\');
|
|
|
|
lastSlash = MAX (lastSlash1, lastSlash2);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (PullinBad)
|
|
|
|
{
|
|
|
|
Printf ("Not loading:");
|
|
|
|
}
|
|
|
|
for (int i = 1; i < argv.argc(); ++i)
|
|
|
|
{
|
|
|
|
if (PullinBad)
|
|
|
|
{
|
|
|
|
Printf (" %s", argv[i]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Try looking for the wad in the same directory as the .cfg
|
|
|
|
// before looking for it in the current directory.
|
|
|
|
char *path = argv[i];
|
|
|
|
|
|
|
|
if (lastSlash != NULL)
|
|
|
|
{
|
|
|
|
size_t pathlen = lastSlash - PullinFile + strlen (argv[i]) + 2;
|
|
|
|
path = new char[pathlen];
|
|
|
|
strncpy (path, PullinFile, (lastSlash - PullinFile) + 1);
|
|
|
|
strcpy (path + (lastSlash - PullinFile) + 1, argv[i]);
|
|
|
|
if (!FileExists (path))
|
|
|
|
{
|
|
|
|
delete[] path;
|
|
|
|
path = argv[i];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FixPathSeperator (path);
|
|
|
|
}
|
|
|
|
}
|
2010-01-01 16:43:08 +00:00
|
|
|
D_AddFile (allwads, path);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (path != argv[i])
|
|
|
|
{
|
|
|
|
delete[] path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (PullinBad)
|
|
|
|
{
|
|
|
|
Printf ("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|