gzdoom-last-svn/src/p_acs.cpp

7961 lines
185 KiB
C++
Raw Normal View History

/*
** p_acs.cpp
** General BEHAVIOR management and ACS execution environment
**
**---------------------------------------------------------------------------
* Updated to ZDoom r3370: - Fixed: Forgot to initialize inventoryItem to NULL in DrawBar. - Fixed: Runtime error on Mac OS X. For whatever reason merely having the call to CFUserNotificationDisplayAlert() in I_FatalError caused exception handling to quit working. Moving it to a separate file seems to fix this. Also removed the warning about FRenderer having a non-virtual destructor. - Added pukename console command. This is mostly the same as puke, except the scripts are named, and to run a script using ACS_ExecuteAlways, you need to add "always" after the script name but before any arguments. e.g.: « pukename "A Script" 1 » will run the script "A Script" with a single argument of 1, provided the script is not already running. « pukename "A Script" always 1 » Will always run the script "A Script" with a single argument of 1. - Added action functions that work with script names instead of script numbers. They are named the same as their ACS function equivalents. e.g. From DECORATE, you can now use ACS_NamedExecuteAlways to run a script with a name. - Make deferred scripts work with named scripts. - Added ACS_Named* function variants of the ACS_* specials that take script names instead of numbers. As these are functions and not specials, they can only be used from inside ACS. - Fixed: Mac universal binary build. (I actually just realized that my DRDTeam build script ended up just working because of this modification.) - Allow any parameterized SBarInfo value to use parentheses to help make the syntax a little more consistent. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1285 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:26:03 +00:00
** Copyright 1998-2012 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.
**---------------------------------------------------------------------------
**
** This code at one time made lots of little-endian assumptions.
Update to ZDoom r1312: - Fixed: The save percentage for Doom's green armor was slightly too low which caused roundoff errors that made it less than 1/3 effective. - Added support for "RRGGBB" strings to V_GetColor. - Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly. - Changed GetSpriteIndex to cache the last used sprite name so that the code using this function doesn't have to do it itself. - Moved some more code for the state parser into p_states.cpp. - Fixed: TDeletingArray should not try to delete NULL pointers. - Added binary (b) and hexadecimal (x) cast types for ACS's various print statements. - Added ClassifyActor(tid) ACS builtin function. This takes a TID and returns a set of bits describing the actor. If TID is 0, it returns information about the activator. If there is more than one actor with the given TID, only the first one is considered. Currently defined bits are: ACTOR_NONE No actors with this TID exist (only when TID is not 0). ACTOR_WORLD Activator is the world (only when TID is 0). ACTOR_PLAYER Actor is a player (includes bots and voodoo dolls). ACTOR_BOT Actor is a bot. ACTOR_VOODOODOLL Actor is a voodoo doll. ACTOR_MONSTER Actor is a monster. ACTOR_ALIVE Actor is alive (players/monsters only). ACTOR_DEAD Actor is dead (players/monsters only). ACTOR_MISSILE Actor is a missile. ACTOR_GENERIC Actor exists, but no further information is available. - Moved ExpandEnvVars() from d_main.cpp to cmdlib.cpp. - AutoExec paths now support the same variable expansion as the search paths. Additionally, on Windows, the default autoexec path is now relative to $PROGDIR, rather than using a fixed path to the executable's current directory. - All usable Autoload and AutoExec sections are now created at the top of the config file along with some brief explanatory notes so they are readily visible to anyone who wants to edit them. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@254 b0f79afe-0144-0410-b225-9a4edf0717df
2008-12-07 16:38:02 +00:00
** I think it should be fine on big-endian machines now, but I have no
** real way to test it.
*/
#include <assert.h>
#include "templates.h"
#include "doomdef.h"
#include "p_local.h"
#include "p_spec.h"
#include "g_level.h"
#include "s_sound.h"
#include "p_acs.h"
#include "p_saveg.h"
#include "p_lnspec.h"
#include "m_random.h"
#include "doomstat.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "s_sndseq.h"
#include "i_system.h"
#include "i_movie.h"
#include "sbar.h"
#include "m_swap.h"
#include "a_sharedglobal.h"
#include "a_doomglobal.h"
#include "a_strifeglobal.h"
#include "v_video.h"
#include "w_wad.h"
#include "r_sky.h"
#include "gstrings.h"
#include "gi.h"
#include "sc_man.h"
#include "c_bind.h"
#include "info.h"
#include "r_data/r_translate.h"
#include "cmdlib.h"
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
#include "m_png.h"
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
#include "p_setup.h"
#include "po_man.h"
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
#include "actorptrselect.h"
#include "farchive.h"
#include "g_shared/a_pickups.h"
extern FILE *Logfile;
FRandom pr_acs ("ACS");
// I imagine this much stack space is probably overkill, but it could
// potentially get used with recursive functions.
#define STACK_SIZE 4096
#define CLAMPCOLOR(c) (EColorRange)((unsigned)(c) >= NUM_TEXT_COLORS ? CR_UNTRANSLATED : (c))
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
#define LANGREGIONMASK MAKE_ID(0,0,0xff,0xff)
// HUD message flags
#define HUDMSG_LOG (0x80000000)
#define HUDMSG_COLORSTRING (0x40000000)
#define HUDMSG_ADDBLEND (0x20000000)
#define HUDMSG_ALPHA (0x10000000)
#define HUDMSG_NOWRAP (0x08000000)
// HUD message layers; these are not flags
#define HUDMSG_LAYER_SHIFT 12
#define HUDMSG_LAYER_MASK (0x0000F000)
// See HUDMSGLayer enumerations in sbar.h
// HUD message visibility flags
#define HUDMSG_VISIBILITY_SHIFT 16
#define HUDMSG_VISIBILITY_MASK (0x00070000)
// See HUDMSG visibility enumerations in sbar.h
// Flags for ReplaceTextures
#define NOT_BOTTOM 1
#define NOT_MIDDLE 2
#define NOT_TOP 4
#define NOT_FLOOR 8
#define NOT_CEILING 16
struct CallReturn
{
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, bool discard, unsigned int runaway)
: ReturnFunction(func),
ReturnModule(module),
ReturnLocals(locals),
ReturnAddress(pc),
bDiscardResult(discard),
EntryInstrCount(runaway)
{}
ScriptFunction *ReturnFunction;
FBehavior *ReturnModule;
SDWORD *ReturnLocals;
int ReturnAddress;
int bDiscardResult;
unsigned int EntryInstrCount;
};
static DLevelScript *P_GetScriptGoing (AActor *who, line_t *where, int num, const ScriptPtr *code, FBehavior *module,
const int *args, int argcount, int flags);
struct FBehavior::ArrayInfo
{
DWORD ArraySize;
SDWORD *Elements;
};
TArray<FBehavior *> FBehavior::StaticModules;
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
//============================================================================
//
// Global and world variables
//
//============================================================================
// ACS variables with world scope
SDWORD ACS_WorldVars[NUM_WORLDVARS];
FWorldGlobalArray ACS_WorldArrays[NUM_WORLDVARS];
// ACS variables with global scope
SDWORD ACS_GlobalVars[NUM_GLOBALVARS];
FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS];
//============================================================================
//
// On the fly strings
//
//============================================================================
#define LIB_ACSSTRINGS_ONTHEFLY 0x7fff
#define ACSSTRING_OR_ONTHEFLY (LIB_ACSSTRINGS_ONTHEFLY<<16)
TArray<FString>
ACS_StringsOnTheFly,
ACS_StringBuilderStack;
#define STRINGBUILDER_START(Builder) if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) { ACS_StringBuilderStack.Push(Builder); Builder = ""; }
#define STRINGBUILDER_FINISH(Builder) if (!ACS_StringBuilderStack.Pop(Builder)) { Builder = ""; }
//============================================================================
//
// uallong
//
// Read a possibly unaligned four-byte little endian integer from memory.
//
//============================================================================
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__)
inline int uallong(const int &foo)
{
return foo;
}
#else
inline int uallong(const int &foo)
{
const unsigned char *bar = (const unsigned char *)&foo;
return bar[0] | (bar[1] << 8) | (bar[2] << 16) | (bar[3] << 24);
}
#endif
//============================================================================
//
// ScriptPresentation
//
// Returns a presentable version of the script number.
//
//============================================================================
static FString ScriptPresentation(int script)
{
FString out = "script ";
if (script < 0)
{
FName scrname = FName(ENamedName(-script));
if (scrname.IsValidName())
{
out << '"' << scrname.GetChars() << '"';
return out;
}
}
out.AppendFormat("%d", script);
return out;
}
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
//============================================================================
//
//
//
//============================================================================
void P_ClearACSVars(bool alsoglobal)
{
int i;
memset (ACS_WorldVars, 0, sizeof(ACS_WorldVars));
for (i = 0; i < NUM_WORLDVARS; ++i)
{
ACS_WorldArrays[i].Clear ();
}
if (alsoglobal)
{
memset (ACS_GlobalVars, 0, sizeof(ACS_GlobalVars));
for (i = 0; i < NUM_GLOBALVARS; ++i)
{
ACS_GlobalArrays[i].Clear ();
}
}
}
//============================================================================
//
//
//
//============================================================================
static void WriteVars (FILE *file, SDWORD *vars, size_t count, DWORD id)
{
size_t i, j;
for (i = 0; i < count; ++i)
{
if (vars[i] != 0)
break;
}
if (i < count)
{
// Find last non-zero var. Anything beyond the last stored variable
// will be zeroed at load time.
for (j = count-1; j > i; --j)
{
if (vars[j] != 0)
break;
}
FPNGChunkArchive arc (file, id);
for (i = 0; i <= j; ++i)
{
DWORD var = vars[i];
arc << var;
}
}
}
//============================================================================
//
//
//
//============================================================================
static void ReadVars (PNGHandle *png, SDWORD *vars, size_t count, DWORD id)
{
size_t len = M_FindPNGChunk (png, id);
size_t used = 0;
if (len != 0)
{
DWORD var;
size_t i;
FPNGChunkArchive arc (png->File->GetFile(), id, len);
used = len / 4;
for (i = 0; i < used; ++i)
{
arc << var;
vars[i] = var;
}
png->File->ResetFilePtr();
}
if (used < count)
{
memset (&vars[used], 0, (count-used)*4);
}
}
//============================================================================
//
//
//
//============================================================================
static void WriteArrayVars (FILE *file, FWorldGlobalArray *vars, unsigned int count, DWORD id)
{
unsigned int i, j;
// Find the first non-empty array.
for (i = 0; i < count; ++i)
{
if (vars[i].CountUsed() != 0)
break;
}
if (i < count)
{
// Find last non-empty array. Anything beyond the last stored array
// will be emptied at load time.
for (j = count-1; j > i; --j)
{
if (vars[j].CountUsed() != 0)
break;
}
FPNGChunkArchive arc (file, id);
arc.WriteCount (i);
arc.WriteCount (j);
for (; i <= j; ++i)
{
arc.WriteCount (vars[i].CountUsed());
FWorldGlobalArray::ConstIterator it(vars[i]);
const FWorldGlobalArray::Pair *pair;
while (it.NextPair (pair))
{
arc.WriteCount (pair->Key);
arc.WriteCount (pair->Value);
}
}
}
}
//============================================================================
//
//
//
//============================================================================
static void ReadArrayVars (PNGHandle *png, FWorldGlobalArray *vars, size_t count, DWORD id)
{
size_t len = M_FindPNGChunk (png, id);
unsigned int i, k;
for (i = 0; i < count; ++i)
{
vars[i].Clear ();
}
if (len != 0)
{
DWORD max, size;
FPNGChunkArchive arc (png->File->GetFile(), id, len);
i = arc.ReadCount ();
max = arc.ReadCount ();
for (; i <= max; ++i)
{
size = arc.ReadCount ();
for (k = 0; k < size; ++k)
{
SDWORD key, val;
key = arc.ReadCount();
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
val = arc.ReadCount();
vars[i].Insert (key, val);
}
}
png->File->ResetFilePtr();
}
}
//============================================================================
//
//
//
//============================================================================
void P_ReadACSVars(PNGHandle *png)
{
ReadVars (png, ACS_WorldVars, NUM_WORLDVARS, MAKE_ID('w','v','A','r'));
ReadVars (png, ACS_GlobalVars, NUM_GLOBALVARS, MAKE_ID('g','v','A','r'));
ReadArrayVars (png, ACS_WorldArrays, NUM_WORLDVARS, MAKE_ID('w','a','R','r'));
ReadArrayVars (png, ACS_GlobalArrays, NUM_GLOBALVARS, MAKE_ID('g','a','R','r'));
}
//============================================================================
//
//
//
//============================================================================
void P_WriteACSVars(FILE *stdfile)
{
WriteVars (stdfile, ACS_WorldVars, NUM_WORLDVARS, MAKE_ID('w','v','A','r'));
WriteVars (stdfile, ACS_GlobalVars, NUM_GLOBALVARS, MAKE_ID('g','v','A','r'));
WriteArrayVars (stdfile, ACS_WorldArrays, NUM_WORLDVARS, MAKE_ID('w','a','R','r'));
WriteArrayVars (stdfile, ACS_GlobalArrays, NUM_GLOBALVARS, MAKE_ID('g','a','R','r'));
}
//---- Inventory functions --------------------------------------//
//
//============================================================================
//
// ClearInventory
//
// Clears the inventory for one or more actors.
//
//============================================================================
static void ClearInventory (AActor *activator)
{
if (activator == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
players[i].mo->ClearInventory();
}
}
else
{
activator->ClearInventory();
}
}
//============================================================================
//
// DoGiveInv
//
// Gives an item to a single actor.
//
//============================================================================
static void DoGiveInv (AActor *actor, const PClass *info, int amount)
{
AWeapon *savedPendingWeap = actor->player != NULL
? actor->player->PendingWeapon : NULL;
bool hadweap = actor->player != NULL ? actor->player->ReadyWeapon != NULL : true;
AInventory *item = static_cast<AInventory *>(Spawn (info, 0,0,0, NO_REPLACE));
// This shouldn't count for the item statistics!
* Updated to ZDoom r2831: - Fixed: The DUMB specific options should be grayed out when using FMod for playing back modules. - Fixed: The newly accelerated mousewheel scrolling code did not check for the end of the list and could scroll one item too far. It also incremented VisBottom by 3 instead of 2. - changed lock failsound lookup so that for each sound it tries to resolve it as a player sound before deciding if it is valid. - Fixed: FOptionMenuItemJoyMap::SetSelection() did not convert from menu selection number to joyaxis number. - Scroll two rows at a time with the mouse wheel in the options menu. - Remove extra *usefail definition for the pig player. - Locks can now define more than one LockedSound by separating them with commas. The default setting for this property is now "*keytry", "misc/keytry". The first sound that is defined is the one that will be played for the lock. Thus, for standard locks, if the player class defines *keytry, that will be played. Otherwise, misc/keytry will be played as before. - Added a ClearCounters function to AActor that handles everything necessary to un-count an item that is not supposed to be counted but has some of the COUNT* flags set. - Merged all places where secrets are credited into one common function. - Added the Doom64 COUNTSECRET actor flag. - Fixed: AInventory::CreateCopy did not clear the COUNTITEM flag. - Fixed: Dropping an item did not increase the item count but the dropped item could still have the COUNTITEM flag. Now this flag gets cleared when the item gets picked up so that dropped items don't count a second time. - Merged Thing_Destroy extension from Doom64 branch into trunk and extended it by a tid=0, tag!=0 case which will kill all shootable actors in sectors with the specified tag. - Fixed: Compilation errors on Mac OS X. - Fixed Linux compilation issue with statistics.cpp - Resurrected some old statistics code I had and made some minor enhancements to be of more use. - Fixed: The subsector serializing code accessed the subsector array before validating the index. - Added episode names to episode definitions of Doom 1 and Chex Quest. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@979 b0f79afe-0144-0410-b225-9a4edf0717df
2010-09-19 08:00:43 +00:00
item->ClearCounters();
if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup)))
{
if (static_cast<ABasicArmorPickup*>(item)->SaveAmount != 0)
{
static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
}
else
{
static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
}
}
else if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus)))
{
static_cast<ABasicArmorBonus*>(item)->SaveAmount *= amount;
}
else
{
item->Amount = amount;
}
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
if (!item->CallTryPickup (actor))
{
item->Destroy ();
}
// If the item was a weapon, don't bring it up automatically
// unless the player was not already using a weapon.
Update to ZDoom r1418: - Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-08 23:01:13 +00:00
if (savedPendingWeap != NULL && hadweap && actor->player != NULL)
{
actor->player->PendingWeapon = savedPendingWeap;
}
}
//============================================================================
//
// GiveInventory
//
// Gives an item to one or more actors.
//
//============================================================================
static void GiveInventory (AActor *activator, const char *type, int amount)
{
const PClass *info;
if (amount <= 0 || type == NULL)
{
return;
}
if (stricmp (type, "Armor") == 0)
{
type = "BasicArmorPickup";
}
info = PClass::FindClass (type);
if (info == NULL)
{
Printf ("ACS: I don't know what %s is.\n", type);
}
else if (!info->IsDescendantOf (RUNTIME_CLASS(AInventory)))
{
Printf ("ACS: %s is not an inventory item.\n", type);
}
else if (activator == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
DoGiveInv (players[i].mo, info, amount);
}
}
else
{
DoGiveInv (activator, info, amount);
}
}
//============================================================================
//
// DoTakeInv
//
// Takes an item from a single actor.
//
//============================================================================
static void DoTakeInv (AActor *actor, const PClass *info, int amount)
{
AInventory *item = actor->FindInventory (info);
if (item != NULL)
{
item->Amount -= amount;
if (item->Amount <= 0)
{
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
// If it's not ammo or an internal armor, destroy it.
// Ammo needs to stick around, even when it's zero for the benefit
// of the weapons that use it and to maintain the maximum ammo
// amounts a backpack might have given.
// Armor shouldn't be removed because they only work properly when
// they are the last items in the inventory.
if (item->ItemFlags & IF_KEEPDEPLETED)
{
item->Amount = 0;
}
else
{
item->Destroy ();
}
}
}
}
//============================================================================
//
// TakeInventory
//
// Takes an item from one or more actors.
//
//============================================================================
static void TakeInventory (AActor *activator, const char *type, int amount)
{
const PClass *info;
if (type == NULL)
{
return;
}
if (strcmp (type, "Armor") == 0)
{
type = "BasicArmor";
}
if (amount <= 0)
{
return;
}
info = PClass::FindClass (type);
if (info == NULL)
{
return;
}
if (activator == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
DoTakeInv (players[i].mo, info, amount);
}
}
else
{
DoTakeInv (activator, info, amount);
}
}
//============================================================================
//
// DoUseInv
//
// Makes a single actor use an inventory item
//
//============================================================================
static bool DoUseInv (AActor *actor, const PClass *info)
{
AInventory *item = actor->FindInventory (info);
if (item != NULL)
{
if (actor->player == NULL)
{
return actor->UseInventory(item);
}
else
{
int cheats;
bool res;
// Bypass CF_TOTALLYFROZEN
cheats = actor->player->cheats;
actor->player->cheats &= ~CF_TOTALLYFROZEN;
res = actor->UseInventory(item);
actor->player->cheats |= (cheats & CF_TOTALLYFROZEN);
return res;
}
}
return false;
}
//============================================================================
//
// UseInventory
//
// makes one or more actors use an inventory item.
//
//============================================================================
static int UseInventory (AActor *activator, const char *type)
{
const PClass *info;
int ret = 0;
if (type == NULL)
{
return 0;
}
info = PClass::FindClass (type);
if (info == NULL)
{
return 0;
}
if (activator == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
ret += DoUseInv (players[i].mo, info);
}
}
else
{
ret = DoUseInv (activator, info);
}
return ret;
}
//============================================================================
//
// CheckInventory
//
// Returns how much of a particular item an actor has.
//
//============================================================================
static int CheckInventory (AActor *activator, const char *type)
{
if (activator == NULL || type == NULL)
return 0;
if (stricmp (type, "Armor") == 0)
{
type = "BasicArmor";
}
else if (stricmp (type, "Health") == 0)
{
return activator->health;
}
const PClass *info = PClass::FindClass (type);
AInventory *item = activator->FindInventory (info);
return item ? item->Amount : 0;
}
//---- Plane watchers ----//
class DPlaneWatcher : public DThinker
{
DECLARE_CLASS (DPlaneWatcher, DThinker)
HAS_OBJECT_POINTERS
public:
DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling,
int tag, int height, int special,
int arg0, int arg1, int arg2, int arg3, int arg4);
void Tick ();
void Serialize (FArchive &arc);
private:
sector_t *Sector;
fixed_t WatchD, LastD;
int Special, Arg0, Arg1, Arg2, Arg3, Arg4;
TObjPtr<AActor> Activator;
line_t *Line;
bool LineSide;
bool bCeiling;
DPlaneWatcher() {}
};
IMPLEMENT_POINTY_CLASS (DPlaneWatcher)
DECLARE_POINTER (Activator)
END_POINTERS
DPlaneWatcher::DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling,
int tag, int height, int special,
int arg0, int arg1, int arg2, int arg3, int arg4)
: Special (special), Arg0 (arg0), Arg1 (arg1), Arg2 (arg2), Arg3 (arg3), Arg4 (arg4),
Activator (it), Line (line), LineSide (!!lineSide), bCeiling (ceiling)
{
int secnum;
secnum = P_FindSectorFromTag (tag, -1);
if (secnum >= 0)
{
secplane_t plane;
Sector = &sectors[secnum];
if (bCeiling)
{
plane = Sector->ceilingplane;
}
else
{
plane = Sector->floorplane;
}
LastD = plane.d;
plane.ChangeHeight (height << FRACBITS);
WatchD = plane.d;
}
else
{
Sector = NULL;
WatchD = LastD = 0;
}
}
void DPlaneWatcher::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << Special << Arg0 << Arg1 << Arg2 << Arg3 << Arg4
<< Sector << bCeiling << WatchD << LastD << Activator
<< Line << LineSide << bCeiling;
}
void DPlaneWatcher::Tick ()
{
if (Sector == NULL)
{
Destroy ();
return;
}
fixed_t newd;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
if (bCeiling)
{
newd = Sector->ceilingplane.d;
}
else
{
newd = Sector->floorplane.d;
}
if ((LastD < WatchD && newd >= WatchD) ||
(LastD > WatchD && newd <= WatchD))
{
P_ExecuteSpecial(Special, Line, Activator, LineSide, Arg0, Arg1, Arg2, Arg3, Arg4);
Destroy ();
}
}
//---- ACS lump manager ----//
// Load user-specified default modules. This must be called after the level's
// own behavior is loaded (if it has one).
void FBehavior::StaticLoadDefaultModules ()
{
// When playing Strife, STRFHELP is always loaded.
if (gameinfo.gametype == GAME_Strife)
{
StaticLoadModule (Wads.CheckNumForName ("STRFHELP", ns_acslibrary));
}
// Scan each LOADACS lump and load the specified modules in order
int lump, lastlump = 0;
while ((lump = Wads.FindLump ("LOADACS", &lastlump)) != -1)
{
- Fixed: The players were not added to FS's list of spawned things. - Update to ZDoom r882 - Added the option to use $ as a prefix to a string table name everywhere in MAPINFO where 'lookup' could be specified so that there is one consistent way to do it. - Externalized all default episode definitions. Added an 'optional' keyword to handle M4 and 5 in Doom and Heretic. - Added P_CheckMapData function and replaced all calls to P_OpenMapData that only checked for a map's presence with it. - Added Martin Howe's player statusbar face submission. - Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap' but keeps all existing information in the default and just adds to it. This is needed because Hexen and Strife set some information in their base MAPINFO and using 'defaultmap' in a PWAD would override that. - Fixed: Using MAPINFO's f1 option could cause memory leaks. - Added option to load lumps by full name to several places: * Finale texts loaded from a text lump * Demos * Local SNDINFOs * Local SNDSEQs * Image names in FONTDEFS * intermission script names - Changed the STCFN121 handling. The character is not an 'I' but a '|' so instead of discarding it it should be inserted at position 124. - Renamed indexfont.fon to indexfont so that I could remove a special case from V_GetFont that was just added for this one font. - Added a 'dumpspawnedthings' CVAR that enables a listing of all things in the map and the actor type they spawned. SBarInfo Update #16 - Added: fillzeros flag for drawnumber. When set the string will always have a length of the specified size and zeros will fill in for the missing places. If the number is negative the negative sign will take the place of the last digit. - Added: globalarray type to drawnumber which will display the value in a global array with the index set to the player's number. Untested. - Added: isselected command to SBarInfo. - Fixed: Bi and Tri colored numbers didn't work. - Fixed: Crash when using nullimage as the last image in drawswitchableimage. - Applied Graf suggestion to include the y coord when calulating heights to fix most of the gaps caused by round off errors. At least for now anyways and it is only applied for drawimage. - SBarInfo inventory bars have been converted to use screen->DrawTexture() - Increased limit for demon/melee to 4. - Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided line. - Fixed: P_SpawnPuff assumed that all melee attacks have the same range (MELEERANGE) and didn't set the puff to its melee state if the range was different. Even worse, it checked a global variable for this so the behavior was undefined when P_SpawnPuff was called from anywhere else but P_LineAttack. To reduce the amount of parameters I combined this information with the hitthing and temporary parameters into one flags parameter. Also changed P_LineAttack so that it gets passed an additional parameter that specifies whether the attack is a melee attack or not and set this to true in all calls that are to be considered melee attacks. I couldn't use the damage type because A_CustomPunch and A_CustomMeleeAttack allow passing any damage type they want. - Added a sprite option as an alternative of particles for FX_ROCKET and FX_GRENADE. - Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for DECORATE was wrong (2 instead of 1.) - Changed: Hexen set every cluster to be a hub if it hadn't been defined before a level using this cluster. Now it will only do that if HexenHack is true, i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format MAPINFOs it will now be the same as for the other games which means that 'hub' has to be declared explicitly. - Added an Idle state that is entered in place of the spawn state if a monster has to return to its inactive state if it can't find any more targets. - Added MF5_NOINTERACTION flag which completely disables all physics related code for any actor with this flag. Mostly useful for particle effects where the actors just move a certain distance and then disappear. - Removed the last remains of the antialias precalculation code from am_map.cpp because it was no longer used. - Fixed: Two-sided lines bordering a secret sector were not drawn in the proper color - Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color. - Switched sounds local to the listener from head-relative 3D sounds to 2D sounds so stereo sounds have full separation. I tried using set3DSpread, but that still caused some blending of the channels. - Changed FScanner so that opening a lump gives the complete wad+lump name rather than a generic one, so identifying errors among files that all have the same lump name no longer involves any degree of guesswork in determining exactly which file the error occurred in. - Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final sequences. - Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL pointer checks, in case an improper sequence was encountered during parsing but not early enough to avoid creating a slot for it in the array. - Added support for dumping from RAW/DRO/IMF files, so now anything that can be played as OPL can also be dumped. - Removed the opl_enable cvar, since OPL playback is now selectable as just another MIDI device. - Added support for DRO playback and dual-chip RAW playback. - Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with MUSSong2 works just as well. There are still lots of leftover bits in the class that should probably be removed at some point, too. - Added dual-chip dumping support for the RAW format. - Added DosBox Raw OPL (.DRO) dumping support. For whatever reason, in_adlib calculates the song length for this format wrong, even though the exact length is stored right in the header. (But in_adlib seems buggy in general; too bad it's the only Windows version of Adplug that seems to exist.) - Rewrote the OPL dumper to work with MIDI as well as MUS. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@86 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-05 13:28:48 +00:00
FScanner sc(lump);
while (sc.GetString())
{
int acslump = Wads.CheckNumForName (sc.String, ns_acslibrary);
if (acslump >= 0)
{
StaticLoadModule (acslump);
}
else
{
Printf ("Could not find autoloaded ACS library %s\n", sc.String);
}
}
}
}
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
FBehavior *FBehavior::StaticLoadModule (int lumpnum, FileReader *fr, int len)
{
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
if (lumpnum == -1 && fr == NULL) return NULL;
for (unsigned int i = 0; i < StaticModules.Size(); ++i)
{
if (StaticModules[i]->LumpNum == lumpnum)
{
return StaticModules[i];
}
}
return new FBehavior (lumpnum, fr, len);
}
bool FBehavior::StaticCheckAllGood ()
{
for (unsigned int i = 0; i < StaticModules.Size(); ++i)
{
if (!StaticModules[i]->IsGood())
{
return false;
}
}
return true;
}
void FBehavior::StaticUnloadModules ()
{
for (unsigned int i = StaticModules.Size(); i-- > 0; )
{
delete StaticModules[i];
}
StaticModules.Clear ();
}
FBehavior *FBehavior::StaticGetModule (int lib)
{
if ((size_t)lib >= StaticModules.Size())
{
return NULL;
}
return StaticModules[lib];
}
void FBehavior::StaticSerializeModuleStates (FArchive &arc)
{
DWORD modnum;
modnum = StaticModules.Size();
arc << modnum;
if (modnum != StaticModules.Size())
{
I_Error ("Level was saved with a different number of ACS modules.");
}
for (modnum = 0; modnum < StaticModules.Size(); ++modnum)
{
FBehavior *module = StaticModules[modnum];
if (arc.IsStoring())
{
arc.WriteString (module->ModuleName);
}
else
{
char *modname = NULL;
arc << modname;
if (stricmp (modname, module->ModuleName) != 0)
{
delete[] modname;
I_Error ("Level was saved with a different set of ACS modules.");
}
delete[] modname;
}
module->SerializeVars (arc);
}
}
void FBehavior::SerializeVars (FArchive &arc)
{
SerializeVarSet (arc, MapVarStore, NUM_MAPVARS);
for (int i = 0; i < NumArrays; ++i)
{
SerializeVarSet (arc, ArrayStore[i].Elements, ArrayStore[i].ArraySize);
}
}
void FBehavior::SerializeVarSet (FArchive &arc, SDWORD *vars, int max)
{
SDWORD arcval;
SDWORD first, last;
if (arc.IsStoring ())
{
// Find first non-zero variable
for (first = 0; first < max; ++first)
{
if (vars[first] != 0)
{
break;
}
}
// Find last non-zero variable
for (last = max - 1; last >= first; --last)
{
if (vars[last] != 0)
{
break;
}
}
if (last < first)
{ // no non-zero variables
arcval = 0;
arc << arcval;
return;
}
arcval = last - first + 1;
arc << arcval;
arcval = first;
arc << arcval;
while (first <= last)
{
arc << vars[first];
++first;
}
}
else
{
SDWORD truelast;
memset (vars, 0, max*sizeof(*vars));
arc << last;
if (last == 0)
{
return;
}
arc << first;
last += first;
truelast = last;
if (last > max)
{
last = max;
}
while (first < last)
{
arc << vars[first];
++first;
}
while (first < truelast)
{
arc << arcval;
++first;
}
}
}
FBehavior::FBehavior (int lumpnum, FileReader * fr, int len)
{
BYTE *object;
int i;
NumScripts = 0;
NumFunctions = 0;
NumArrays = 0;
NumTotalArrays = 0;
Scripts = NULL;
Functions = NULL;
Arrays = NULL;
ArrayStore = NULL;
Chunks = NULL;
Data = NULL;
Format = ACS_Unknown;
LumpNum = lumpnum;
memset (MapVarStore, 0, sizeof(MapVarStore));
ModuleName[0] = 0;
FunctionProfileData = NULL;
// Now that everything is set up, record this module as being among the loaded modules.
// We need to do this before resolving any imports, because an import might (indirectly)
// need to resolve exports in this module. The only things that can be exported are
// functions and map variables, which must already be present if they're exported, so
// this is okay.
// This must be done first for 2 reasons:
// 1. If not, corrupt modules cause memory leaks
// 2. Corrupt modules won't be reported when a level is being loaded if this function quits before
// adding it to the list.
LibraryID = StaticModules.Push (this) << 16;
if (fr == NULL) len = Wads.LumpLength (lumpnum);
// Any behaviors smaller than 32 bytes cannot possibly contain anything useful.
// (16 bytes for a completely empty behavior + 12 bytes for one script header
// + 4 bytes for PCD_TERMINATE for an old-style object. A new-style object
// has 24 bytes if it is completely empty. An empty SPTR chunk adds 8 bytes.)
if (len < 32)
{
return;
}
object = new BYTE[len];
if (fr == NULL)
{
Wads.ReadLump (lumpnum, object);
}
else
{
fr->Read (object, len);
}
if (object[0] != 'A' || object[1] != 'C' || object[2] != 'S')
{
delete[] object;
return;
}
switch (object[3])
{
case 0:
Format = ACS_Old;
break;
case 'E':
Format = ACS_Enhanced;
break;
case 'e':
Format = ACS_LittleEnhanced;
break;
default:
delete[] object;
return;
}
if (fr == NULL)
{
Wads.GetLumpName (ModuleName, lumpnum);
ModuleName[8] = 0;
}
else
{
strcpy(ModuleName, "BEHAVIOR");
}
Data = object;
DataSize = len;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
if (Format == ACS_Old)
{
DWORD dirofs = LittleLong(((DWORD *)object)[1]);
DWORD pretag = ((DWORD *)(object + dirofs))[-1];
Chunks = object + len;
// Check for redesigned ACSE/ACSe
if (dirofs >= 6*4 &&
(pretag == MAKE_ID('A','C','S','e') ||
pretag == MAKE_ID('A','C','S','E')))
{
Format = (pretag == MAKE_ID('A','C','S','e')) ? ACS_LittleEnhanced : ACS_Enhanced;
Chunks = object + LittleLong(((DWORD *)(object + dirofs))[-2]);
// Forget about the compatibility cruft at the end of the lump
DataSize = LittleLong(((DWORD *)object)[1]) - 8;
}
}
else
{
Chunks = object + LittleLong(((DWORD *)object)[1]);
}
LoadScriptsDirectory ();
if (Format == ACS_Old)
{
StringTable = LittleLong(((DWORD *)Data)[1]);
StringTable += LittleLong(((DWORD *)(Data + StringTable))[0]) * 12 + 4;
UnescapeStringTable(Data + StringTable, Data, false);
}
else
{
UnencryptStrings ();
BYTE *strings = FindChunk (MAKE_ID('S','T','R','L'));
if (strings != NULL)
{
StringTable = DWORD(strings - Data + 8);
UnescapeStringTable(strings + 8, NULL, true);
}
else
{
StringTable = 0;
}
}
if (Format == ACS_Old)
{
// Do initialization for old-style behavior lumps
for (i = 0; i < NUM_MAPVARS; ++i)
{
MapVars[i] = &MapVarStore[i];
}
//LibraryID = StaticModules.Push (this) << 16;
}
else
{
DWORD *chunk;
Functions = FindChunk (MAKE_ID('F','U','N','C'));
if (Functions != NULL)
{
NumFunctions = LittleLong(((DWORD *)Functions)[1]) / 8;
Functions += 8;
FunctionProfileData = new ACSProfileInfo[NumFunctions];
}
// Load JUMP points
chunk = (DWORD *)FindChunk (MAKE_ID('J','U','M','P'));
if (chunk != NULL)
{
for (i = 0;i < (int)LittleLong(chunk[1]);i += 4)
JumpPoints.Push(LittleLong(chunk[2 + i/4]));
}
// Initialize this object's map variables
memset (MapVarStore, 0, sizeof(MapVarStore));
chunk = (DWORD *)FindChunk (MAKE_ID('M','I','N','I'));
while (chunk != NULL)
{
int numvars = LittleLong(chunk[1])/4 - 1;
int firstvar = LittleLong(chunk[2]);
for (i = 0; i < numvars; ++i)
{
MapVarStore[i+firstvar] = LittleLong(chunk[3+i]);
}
chunk = (DWORD *)NextChunk ((BYTE *)chunk);
}
// Initialize this object's map variable pointers to defaults. They can be changed
// later once the imported modules are loaded.
for (i = 0; i < NUM_MAPVARS; ++i)
{
MapVars[i] = &MapVarStore[i];
}
// Create arrays for this module
chunk = (DWORD *)FindChunk (MAKE_ID('A','R','A','Y'));
if (chunk != NULL)
{
NumArrays = LittleLong(chunk[1])/8;
ArrayStore = new ArrayInfo[NumArrays];
memset (ArrayStore, 0, sizeof(*Arrays)*NumArrays);
for (i = 0; i < NumArrays; ++i)
{
MapVarStore[LittleLong(chunk[2+i*2])] = i;
ArrayStore[i].ArraySize = LittleLong(chunk[3+i*2]);
ArrayStore[i].Elements = new SDWORD[ArrayStore[i].ArraySize];
memset(ArrayStore[i].Elements, 0, ArrayStore[i].ArraySize*sizeof(DWORD));
}
}
// Initialize arrays for this module
chunk = (DWORD *)FindChunk (MAKE_ID('A','I','N','I'));
while (chunk != NULL)
{
int arraynum = MapVarStore[LittleLong(chunk[2])];
if ((unsigned)arraynum < (unsigned)NumArrays)
{
int initsize = MIN<int> (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4);
SDWORD *elems = ArrayStore[arraynum].Elements;
for (i = 0; i < initsize; ++i)
{
elems[i] = LittleLong(chunk[3+i]);
}
}
chunk = (DWORD *)NextChunk((BYTE *)chunk);
}
// Start setting up array pointers
NumTotalArrays = NumArrays;
chunk = (DWORD *)FindChunk (MAKE_ID('A','I','M','P'));
if (chunk != NULL)
{
NumTotalArrays += LittleLong(chunk[2]);
}
if (NumTotalArrays != 0)
{
Arrays = new ArrayInfo *[NumTotalArrays];
for (i = 0; i < NumArrays; ++i)
{
Arrays[i] = &ArrayStore[i];
}
}
// Tag the library ID to any map variables that are initialized with strings
if (LibraryID != 0)
{
chunk = (DWORD *)FindChunk (MAKE_ID('M','S','T','R'));
if (chunk != NULL)
{
for (DWORD i = 0; i < chunk[1]/4; ++i)
{
MapVarStore[chunk[i+2]] |= LibraryID;
}
}
chunk = (DWORD *)FindChunk (MAKE_ID('A','S','T','R'));
if (chunk != NULL)
{
for (DWORD i = 0; i < chunk[1]/4; ++i)
{
int arraynum = MapVarStore[LittleLong(chunk[i+2])];
if ((unsigned)arraynum < (unsigned)NumArrays)
{
SDWORD *elems = ArrayStore[arraynum].Elements;
for (int j = ArrayStore[arraynum].ArraySize; j > 0; --j, ++elems)
{
*elems |= LibraryID;
}
}
}
}
// [BL] Newer version of ASTR for structure aware compilers although we only have one array per chunk
chunk = (DWORD *)FindChunk (MAKE_ID('A','T','A','G'));
while (chunk != NULL)
{
const BYTE* chunkData = (const BYTE*)(chunk + 2);
// First byte is version, it should be 0
if(*chunkData++ == 0)
{
int arraynum = MapVarStore[uallong(*(const int*)(chunkData))];
chunkData += 4;
if ((unsigned)arraynum < (unsigned)NumArrays)
{
SDWORD *elems = ArrayStore[arraynum].Elements;
// Ending zeros may be left out.
for (int j = MIN(chunk[1]-5, ArrayStore[arraynum].ArraySize); j > 0; --j, ++elems, ++chunkData)
{
// For ATAG, a value of 0 = Integer, 1 = String, 2 = FunctionPtr
// Our implementation uses the same tags for both String and FunctionPtr
if(*chunkData)
*elems |= LibraryID;
}
i += 4+ArrayStore[arraynum].ArraySize;
}
}
chunk = (DWORD *)NextChunk ((BYTE *)chunk);
}
}
// Load required libraries.
if (NULL != (chunk = (DWORD *)FindChunk (MAKE_ID('L','O','A','D'))))
{
const char *const parse = (char *)&chunk[2];
DWORD i;
for (i = 0; i < chunk[1]; )
{
if (parse[i])
{
FBehavior *module = NULL;
int lump = Wads.CheckNumForName (&parse[i], ns_acslibrary);
if (lump < 0)
{
Printf ("Could not find ACS library %s.\n", &parse[i]);
}
else
{
module = StaticLoadModule (lump);
}
if (module != NULL) Imports.Push (module);
do {;} while (parse[++i]);
}
++i;
}
// Go through each imported module in order and resolve all imported functions
// and map variables.
for (i = 0; i < Imports.Size(); ++i)
{
FBehavior *lib = Imports[i];
int j;
if (lib == NULL)
continue;
// Resolve functions
chunk = (DWORD *)FindChunk(MAKE_ID('F','N','A','M'));
for (j = 0; j < NumFunctions; ++j)
{
ScriptFunction *func = &((ScriptFunction *)Functions)[j];
if (func->Address == 0 && func->ImportNum == 0)
{
int libfunc = lib->FindFunctionName ((char *)(chunk + 2) + chunk[3+j]);
if (libfunc >= 0)
{
ScriptFunction *realfunc = &((ScriptFunction *)lib->Functions)[libfunc];
// Make sure that the library really defines this function. It might simply
// be importing it itself.
if (realfunc->Address != 0 && realfunc->ImportNum == 0)
{
func->Address = libfunc;
func->ImportNum = i+1;
if (realfunc->ArgCount != func->ArgCount)
{
Printf ("Function %s in %s has %d arguments. %s expects it to have %d.\n",
(char *)(chunk + 2) + chunk[3+j], lib->ModuleName, realfunc->ArgCount,
ModuleName, func->ArgCount);
Format = ACS_Unknown;
}
// The next two properties do not affect code compatibility, so it is
// okay for them to be different in the imported module than they are
// in this one, as long as we make sure to use the real values.
func->LocalCount = realfunc->LocalCount;
func->HasReturnValue = realfunc->HasReturnValue;
}
}
}
}
// Resolve map variables
chunk = (DWORD *)FindChunk(MAKE_ID('M','I','M','P'));
if (chunk != NULL)
{
char *parse = (char *)&chunk[2];
for (DWORD j = 0; j < chunk[1]; )
{
DWORD varNum = LittleLong(*(DWORD *)&parse[j]);
j += 4;
int impNum = lib->FindMapVarName (&parse[j]);
if (impNum >= 0)
{
MapVars[varNum] = &lib->MapVarStore[impNum];
}
do {;} while (parse[++j]);
++j;
}
}
// Resolve arrays
if (NumTotalArrays > NumArrays)
{
chunk = (DWORD *)FindChunk(MAKE_ID('A','I','M','P'));
char *parse = (char *)&chunk[3];
for (DWORD j = 0; j < LittleLong(chunk[2]); ++j)
{
DWORD varNum = LittleLong(*(DWORD *)parse);
parse += 4;
DWORD expectedSize = LittleLong(*(DWORD *)parse);
parse += 4;
int impNum = lib->FindMapArray (parse);
if (impNum >= 0)
{
Arrays[NumArrays + j] = &lib->ArrayStore[impNum];
MapVarStore[varNum] = NumArrays + j;
if (lib->ArrayStore[impNum].ArraySize != expectedSize)
{
Format = ACS_Unknown;
Printf ("The array %s in %s has %u elements, but %s expects it to only have %u.\n",
parse, lib->ModuleName, lib->ArrayStore[impNum].ArraySize,
ModuleName, expectedSize);
}
}
do {;} while (*++parse);
++parse;
}
}
}
}
}
DPrintf ("Loaded %d scripts, %d functions\n", NumScripts, NumFunctions);
}
FBehavior::~FBehavior ()
{
if (Scripts != NULL)
{
delete[] Scripts;
Scripts = NULL;
}
if (Arrays != NULL)
{
delete[] Arrays;
Arrays = NULL;
}
if (ArrayStore != NULL)
{
for (int i = 0; i < NumArrays; ++i)
{
if (ArrayStore[i].Elements != NULL)
{
delete[] ArrayStore[i].Elements;
ArrayStore[i].Elements = NULL;
}
}
delete[] ArrayStore;
ArrayStore = NULL;
}
if (FunctionProfileData != NULL)
{
delete[] FunctionProfileData;
FunctionProfileData = NULL;
}
if (Data != NULL)
{
delete[] Data;
Data = NULL;
}
}
void FBehavior::LoadScriptsDirectory ()
{
union
{
BYTE *b;
DWORD *dw;
WORD *w;
SWORD *sw;
ScriptPtr2 *po; // Old
ScriptPtr1 *pi; // Intermediate
ScriptPtr3 *pe; // LittleEnhanced
} scripts;
int i, max;
NumScripts = 0;
Scripts = NULL;
// Load the main script directory
switch (Format)
{
case ACS_Old:
scripts.dw = (DWORD *)(Data + LittleLong(((DWORD *)Data)[1]));
NumScripts = LittleLong(scripts.dw[0]);
if (NumScripts != 0)
{
scripts.dw++;
Scripts = new ScriptPtr[NumScripts];
for (i = 0; i < NumScripts; ++i)
{
ScriptPtr2 *ptr1 = &scripts.po[i];
ScriptPtr *ptr2 = &Scripts[i];
ptr2->Number = LittleLong(ptr1->Number) % 1000;
ptr2->Type = LittleLong(ptr1->Number) / 1000;
ptr2->ArgCount = LittleLong(ptr1->ArgCount);
ptr2->Address = LittleLong(ptr1->Address);
}
}
break;
case ACS_Enhanced:
case ACS_LittleEnhanced:
scripts.b = FindChunk (MAKE_ID('S','P','T','R'));
if (scripts.b == NULL)
{
// There are no scripts!
}
else if (*(DWORD *)Data != MAKE_ID('A','C','S',0))
{
NumScripts = LittleLong(scripts.dw[1]) / 12;
Scripts = new ScriptPtr[NumScripts];
scripts.dw += 2;
for (i = 0; i < NumScripts; ++i)
{
ScriptPtr1 *ptr1 = &scripts.pi[i];
ScriptPtr *ptr2 = &Scripts[i];
ptr2->Number = LittleShort(ptr1->Number);
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
ptr2->Type = BYTE(LittleShort(ptr1->Type));
ptr2->ArgCount = LittleLong(ptr1->ArgCount);
ptr2->Address = LittleLong(ptr1->Address);
}
}
else
{
NumScripts = LittleLong(scripts.dw[1]) / 8;
Scripts = new ScriptPtr[NumScripts];
scripts.dw += 2;
for (i = 0; i < NumScripts; ++i)
{
ScriptPtr3 *ptr1 = &scripts.pe[i];
ScriptPtr *ptr2 = &Scripts[i];
ptr2->Number = LittleShort(ptr1->Number);
ptr2->Type = ptr1->Type;
ptr2->ArgCount = ptr1->ArgCount;
ptr2->Address = LittleLong(ptr1->Address);
}
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
default:
break;
}
for (i = 0; i < NumScripts; ++i)
{
Scripts[i].Flags = 0;
Scripts[i].VarCount = LOCAL_SIZE;
}
// Sort scripts, so we can use a binary search to find them
if (NumScripts > 1)
{
qsort (Scripts, NumScripts, sizeof(ScriptPtr), SortScripts);
2010-02-19 08:14:40 +00:00
// Check for duplicates because ACC originally did not enforce
// script number uniqueness across different script types. We
// only need to do this for old format lumps, because the ACCs
// that produce new format lumps won't let you do this.
if (Format == ACS_Old)
{
for (i = 0; i < NumScripts - 1; ++i)
{
if (Scripts[i].Number == Scripts[i+1].Number)
{
Printf("%s appears more than once.\n",
ScriptPresentation(Scripts[i].Number).GetChars());
2010-02-19 08:14:40 +00:00
// Make the closed version the first one.
if (Scripts[i+1].Type == SCRIPT_Closed)
{
swapvalues(Scripts[i], Scripts[i+1]);
2010-02-19 08:14:40 +00:00
}
}
}
}
}
if (Format == ACS_Old)
return;
// Load script flags
scripts.b = FindChunk (MAKE_ID('S','F','L','G'));
if (scripts.dw != NULL)
{
max = scripts.dw[1] / 4;
scripts.dw += 2;
for (i = max; i > 0; --i, scripts.w += 2)
{
ScriptPtr *ptr = const_cast<ScriptPtr *>(FindScript (LittleShort(scripts.sw[0])));
if (ptr != NULL)
{
ptr->Flags = LittleShort(scripts.w[1]);
}
}
}
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
// Load script var counts. (Only recorded for scripts that use more than LOCAL_SIZE variables.)
scripts.b = FindChunk (MAKE_ID('S','V','C','T'));
if (scripts.dw != NULL)
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
max = scripts.dw[1] / 4;
scripts.dw += 2;
for (i = max; i > 0; --i, scripts.w += 2)
{
ScriptPtr *ptr = const_cast<ScriptPtr *>(FindScript (LittleShort(scripts.sw[0])));
if (ptr != NULL)
{
ptr->VarCount = LittleShort(scripts.w[1]);
}
}
}
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
// Load script names (if any)
scripts.b = FindChunk(MAKE_ID('S','N','A','M'));
if (scripts.dw != NULL)
{
UnescapeStringTable(scripts.b + 8, NULL, false);
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
for (i = 0; i < NumScripts; ++i)
{
// ACC stores script names as an index into the SNAM chunk, with the first index as
// -1 and counting down from there. We convert this from an index into SNAM into
// a negative index into the global name table.
if (Scripts[i].Number < 0)
{
const char *str = (const char *)(scripts.b + 8 + scripts.dw[3 + (-Scripts[i].Number - 1)]);
FName name(str);
Scripts[i].Number = -name;
}
}
// We need to resort scripts, because the new numbers for named scripts likely
// do not match the order they were originally in.
qsort (Scripts, NumScripts, sizeof(ScriptPtr), SortScripts);
}
}
int STACK_ARGS FBehavior::SortScripts (const void *a, const void *b)
{
ScriptPtr *ptr1 = (ScriptPtr *)a;
ScriptPtr *ptr2 = (ScriptPtr *)b;
return ptr1->Number - ptr2->Number;
}
//============================================================================
//
// FBehavior :: UnencryptStrings
//
// Descrambles strings in a STRE chunk to transform it into a STRL chunk.
//
//============================================================================
void FBehavior::UnencryptStrings ()
{
DWORD *prevchunk = NULL;
DWORD *chunk = (DWORD *)FindChunk(MAKE_ID('S','T','R','E'));
while (chunk != NULL)
{
for (DWORD strnum = 0; strnum < LittleLong(chunk[3]); ++strnum)
{
int ofs = LittleLong(chunk[5+strnum]);
BYTE *data = (BYTE *)chunk + ofs + 8, last;
int p = (BYTE)(ofs*157135);
int i = 0;
do
{
last = (data[i] ^= (BYTE)(p+(i>>1)));
++i;
} while (last != 0);
}
prevchunk = chunk;
chunk = (DWORD *)NextChunk ((BYTE *)chunk);
*prevchunk = MAKE_ID('S','T','R','L');
}
if (prevchunk != NULL)
{
*prevchunk = MAKE_ID('S','T','R','L');
}
}
//============================================================================
//
// FBehavior :: UnescapeStringTable
//
// Processes escape sequences for every string in a string table.
// Chunkstart points to the string table. Datastart points to the base address
// for offsets in the string table; if NULL, it will use chunkstart. If
// has_padding is true, then this is a STRL chunk with four bytes of padding
// on either side of the string count.
//
//============================================================================
void FBehavior::UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool has_padding)
{
assert(chunkstart != NULL);
DWORD *chunk = (DWORD *)chunkstart;
if (datastart == NULL)
{
datastart = chunkstart;
}
if (!has_padding)
{
chunk[0] = LittleLong(chunk[0]);
for (DWORD strnum = 0; strnum < chunk[0]; ++strnum)
{
int ofs = LittleLong(chunk[1 + strnum]); // Byte swap offset, if needed.
chunk[1 + strnum] = ofs;
strbin((char *)datastart + ofs);
}
}
else
{
chunk[1] = LittleLong(chunk[1]);
for (DWORD strnum = 0; strnum < chunk[1]; ++strnum)
{
int ofs = LittleLong(chunk[3 + strnum]); // Byte swap offset, if needed.
chunk[3 + strnum] = ofs;
strbin((char *)datastart + ofs);
}
}
}
//============================================================================
//
// FBehavior :: IsGood
//
//============================================================================
bool FBehavior::IsGood ()
{
bool bad;
int i;
// Check that the data format was understood
if (Format == ACS_Unknown)
{
return false;
}
// Check that all functions are resolved
bad = false;
for (i = 0; i < NumFunctions; ++i)
{
ScriptFunction *funcdef = (ScriptFunction *)Functions + i;
if (funcdef->Address == 0 && funcdef->ImportNum == 0)
{
DWORD *chunk = (DWORD *)FindChunk (MAKE_ID('F','N','A','M'));
Printf ("Could not find ACS function %s for use in %s.\n",
(char *)(chunk + 2) + chunk[3+i], ModuleName);
bad = true;
}
}
// Check that all imported modules were loaded
for (i = Imports.Size() - 1; i >= 0; --i)
{
if (Imports[i] == NULL)
{
Printf ("Not all the libraries used by %s could be found.\n", ModuleName);
return false;
}
}
return !bad;
}
const ScriptPtr *FBehavior::FindScript (int script) const
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
const ScriptPtr *ptr = BinarySearch<ScriptPtr, int>
((ScriptPtr *)Scripts, NumScripts, &ScriptPtr::Number, script);
2010-02-19 08:14:40 +00:00
// If the preceding script has the same number, return it instead.
// See the note by the script sorting above for why.
if (ptr > Scripts)
{
if (ptr[-1].Number == script)
{
ptr--;
}
}
return ptr;
}
const ScriptPtr *FBehavior::StaticFindScript (int script, FBehavior *&module)
{
for (DWORD i = 0; i < StaticModules.Size(); ++i)
{
const ScriptPtr *code = StaticModules[i]->FindScript (script);
if (code != NULL)
{
module = StaticModules[i];
return code;
}
}
return NULL;
}
ScriptFunction *FBehavior::GetFunction (int funcnum, FBehavior *&module) const
{
if ((unsigned)funcnum >= (unsigned)NumFunctions)
{
return NULL;
}
ScriptFunction *funcdef = (ScriptFunction *)Functions + funcnum;
if (funcdef->ImportNum)
{
return Imports[funcdef->ImportNum - 1]->GetFunction (funcdef->Address, module);
}
// Should I just un-const this function instead of using a const_cast?
module = const_cast<FBehavior *>(this);
return funcdef;
}
int FBehavior::FindFunctionName (const char *funcname) const
{
return FindStringInChunk ((DWORD *)FindChunk (MAKE_ID('F','N','A','M')), funcname);
}
int FBehavior::FindMapVarName (const char *varname) const
{
return FindStringInChunk ((DWORD *)FindChunk (MAKE_ID('M','E','X','P')), varname);
}
int FBehavior::FindMapArray (const char *arrayname) const
{
int var = FindMapVarName (arrayname);
if (var >= 0)
{
return MapVarStore[var];
}
return -1;
}
int FBehavior::FindStringInChunk (DWORD *names, const char *varname) const
{
if (names != NULL)
{
DWORD i;
for (i = 0; i < LittleLong(names[2]); ++i)
{
if (stricmp (varname, (char *)(names + 2) + LittleLong(names[3+i])) == 0)
{
return (int)i;
}
}
}
return -1;
}
int FBehavior::GetArrayVal (int arraynum, int index) const
{
if ((unsigned)arraynum >= (unsigned)NumTotalArrays)
return 0;
const ArrayInfo *array = Arrays[arraynum];
if ((unsigned)index >= (unsigned)array->ArraySize)
return 0;
return array->Elements[index];
}
void FBehavior::SetArrayVal (int arraynum, int index, int value)
{
if ((unsigned)arraynum >= (unsigned)NumTotalArrays)
return;
const ArrayInfo *array = Arrays[arraynum];
if ((unsigned)index >= (unsigned)array->ArraySize)
return;
array->Elements[index] = value;
}
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
inline bool FBehavior::CopyStringToArray(int arraynum, int index, int maxLength, const char *string)
{
// false if the operation was incomplete or unsuccessful
if ((unsigned)arraynum >= (unsigned)NumTotalArrays || index < 0)
return false;
const ArrayInfo *array = Arrays[arraynum];
if ((signed)array->ArraySize - index < maxLength) maxLength = (signed)array->ArraySize - index;
while (maxLength-- > 0)
{
array->Elements[index++] = *string;
if (!(*string)) return true; // written terminating 0
string++;
}
return !(*string); // return true if only terminating 0 was not written
}
BYTE *FBehavior::FindChunk (DWORD id) const
{
BYTE *chunk = Chunks;
while (chunk != NULL && chunk < Data + DataSize)
{
if (((DWORD *)chunk)[0] == id)
{
return chunk;
}
chunk += ((DWORD *)chunk)[1] + 8;
}
return NULL;
}
BYTE *FBehavior::NextChunk (BYTE *chunk) const
{
DWORD id = *(DWORD *)chunk;
chunk += ((DWORD *)chunk)[1] + 8;
while (chunk != NULL && chunk < Data + DataSize)
{
if (((DWORD *)chunk)[0] == id)
{
return chunk;
}
chunk += ((DWORD *)chunk)[1] + 8;
}
return NULL;
}
const char *FBehavior::StaticLookupString (DWORD index)
{
DWORD lib = index >> 16;
switch (lib)
{
case LIB_ACSSTRINGS_ONTHEFLY:
index &= 0xffff;
return (ACS_StringsOnTheFly.Size() > index) ? ACS_StringsOnTheFly[index].GetChars() : NULL;
}
if (lib >= (DWORD)StaticModules.Size())
{
return NULL;
}
return StaticModules[lib]->LookupString (index & 0xffff);
}
const char *FBehavior::LookupString (DWORD index) const
{
if (StringTable == 0)
{
return NULL;
}
if (Format == ACS_Old)
{
DWORD *list = (DWORD *)(Data + StringTable);
if (index >= list[0])
return NULL; // Out of range for this list;
return (const char *)(Data + list[1+index]);
}
else
{
DWORD *list = (DWORD *)(Data + StringTable);
if (index >= list[1])
return NULL; // Out of range for this list
return (const char *)(Data + StringTable + list[3+index]);
}
}
void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow)
{
static const char *const TypeNames[] =
{
"Closed",
"Open",
"Respawn",
"Death",
"Enter",
"Pickup",
"BlueReturn",
"RedReturn",
"WhiteReturn",
"Unknown", "Unknown", "Unknown",
"Lightning",
"Unloading",
"Disconnect",
"Return"
};
DPrintf("Starting all scripts of type %d (%s)\n", type,
type < countof(TypeNames) ? TypeNames[type] : TypeNames[SCRIPT_Lightning - 1]);
for (unsigned int i = 0; i < StaticModules.Size(); ++i)
{
StaticModules[i]->StartTypedScripts (type, activator, always, arg1, runNow);
}
}
void FBehavior::StartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow)
{
const ScriptPtr *ptr;
int i;
for (i = 0; i < NumScripts; ++i)
{
ptr = &Scripts[i];
if (ptr->Type == type)
{
DLevelScript *runningScript = P_GetScriptGoing (activator, NULL, ptr->Number,
ptr, this, &arg1, 1, always ? ACS_ALWAYS : 0);
if (runNow)
{
runningScript->RunScript ();
}
}
}
}
// FBehavior :: StaticStopMyScripts
//
// Stops any scripts started by the specified actor. Used by the net code
// when a player disconnects. Should this be used in general whenever an
// actor is destroyed?
void FBehavior::StaticStopMyScripts (AActor *actor)
{
DACSThinker *controller = DACSThinker::ActiveThinker;
if (controller != NULL)
{
controller->StopScriptsFor (actor);
}
}
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
//==========================================================================
//
// P_SerializeACSScriptNumber
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
//
// Serializes a script number. If it's negative, it's really a name, so
// that will get serialized after it.
//
//==========================================================================
void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
{
if (SaveVersion < 3359)
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
{
if (was2byte)
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
{
WORD oldver;
arc << oldver;
scriptnum = oldver;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
}
else
{
arc << scriptnum;
}
}
else
{
arc << scriptnum;
// If the script number is negative, then it's really a name.
// So read/store the name after it.
if (scriptnum < 0)
{
if (arc.IsStoring())
{
arc.WriteName(FName(ENamedName(-scriptnum)).GetChars());
}
else
{
const char *nam = arc.ReadName();
scriptnum = -FName(nam);
}
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
}
}
}
//---- The ACS Interpreter ----//
IMPLEMENT_POINTY_CLASS (DACSThinker)
DECLARE_POINTER(LastScript)
DECLARE_POINTER(Scripts)
END_POINTERS
TObjPtr<DACSThinker> DACSThinker::ActiveThinker;
DACSThinker::DACSThinker ()
- fixed: Even with precise rendering polyobject lines must be excluded from being split. Update to ZDoom r2081: - fixed: Polyobjects could contain segs that weren't flagged as such. - fixed: Trying to show a popup crashed in the SBARINFO code because of a missing NULL pointer check. - fixed: The ACS thinker needs its own statnum above all actors. Otherwise order of execution is not guaranteed. - fixed: Only ActorMovers should go into STAT_ACTORMOVER, not all PathFollowers. - fixed: SBARINFO's DrawGem command accepted a size value of 0 and divided by it. Reinstated the old '+1' this command had in the old code. - fixed: The floor waggle code used FloatBobOffsets as sine table but this only has 64 entries and is not precise enough. It now uses finesine instead. - fixed: When compositing a multipatch texture any patch that is a multpatch texture itself and contains rotations may not be composited directly into the destination buffer. This must be done with an intermediate buffer. - Fixed: Drawing a slider in the options menu did not scale the x-coordinate. - Fixed: If the alt HUD had to draw negative numbers the minus sign was misplaced due to incorrect texture coordinate calculations. - changed option menu scaling for widescreen modes so that it doesn't scale down so quickly. - made some error messages in DECORATE that don't affect the parsing non-fatal so that the parser can continue to find more problems. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@701 b0f79afe-0144-0410-b225-9a4edf0717df
2010-01-02 13:21:07 +00:00
: DThinker(STAT_SCRIPTS)
{
if (ActiveThinker)
{
I_Error ("Only one ACSThinker is allowed to exist at a time.\nCheck your code.");
}
else
{
ActiveThinker = this;
Scripts = NULL;
LastScript = NULL;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
RunningScripts.Clear();
}
}
DACSThinker::~DACSThinker ()
{
Scripts = NULL;
ActiveThinker = NULL;
}
void DACSThinker::Serialize (FArchive &arc)
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
int scriptnum;
Super::Serialize (arc);
arc << Scripts << LastScript;
if (arc.IsStoring ())
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
ScriptMap::Iterator it(RunningScripts);
ScriptMap::Pair *pair;
while (it.NextPair(pair))
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
assert(pair->Value != NULL);
arc << pair->Value;
scriptnum = pair->Key;
P_SerializeACSScriptNumber(arc, scriptnum, true);
}
DLevelScript *nilptr = NULL;
arc << nilptr;
}
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
else // Loading
{
DLevelScript *script = NULL;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
RunningScripts.Clear();
arc << script;
while (script)
{
P_SerializeACSScriptNumber(arc, scriptnum, true);
RunningScripts[scriptnum] = script;
arc << script;
}
}
}
void DACSThinker::Tick ()
{
DLevelScript *script = Scripts;
while (script)
{
DLevelScript *next = script->next;
script->RunScript ();
script = next;
}
ACS_StringsOnTheFly.Clear();
if (ACS_StringBuilderStack.Size())
{
int size = ACS_StringBuilderStack.Size();
ACS_StringBuilderStack.Clear();
I_Error("Error: %d garbage entries on ACS string builder stack.", size);
}
}
void DACSThinker::StopScriptsFor (AActor *actor)
{
DLevelScript *script = Scripts;
while (script != NULL)
{
DLevelScript *next = script->next;
if (script->activator == actor)
{
script->SetState (DLevelScript::SCRIPT_PleaseRemove);
}
script = next;
}
}
IMPLEMENT_POINTY_CLASS (DLevelScript)
DECLARE_POINTER(next)
DECLARE_POINTER(prev)
DECLARE_POINTER(activator)
END_POINTERS
inline FArchive &operator<< (FArchive &arc, DLevelScript::EScriptState &state)
{
BYTE val = (BYTE)state;
arc << val;
state = (DLevelScript::EScriptState)val;
return arc;
}
void DLevelScript::Serialize (FArchive &arc)
{
DWORD i;
Super::Serialize (arc);
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
arc << next << prev;
P_SerializeACSScriptNumber(arc, script, false);
arc << state
<< statedata
<< activator
<< activationline
<< backSide
<< numlocalvars;
if (arc.IsLoading())
{
localvars = new SDWORD[numlocalvars];
}
for (i = 0; i < (DWORD)numlocalvars; i++)
{
arc << localvars[i];
}
if (arc.IsStoring ())
{
WORD lib = activeBehavior->GetLibraryID() >> 16;
arc << lib;
i = activeBehavior->PC2Ofs (pc);
arc << i;
}
else
{
WORD lib;
arc << lib << i;
activeBehavior = FBehavior::StaticGetModule (lib);
pc = activeBehavior->Ofs2PC (i);
}
arc << activefont
<< hudwidth << hudheight;
if (SaveVersion >= 3960)
{
arc << ClipRectLeft << ClipRectTop << ClipRectWidth << ClipRectHeight
<< WrapWidth;
}
else
{
ClipRectLeft = ClipRectTop = ClipRectWidth = ClipRectHeight = WrapWidth = 0;
}
if (SaveVersion >= 4058)
{
arc << InModuleScriptNumber;
}
else
{ // Don't worry about locating profiling info for old saves.
InModuleScriptNumber = -1;
}
}
DLevelScript::DLevelScript ()
{
next = prev = NULL;
if (DACSThinker::ActiveThinker == NULL)
new DACSThinker;
activefont = SmallFont;
localvars = NULL;
}
DLevelScript::~DLevelScript ()
{
if (localvars != NULL)
delete[] localvars;
localvars = NULL;
}
void DLevelScript::Unlink ()
{
DACSThinker *controller = DACSThinker::ActiveThinker;
if (controller->LastScript == this)
{
controller->LastScript = prev;
GC::WriteBarrier(controller, prev);
}
if (controller->Scripts == this)
{
controller->Scripts = next;
GC::WriteBarrier(controller, next);
}
if (prev)
{
prev->next = next;
GC::WriteBarrier(prev, next);
}
if (next)
{
next->prev = prev;
GC::WriteBarrier(next, prev);
}
}
void DLevelScript::Link ()
{
DACSThinker *controller = DACSThinker::ActiveThinker;
next = controller->Scripts;
GC::WriteBarrier(this, next);
if (controller->Scripts)
{
controller->Scripts->prev = this;
GC::WriteBarrier(controller->Scripts, this);
}
prev = NULL;
controller->Scripts = this;
GC::WriteBarrier(controller, this);
if (controller->LastScript == NULL)
{
controller->LastScript = this;
}
}
void DLevelScript::PutLast ()
{
DACSThinker *controller = DACSThinker::ActiveThinker;
if (controller->LastScript == this)
return;
Unlink ();
if (controller->Scripts == NULL)
{
Link ();
}
else
{
if (controller->LastScript)
controller->LastScript->next = this;
prev = controller->LastScript;
next = NULL;
controller->LastScript = this;
}
}
void DLevelScript::PutFirst ()
{
DACSThinker *controller = DACSThinker::ActiveThinker;
if (controller->Scripts == this)
return;
Unlink ();
Link ();
}
int DLevelScript::Random (int min, int max)
{
if (max < min)
{
swapvalues (max, min);
}
return min + pr_acs(max - min + 1);
}
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
int DLevelScript::ThingCount (int type, int stringid, int tid, int tag)
{
AActor *actor;
const PClass *kind;
int count = 0;
bool replacemented = false;
if (type > 0)
{
kind = P_GetSpawnableType(type);
if (kind == NULL)
return 0;
}
else if (stringid >= 0)
{
const char *type_name = FBehavior::StaticLookupString (stringid);
if (type_name == NULL)
return 0;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
kind = PClass::FindClass (type_name);
if (kind == NULL || kind->ActorInfo == NULL)
return 0;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
else
{
kind = NULL;
}
do_count:
if (tid)
{
FActorIterator iterator (tid);
while ( (actor = iterator.Next ()) )
{
if (actor->health > 0 &&
(kind == NULL || actor->IsA (kind)))
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
if (actor->Sector->tag == tag || tag == -1)
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
// Don't count items in somebody's inventory
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{
count++;
}
}
}
}
}
else
{
TThinkerIterator<AActor> iterator;
while ( (actor = iterator.Next ()) )
{
if (actor->health > 0 &&
(kind == NULL || actor->IsA (kind)))
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
if (actor->Sector->tag == tag || tag == -1)
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
// Don't count items in somebody's inventory
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{
count++;
}
}
}
}
}
if (!replacemented && kind != NULL)
{
// Again, with decorate replacements
replacemented = true;
PClass *newkind = kind->GetReplacement();
if (newkind != kind)
{
kind = newkind;
goto do_count;
}
}
return count;
}
void DLevelScript::ChangeFlat (int tag, int name, bool floorOrCeiling)
{
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
FTextureID flat;
int secnum = -1;
const char *flatname = FBehavior::StaticLookupString (name);
if (flatname == NULL)
return;
flat = TexMan.GetTexture (flatname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
{
int pos = floorOrCeiling? sector_t::ceiling : sector_t::floor;
sectors[secnum].SetTexture(pos, flat);
}
}
int DLevelScript::CountPlayers ()
{
int count = 0, i;
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i])
count++;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
return count;
}
void DLevelScript::SetLineTexture (int lineid, int side, int position, int name)
{
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
FTextureID texture;
int linenum = -1;
const char *texname = FBehavior::StaticLookupString (name);
if (texname == NULL)
return;
side = !!side;
texture = TexMan.GetTexture (texname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
while ((linenum = P_FindLineFromID (lineid, linenum)) >= 0)
{
side_t *sidedef;
sidedef = lines[linenum].sidedef[side];
if (sidedef == NULL)
continue;
switch (position)
{
case TEXTURE_TOP:
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
sidedef->SetTexture(side_t::top, texture);
break;
case TEXTURE_MIDDLE:
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
sidedef->SetTexture(side_t::mid, texture);
break;
case TEXTURE_BOTTOM:
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
sidedef->SetTexture(side_t::bottom, texture);
break;
default:
break;
}
}
}
void DLevelScript::ReplaceTextures (int fromnamei, int tonamei, int flags)
{
const char *fromname = FBehavior::StaticLookupString (fromnamei);
const char *toname = FBehavior::StaticLookupString (tonamei);
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
FTextureID picnum1, picnum2;
if (fromname == NULL)
return;
if ((flags ^ (NOT_BOTTOM | NOT_MIDDLE | NOT_TOP)) != 0)
{
picnum1 = TexMan.GetTexture (fromname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
picnum2 = TexMan.GetTexture (toname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
for (int i = 0; i < numsides; ++i)
{
side_t *wal = &sides[i];
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
for(int j=0;j<3;j++)
{
static BYTE bits[]={NOT_TOP, NOT_MIDDLE, NOT_BOTTOM};
if (!(flags & bits[j]) && wal->GetTexture(j) == picnum1)
{
wal->SetTexture(j, picnum2);
}
}
}
}
if ((flags ^ (NOT_FLOOR | NOT_CEILING)) != 0)
{
picnum1 = TexMan.GetTexture (fromname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
picnum2 = TexMan.GetTexture (toname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
for (int i = 0; i < numsectors; ++i)
{
sector_t *sec = &sectors[i];
if (!(flags & NOT_FLOOR) && sec->GetTexture(sector_t::floor) == picnum1)
sec->SetTexture(sector_t::floor, picnum2);
if (!(flags & NOT_CEILING) && sec->GetTexture(sector_t::ceiling) == picnum1)
sec->SetTexture(sector_t::ceiling, picnum2);
}
}
}
int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force)
{
const PClass *info = PClass::FindClass (FBehavior::StaticLookupString (type));
AActor *actor = NULL;
int spawncount = 0;
if (info != NULL)
{
actor = Spawn (info, x, y, z, ALLOW_REPLACE);
if (actor != NULL)
{
DWORD oldFlags2 = actor->flags2;
actor->flags2 |= MF2_PASSMOBJ;
if (force || P_TestMobjLocation (actor))
{
actor->angle = angle << 24;
actor->tid = tid;
actor->AddToHash ();
if (actor->flags & MF_SPECIAL)
actor->flags |= MF_DROPPED; // Don't respawn
actor->flags2 = oldFlags2;
spawncount++;
}
else
{
// If this is a monster, subtract it from the total monster
// count, because it already added to it during spawning.
* Updated to ZDoom r2831: - Fixed: The DUMB specific options should be grayed out when using FMod for playing back modules. - Fixed: The newly accelerated mousewheel scrolling code did not check for the end of the list and could scroll one item too far. It also incremented VisBottom by 3 instead of 2. - changed lock failsound lookup so that for each sound it tries to resolve it as a player sound before deciding if it is valid. - Fixed: FOptionMenuItemJoyMap::SetSelection() did not convert from menu selection number to joyaxis number. - Scroll two rows at a time with the mouse wheel in the options menu. - Remove extra *usefail definition for the pig player. - Locks can now define more than one LockedSound by separating them with commas. The default setting for this property is now "*keytry", "misc/keytry". The first sound that is defined is the one that will be played for the lock. Thus, for standard locks, if the player class defines *keytry, that will be played. Otherwise, misc/keytry will be played as before. - Added a ClearCounters function to AActor that handles everything necessary to un-count an item that is not supposed to be counted but has some of the COUNT* flags set. - Merged all places where secrets are credited into one common function. - Added the Doom64 COUNTSECRET actor flag. - Fixed: AInventory::CreateCopy did not clear the COUNTITEM flag. - Fixed: Dropping an item did not increase the item count but the dropped item could still have the COUNTITEM flag. Now this flag gets cleared when the item gets picked up so that dropped items don't count a second time. - Merged Thing_Destroy extension from Doom64 branch into trunk and extended it by a tid=0, tag!=0 case which will kill all shootable actors in sectors with the specified tag. - Fixed: Compilation errors on Mac OS X. - Fixed Linux compilation issue with statistics.cpp - Resurrected some old statistics code I had and made some minor enhancements to be of more use. - Fixed: The subsector serializing code accessed the subsector array before validating the index. - Added episode names to episode definitions of Doom 1 and Chex Quest. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@979 b0f79afe-0144-0410-b225-9a4edf0717df
2010-09-19 08:00:43 +00:00
actor->ClearCounters();
actor->Destroy ();
actor = NULL;
}
}
}
return spawncount;
}
int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle, bool force)
{
int spawned = 0;
2009-08-29 18:16:02 +00:00
if (spot != 0)
{
2009-08-29 18:16:02 +00:00
FActorIterator iterator (spot);
AActor *aspot;
while ( (aspot = iterator.Next ()) )
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force);
}
}
else if (activator != NULL)
{
spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, angle, force);
}
return spawned;
}
int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid, bool force)
{
int spawned = 0;
2009-08-29 18:16:02 +00:00
if (spot != 0)
{
FActorIterator iterator (spot);
AActor *aspot;
while ( (aspot = iterator.Next ()) )
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force);
}
}
else if (activator != NULL)
{
2009-08-29 18:16:02 +00:00
spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, activator->angle >> 24, force);
}
return spawned;
}
void DLevelScript::DoFadeTo (int r, int g, int b, int a, fixed_t time)
{
DoFadeRange (0, 0, 0, -1, clamp(r, 0, 255), clamp(g, 0, 255), clamp(b, 0, 255), clamp(a, 0, FRACUNIT), time);
}
void DLevelScript::DoFadeRange (int r1, int g1, int b1, int a1,
int r2, int g2, int b2, int a2, fixed_t time)
{
player_t *viewer;
float ftime = (float)time / 65536.f;
bool fadingFrom = a1 >= 0;
float fr1 = 0, fg1 = 0, fb1 = 0, fa1 = 0;
float fr2, fg2, fb2, fa2;
int i;
fr2 = (float)r2 / 255.f;
fg2 = (float)g2 / 255.f;
fb2 = (float)b2 / 255.f;
fa2 = (float)a2 / 65536.f;
if (fadingFrom)
{
fr1 = (float)r1 / 255.f;
fg1 = (float)g1 / 255.f;
fb1 = (float)b1 / 255.f;
fa1 = (float)a1 / 65536.f;
}
if (activator != NULL)
{
viewer = activator->player;
if (viewer == NULL)
return;
i = MAXPLAYERS;
goto showme;
}
else
{
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
{
viewer = &players[i];
showme:
if (ftime <= 0.f)
{
viewer->BlendR = fr2;
viewer->BlendG = fg2;
viewer->BlendB = fb2;
viewer->BlendA = fa2;
}
else
{
if (!fadingFrom)
{
if (viewer->BlendA <= 0.f)
{
fr1 = fr2;
fg1 = fg2;
fb1 = fb2;
fa1 = 0.f;
}
else
{
fr1 = viewer->BlendR;
fg1 = viewer->BlendG;
fb1 = viewer->BlendB;
fa1 = viewer->BlendA;
}
}
new DFlashFader (fr1, fg1, fb1, fa1, fr2, fg2, fb2, fa2, ftime, viewer->mo);
}
}
}
}
}
void DLevelScript::DoSetFont (int fontnum)
{
const char *fontname = FBehavior::StaticLookupString (fontnum);
activefont = V_GetFont (fontname);
if (activefont == NULL)
{
activefont = SmallFont;
}
}
int DoSetMaster (AActor *self, AActor *master)
{
AActor *defs;
if (self->flags3&MF3_ISMONSTER)
{
if (master)
{
if (master->flags3&MF3_ISMONSTER)
{
self->FriendPlayer = 0;
self->master = master;
level.total_monsters -= self->CountsAsKill();
self->flags = (self->flags & ~MF_FRIENDLY) | (master->flags & MF_FRIENDLY);
level.total_monsters += self->CountsAsKill();
// Don't attack your new master
if (self->target == self->master) self->target = NULL;
if (self->lastenemy == self->master) self->lastenemy = NULL;
if (self->LastHeard == self->master) self->LastHeard = NULL;
return 1;
}
else if (master->player)
{
// [KS] Be friendly to this player
self->master = NULL;
level.total_monsters -= self->CountsAsKill();
self->flags|=MF_FRIENDLY;
self->SetFriendPlayer(master->player);
AActor * attacker=master->player->attacker;
if (attacker)
{
if (!(attacker->flags&MF_FRIENDLY) ||
(deathmatch && attacker->FriendPlayer!=0 && attacker->FriendPlayer!=self->FriendPlayer))
{
self->LastHeard = self->target = attacker;
}
}
// And stop attacking him if necessary.
if (self->target == master) self->target = NULL;
if (self->lastenemy == master) self->lastenemy = NULL;
if (self->LastHeard == master) self->LastHeard = NULL;
return 1;
}
}
else
{
self->master = NULL;
self->FriendPlayer = 0;
// Go back to whatever friendliness we usually have...
defs = self->GetDefault();
level.total_monsters -= self->CountsAsKill();
self->flags = (self->flags & ~MF_FRIENDLY) | (defs->flags & MF_FRIENDLY);
level.total_monsters += self->CountsAsKill();
// ...And re-side with our friends.
if (self->target && !self->IsHostile (self->target)) self->target = NULL;
if (self->lastenemy && !self->IsHostile (self->lastenemy)) self->lastenemy = NULL;
if (self->LastHeard && !self->IsHostile (self->LastHeard)) self->LastHeard = NULL;
return 1;
}
}
return 0;
}
int DoGetMasterTID (AActor *self)
{
if (self->master) return self->master->tid;
else if (self->FriendPlayer)
{
player_t *player = &players[(self->FriendPlayer)-1];
return player->mo->tid;
}
else return 0;
}
static AActor *SingleActorFromTID (int tid, AActor *defactor)
{
if (tid == 0)
{
return defactor;
}
else
{
FActorIterator iterator (tid);
return iterator.Next();
}
}
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
enum
{
APROP_Health = 0,
APROP_Speed = 1,
APROP_Damage = 2,
APROP_Alpha = 3,
APROP_RenderStyle = 4,
APROP_SeeSound = 5, // Sounds can only be set, not gotten
APROP_AttackSound = 6,
APROP_PainSound = 7,
APROP_DeathSound = 8,
APROP_ActiveSound = 9,
APROP_Ambush = 10,
APROP_Invulnerable = 11,
APROP_JumpZ = 12, // [GRB]
APROP_ChaseGoal = 13,
APROP_Frightened = 14,
APROP_Gravity = 15,
APROP_Friendly = 16,
APROP_SpawnHealth = 17,
APROP_Dropped = 18,
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
APROP_Notarget = 19,
APROP_Species = 20,
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
APROP_NameTag = 21,
APROP_Score = 22,
APROP_Notrigger = 23,
APROP_DamageFactor = 24,
APROP_MasterTID = 25,
APROP_TargetTID = 26,
APROP_TracerTID = 27,
APROP_WaterLevel = 28,
APROP_ScaleX = 29,
APROP_ScaleY = 30,
APROP_Dormant = 31,
APROP_Mass = 32,
APROP_Accuracy = 33,
APROP_Stamina = 34,
APROP_Height = 35,
APROP_Radius = 36,
};
// These are needed for ACS's APROP_RenderStyle
static const int LegacyRenderStyleIndices[] =
{
0, // STYLE_None,
1, // STYLE_Normal,
2, // STYLE_Fuzzy,
3, // STYLE_SoulTrans,
4, // STYLE_OptFuzzy,
5, // STYLE_Stencil,
64, // STYLE_Translucent
65, // STYLE_Add,
66, // STYLE_Shaded,
67, // STYLE_TranslucentStencil,
-1
};
void DLevelScript::SetActorProperty (int tid, int property, int value)
{
if (tid == 0)
{
DoSetActorProperty (activator, property, value);
}
else
{
AActor *actor;
FActorIterator iterator (tid);
while ((actor = iterator.Next()) != NULL)
{
DoSetActorProperty (actor, property, value);
}
}
}
void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
{
if (actor == NULL)
{
return;
}
switch (property)
{
case APROP_Health:
// Don't alter the health of dead things.
if (actor->health <= 0 || (actor->player != NULL && actor->player->playerstate == PST_DEAD))
{
break;
}
actor->health = value;
if (actor->player != NULL)
{
actor->player->health = value;
}
// If the health is set to a non-positive value, properly kill the actor.
if (value <= 0)
{
actor->Die(activator, activator);
}
break;
case APROP_Speed:
actor->Speed = value;
break;
case APROP_Damage:
actor->Damage = value;
break;
case APROP_Alpha:
actor->alpha = value;
break;
case APROP_RenderStyle:
for(int i=0; LegacyRenderStyleIndices[i] >= 0; i++)
{
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
if (LegacyRenderStyleIndices[i] == value)
{
actor->RenderStyle = ERenderStyle(i);
break;
}
}
break;
case APROP_Ambush:
if (value) actor->flags |= MF_AMBUSH; else actor->flags &= ~MF_AMBUSH;
break;
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
case APROP_Dropped:
if (value) actor->flags |= MF_DROPPED; else actor->flags &= ~MF_DROPPED;
break;
case APROP_Invulnerable:
if (value) actor->flags2 |= MF2_INVULNERABLE; else actor->flags2 &= ~MF2_INVULNERABLE;
break;
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
case APROP_Notarget:
if (value) actor->flags3 |= MF3_NOTARGET; else actor->flags3 &= ~MF3_NOTARGET;
break;
case APROP_Notrigger:
if (value) actor->flags6 |= MF6_NOTRIGGER; else actor->flags6 &= ~MF6_NOTRIGGER;
break;
case APROP_JumpZ:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->JumpZ = value;
break; // [GRB]
case APROP_ChaseGoal:
if (value)
actor->flags5 |= MF5_CHASEGOAL;
else
actor->flags5 &= ~MF5_CHASEGOAL;
break;
case APROP_Frightened:
if (value)
actor->flags4 |= MF4_FRIGHTENED;
else
actor->flags4 &= ~MF4_FRIGHTENED;
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case APROP_Friendly:
if (value)
{
if (actor->CountsAsKill()) level.total_monsters--;
actor->flags |= MF_FRIENDLY;
}
else
{
actor->flags &= ~MF_FRIENDLY;
if (actor->CountsAsKill()) level.total_monsters++;
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case APROP_SpawnHealth:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
static_cast<APlayerPawn *>(actor)->MaxHealth = value;
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case APROP_Gravity:
actor->gravity = value;
break;
case APROP_SeeSound:
actor->SeeSound = FBehavior::StaticLookupString(value);
break;
case APROP_AttackSound:
actor->AttackSound = FBehavior::StaticLookupString(value);
break;
case APROP_PainSound:
actor->PainSound = FBehavior::StaticLookupString(value);
break;
case APROP_DeathSound:
actor->DeathSound = FBehavior::StaticLookupString(value);
break;
case APROP_ActiveSound:
actor->ActiveSound = FBehavior::StaticLookupString(value);
break;
case APROP_Species:
actor->Species = FBehavior::StaticLookupString(value);
break;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case APROP_Score:
actor->Score = value;
break;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case APROP_NameTag:
actor->SetTag(FBehavior::StaticLookupString(value));
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
break;
case APROP_DamageFactor:
actor->DamageFactor = value;
break;
case APROP_MasterTID:
AActor *other;
other = SingleActorFromTID (value, NULL);
DoSetMaster (actor, other);
break;
case APROP_ScaleX:
actor->scaleX = value;
break;
case APROP_ScaleY:
actor->scaleY = value;
break;
case APROP_Mass:
actor->Mass = value;
break;
case APROP_Accuracy:
actor->accuracy = value;
break;
case APROP_Stamina:
actor->stamina = value;
break;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
default:
// do nothing.
break;
}
}
int DLevelScript::GetActorProperty (int tid, int property)
{
AActor *actor = SingleActorFromTID (tid, activator);
if (actor == NULL)
{
return 0;
}
switch (property)
{
case APROP_Health: return actor->health;
case APROP_Speed: return actor->Speed;
case APROP_Damage: return actor->Damage; // Should this call GetMissileDamage() instead?
case APROP_DamageFactor:return actor->DamageFactor;
case APROP_Alpha: return actor->alpha;
case APROP_RenderStyle: for (int style = STYLE_None; style < STYLE_Count; ++style)
{ // Check for a legacy render style that matches.
if (LegacyRenderStyles[style] == actor->RenderStyle)
{
return LegacyRenderStyleIndices[style];
}
}
// The current render style isn't expressable as a legacy style,
// so pretends it's normal.
return STYLE_Normal;
case APROP_Gravity: return actor->gravity;
case APROP_Invulnerable:return !!(actor->flags2 & MF2_INVULNERABLE);
case APROP_Ambush: return !!(actor->flags & MF_AMBUSH);
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
case APROP_Dropped: return !!(actor->flags & MF_DROPPED);
case APROP_ChaseGoal: return !!(actor->flags5 & MF5_CHASEGOAL);
case APROP_Frightened: return !!(actor->flags4 & MF4_FRIGHTENED);
case APROP_Friendly: return !!(actor->flags & MF_FRIENDLY);
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
case APROP_Notarget: return !!(actor->flags3 & MF3_NOTARGET);
case APROP_Notrigger: return !!(actor->flags6 & MF6_NOTRIGGER);
case APROP_Dormant: return !!(actor->flags2 & MF2_DORMANT);
case APROP_SpawnHealth: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->MaxHealth;
}
else
{
return actor->SpawnHealth();
}
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case APROP_JumpZ: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->JumpZ; // [GRB]
}
else
{
return 0;
}
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case APROP_Score: return actor->Score;
case APROP_MasterTID: return DoGetMasterTID (actor);
case APROP_TargetTID: return (actor->target != NULL)? actor->target->tid : 0;
case APROP_TracerTID: return (actor->tracer != NULL)? actor->tracer->tid : 0;
case APROP_WaterLevel: return actor->waterlevel;
case APROP_ScaleX: return actor->scaleX;
case APROP_ScaleY: return actor->scaleY;
case APROP_Mass: return actor->Mass;
case APROP_Accuracy: return actor->accuracy;
case APROP_Stamina: return actor->stamina;
case APROP_Height: return actor->height;
case APROP_Radius: return actor->radius;
default: return 0;
}
}
int DLevelScript::CheckActorProperty (int tid, int property, int value)
{
AActor *actor = SingleActorFromTID (tid, activator);
const char *string = NULL;
if (actor == NULL)
{
return 0;
}
switch (property)
{
// Default
default: return 0;
// Straightforward integer values:
case APROP_Health:
case APROP_Speed:
case APROP_Damage:
case APROP_DamageFactor:
case APROP_Alpha:
case APROP_RenderStyle:
case APROP_Gravity:
case APROP_SpawnHealth:
case APROP_JumpZ:
Update to ZDoom r1848: - Fixed: The deprecated flag handler for the old bounce flags needs to clear BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags. - Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that friendly monsters could no longer acquire targets by themselves. - Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag. - Added MBF's monster_backing feature as an actor flag: AVOIDMELEE. - Gez's misc. bugs patch: * Moves the dog sound out of the Doom-specific sounds in SNDINFO to address this, * Renames the dog actor to MBFHelperDog to prevent name conflicts, * Adds APROP_Score to CheckActorProperty, * Completes the randomspawner update (the reason I moved the recursion counter out of special1 was that I found some projectiles had this set to them, for example in A_LichAttack, but I forgot to add transfer for them), * Provides centered sprites for beta plasma balls if this is deemed deserving correction. - Added some pieces of MBF's friendly AI. - Cleaned up A_LookEx code and merged most of it with the base functions. The major difference was a common piece of code that was repeated 5 times throughout the code so I moved it into a subfunction. - Changed P_BlockmapSearch to pass a user parameter to its callback so that A_LookEx does not need to store its info inside the actor itself. - fixed: The linetarget CCMD duplicated all of the info CCMD. - fixed: PrintActorInfo crashed due to some incomplete implementation. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@458 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-16 21:17:17 +00:00
case APROP_Score:
case APROP_MasterTID:
case APROP_TargetTID:
case APROP_TracerTID:
case APROP_WaterLevel:
case APROP_ScaleX:
case APROP_ScaleY:
case APROP_Mass:
case APROP_Accuracy:
case APROP_Stamina:
case APROP_Height:
case APROP_Radius:
return (GetActorProperty(tid, property) == value);
// Boolean values need to compare to a binary version of value
case APROP_Ambush:
case APROP_Invulnerable:
case APROP_Dropped:
case APROP_ChaseGoal:
case APROP_Frightened:
case APROP_Friendly:
case APROP_Notarget:
case APROP_Notrigger:
case APROP_Dormant:
return (GetActorProperty(tid, property) == (!!value));
// Strings are not covered by GetActorProperty, so make the check here
case APROP_SeeSound: string = actor->SeeSound; break;
case APROP_AttackSound: string = actor->AttackSound; break;
case APROP_PainSound: string = actor->PainSound; break;
case APROP_DeathSound: string = actor->DeathSound; break;
case APROP_ActiveSound: string = actor->ActiveSound; break;
case APROP_Species: string = actor->GetSpecies(); break;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case APROP_NameTag: string = actor->GetTag(); break;
}
if (string == NULL) string = "";
return (!stricmp(string, FBehavior::StaticLookupString(value)));
}
bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, bool floor)
{
AActor *actor = SingleActorFromTID(tid, activator);
if (actor == NULL)
{
return 0;
}
FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string));
if (tex == NULL)
{ // If the texture we want to check against doesn't exist, then
// they're obviously not the same.
return 0;
}
int i, numff;
FTextureID secpic;
sector_t *sec = actor->Sector;
numff = sec->e->XFloor.ffloors.Size();
if (floor)
{
// Looking through planes from top to bottom
for (i = 0; i < numff; ++i)
{
F3DFloor *ff = sec->e->XFloor.ffloors[i];
if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) &&
actor->z >= ff->top.plane->ZatPoint(actor->x, actor->y))
{ // This floor is beneath our feet.
secpic = *ff->top.texture;
break;
}
}
if (i == numff)
{ // Use sector's floor
secpic = sec->GetTexture(sector_t::floor);
}
}
else
{
fixed_t z = actor->z + actor->height;
// Looking through planes from bottom to top
for (i = numff-1; i >= 0; --i)
{
F3DFloor *ff = sec->e->XFloor.ffloors[i];
if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) &&
z <= ff->bottom.plane->ZatPoint(actor->x, actor->y))
{ // This floor is above our eyes.
secpic = *ff->bottom.texture;
break;
}
}
if (i < 0)
{ // Use sector's ceiling
secpic = sec->GetTexture(sector_t::ceiling);
}
}
return tex == TexMan[secpic];
}
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
enum
{
// These are the original inputs sent by the player.
INPUT_OLDBUTTONS,
INPUT_BUTTONS,
INPUT_PITCH,
INPUT_YAW,
INPUT_ROLL,
INPUT_FORWARDMOVE,
INPUT_SIDEMOVE,
INPUT_UPMOVE,
// These are the inputs, as modified by P_PlayerThink().
// Most of the time, these will match the original inputs, but
// they can be different if a player is frozen or using a
// chainsaw.
MODINPUT_OLDBUTTONS,
MODINPUT_BUTTONS,
MODINPUT_PITCH,
MODINPUT_YAW,
MODINPUT_ROLL,
MODINPUT_FORWARDMOVE,
MODINPUT_SIDEMOVE,
MODINPUT_UPMOVE
};
int DLevelScript::GetPlayerInput(int playernum, int inputnum)
{
player_t *p;
if (playernum < 0)
{
if (activator == NULL)
{
return 0;
}
Update to ZDoom r1222 - Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are automatically used by all inventory classes. - The previous change made it necessary to replace all TryPickup calls with another function that just calls TryPickup. - Fixed: AInventory::TryPickup can change the toucher so this must be reported to subclasses calling the super function. Changed TryPickup to pass the toucher pointer by reference. - Prefixed all names of CQ decorations with Chex after seeing some conflicts with PWADs. - Removed Chex Quest actors that were just unaltered duplicates of Doom's. - Added detection for Chex Quest 3 IWAD. - Cleaned up M_QuitGame because the code was almost incomprehensible and I wanted to add CQ3's new quit messages. - Added Chex Quest obituaries and a few other messages from CQ3. - Fixed: drawbar improperly clipped images when not in the top left quadrant. - Fixed: Crouching no longer worked due to a bug introduced by the player input code. - Added GetPlayerInput() for examining a player's inputs from ACS. Most buttons are now passed across the network, and there are four new user buttons specifically for use with this command. Also defined +zoom and +reload for future implementation. - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. - Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the fact that NVidia's don't report it, even though they support it. If there are any cards that no longer have antialised lines on the automap, please let me know. - Added vid_hwaalines cvar to force antialiased lines off for the Direct3D renderer, in case it doesn't really support them. - Fixed: The new rolloff values being stored in FSoundChan need to be serialized for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. - Took some more non-FMOD related code out of fmodsound.cpp, including the code that checks for raw and Doom sounds. This means that sfxinfo_t is no longer needed in the SoundRenderer class so I took out all references to it. - Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing to the rolloff information back to NULL when starting the sound fails. - Fixed: Rolloff information was taken from the sfxinfo that contained the actual sound data, not the one that was used for starting the sound. - Fixed: Chex Quest's Super Bootspork was missing the pickup message. - Added missing Strife automap colors for items and non-monsters. - Fixed: GetMSLength didn't resolve random and player sounds. - Moved sound aliasing code out of fmodsound.cpp into S_LoadSound. - Fixed: The tagged version of TranslucentLine took the information for additive translucency from the tagged linedef, not the control linedef. - Added check for additive translucency to TRANMAP checking. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
p = activator->player;
}
else if (playernum >= MAXPLAYERS || !playeringame[playernum])
{
return 0;
}
else
{
p = &players[playernum];
}
if (p == NULL)
{
return 0;
}
switch (inputnum)
{
case INPUT_OLDBUTTONS: return p->original_oldbuttons; break;
case INPUT_BUTTONS: return p->original_cmd.buttons; break;
case INPUT_PITCH: return p->original_cmd.pitch; break;
case INPUT_YAW: return p->original_cmd.yaw; break;
case INPUT_ROLL: return p->original_cmd.roll; break;
case INPUT_FORWARDMOVE: return p->original_cmd.forwardmove; break;
case INPUT_SIDEMOVE: return p->original_cmd.sidemove; break;
case INPUT_UPMOVE: return p->original_cmd.upmove; break;
case MODINPUT_OLDBUTTONS: return p->oldbuttons; break;
case MODINPUT_BUTTONS: return p->cmd.ucmd.buttons; break;
case MODINPUT_PITCH: return p->cmd.ucmd.pitch; break;
case MODINPUT_YAW: return p->cmd.ucmd.yaw; break;
case MODINPUT_ROLL: return p->cmd.ucmd.roll; break;
case MODINPUT_FORWARDMOVE: return p->cmd.ucmd.forwardmove; break;
case MODINPUT_SIDEMOVE: return p->cmd.ucmd.sidemove; break;
case MODINPUT_UPMOVE: return p->cmd.ucmd.upmove; break;
default: return 0; break;
}
}
Update to ZDoom r1312: - Fixed: The save percentage for Doom's green armor was slightly too low which caused roundoff errors that made it less than 1/3 effective. - Added support for "RRGGBB" strings to V_GetColor. - Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly. - Changed GetSpriteIndex to cache the last used sprite name so that the code using this function doesn't have to do it itself. - Moved some more code for the state parser into p_states.cpp. - Fixed: TDeletingArray should not try to delete NULL pointers. - Added binary (b) and hexadecimal (x) cast types for ACS's various print statements. - Added ClassifyActor(tid) ACS builtin function. This takes a TID and returns a set of bits describing the actor. If TID is 0, it returns information about the activator. If there is more than one actor with the given TID, only the first one is considered. Currently defined bits are: ACTOR_NONE No actors with this TID exist (only when TID is not 0). ACTOR_WORLD Activator is the world (only when TID is 0). ACTOR_PLAYER Actor is a player (includes bots and voodoo dolls). ACTOR_BOT Actor is a bot. ACTOR_VOODOODOLL Actor is a voodoo doll. ACTOR_MONSTER Actor is a monster. ACTOR_ALIVE Actor is alive (players/monsters only). ACTOR_DEAD Actor is dead (players/monsters only). ACTOR_MISSILE Actor is a missile. ACTOR_GENERIC Actor exists, but no further information is available. - Moved ExpandEnvVars() from d_main.cpp to cmdlib.cpp. - AutoExec paths now support the same variable expansion as the search paths. Additionally, on Windows, the default autoexec path is now relative to $PROGDIR, rather than using a fixed path to the executable's current directory. - All usable Autoload and AutoExec sections are now created at the top of the config file along with some brief explanatory notes so they are readily visible to anyone who wants to edit them. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@254 b0f79afe-0144-0410-b225-9a4edf0717df
2008-12-07 16:38:02 +00:00
enum
{
ACTOR_NONE = 0x00000000,
ACTOR_WORLD = 0x00000001,
ACTOR_PLAYER = 0x00000002,
ACTOR_BOT = 0x00000004,
ACTOR_VOODOODOLL = 0x00000008,
ACTOR_MONSTER = 0x00000010,
ACTOR_ALIVE = 0x00000020,
ACTOR_DEAD = 0x00000040,
ACTOR_MISSILE = 0x00000080,
ACTOR_GENERIC = 0x00000100
};
int DLevelScript::DoClassifyActor(int tid)
{
AActor *actor;
int classify;
if (tid == 0)
{
actor = activator;
if (actor == NULL)
{
return ACTOR_WORLD;
}
}
else
{
FActorIterator it(tid);
actor = it.Next();
}
if (actor == NULL)
{
return ACTOR_NONE;
}
classify = 0;
if (actor->player != NULL)
{
classify |= ACTOR_PLAYER;
if (actor->player->playerstate == PST_DEAD)
{
classify |= ACTOR_DEAD;
}
else
{
classify |= ACTOR_ALIVE;
}
if (actor->player->mo != actor)
{
classify |= ACTOR_VOODOODOLL;
}
if (actor->player->isbot)
{
classify |= ACTOR_BOT;
}
}
else if (actor->flags3 & MF3_ISMONSTER)
{
classify |= ACTOR_MONSTER;
if (actor->health <= 0)
{
classify |= ACTOR_DEAD;
}
else
{
classify |= ACTOR_ALIVE;
}
}
else if (actor->flags & MF_MISSILE)
{
classify |= ACTOR_MISSILE;
}
else
{
classify |= ACTOR_GENERIC;
}
return classify;
}
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
enum EACSFunctions
{
ACSF_GetLineUDMFInt=1,
ACSF_GetLineUDMFFixed,
ACSF_GetThingUDMFInt,
ACSF_GetThingUDMFFixed,
ACSF_GetSectorUDMFInt,
ACSF_GetSectorUDMFFixed,
ACSF_GetSideUDMFInt,
ACSF_GetSideUDMFFixed,
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
ACSF_GetActorVelX,
ACSF_GetActorVelY,
ACSF_GetActorVelZ,
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
ACSF_SetActivator,
ACSF_SetActivatorToTarget,
ACSF_GetActorViewHeight,
ACSF_GetChar,
- Update to ZDoom r1532: - Swapped snes_spc out for the full Game Music Emu library. - Fixed: The Hexen status bar still uses MAX_MANA for some calculations instead of MaxAmount. - Added Blzut3's submission for displaying underwater stats in SBARINFO. - Added Gez's AMMO_CHECKBOTH submission. - Added Gez's THRUSPECIES submission. - Added loading directories into the lump directory. - fixed: The Dehacked parser could not parse flag values with the highest bit set because it used atoi to convert the string into a number. - fixed: bouncing sounds were limited to inventory items. - Rewrote IWAD detection code to use the ResourceFile classes instead of reading the WAD directory directly. As a side effect it should now be possible to use Zip and 7z for IWADs, too. - Added 'EndTitle' nextmap option which goes to the regular title loop after the game has finished. - Added NOBOSSRIP flag. Note: we are now at flags6! - Added SetSkyScrollSpeed(int skyplane, fixed speed) ACS function. - Added THRUACTORS flag that disables all actor<->actor collision detection. - Added DONTSEEKINVISIBLE flag for missiles that can't home in on invisible targets. - Added SFX_TRANSFERPITCH flag to A_SpawnItemEx. - Added Ultimate Freedoom IWAD detection. - Added GetAirSupply and SetAirSupply functions to ACS. - Fixed: The *surface sound was not played when drowning was switched off by setting the level's air supply to 0. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@338 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-04 13:59:08 +00:00
ACSF_GetAirSupply,
ACSF_SetAirSupply,
ACSF_SetSkyScrollSpeed,
ACSF_GetArmorType,
ACSF_SpawnSpotForced,
ACSF_SpawnSpotFacingForced,
ACSF_CheckActorProperty,
Update to ZDoom r1799: - Added PinkSilver's SetActorVelocity code submission (with optimizations.) - Added the frandom decorate function, which is exactly like random except that it works with floating point instead of integers. - Split the bounce types completely into separate flags and consolidated the various bounce-related flags spread across the different Actor flags field into a single BounceFlags field. - Fixed: P_BounceWall() should calculate the XY velocity using a real square root and not P_AproxDistance(), because the latter can cause them to speed up or slow down. - made menu dimming a mapping option but kept the CVARS as user override. - Fixed: R_CreatePlayerTranslation() only initialized the first truecolor palette entry. - Fixed: D3DPal::Update() used BorderColor == 0 as the condition for skipping an entry. It should be SM14 as in UploadPalette(). - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do for you, GCC!) The AMD feature flags weren't stored anywhere, either; not that it really matters. - Add an alternate PIC-compliant __cpuid macro in x86.cpp. - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads from DMX sounds. - Fixed: PNGTexture must not use the FArchive >> operator as a short hand for reading 4-byte integers, because that operator works with little endian numbers--a no-op on Intel processors, but bad joojoo on PowerPCs. - fixed: Weapons must first check if they can be switched and afterwards if they can be fired. These checks were reversed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@443 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-06 16:58:38 +00:00
ACSF_SetActorVelocity,
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
ACSF_SetUserVariable,
ACSF_GetUserVariable,
ACSF_Radius_Quake2,
ACSF_CheckActorClass,
ACSF_SetUserArray,
ACSF_GetUserArray,
- fixed: Calculating sector heights with transparent door hacks was wrong. - fixed: Sector height was wrong for sectors that have a slope transfer for a horizontal plane. - better error reporting for shader compile errors. Update to ZDoom r1942: - Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch, use a larger aiming range, ignore non-targets in P_AimLineAttack(), and aim at the target anyway even if P_AimLineAttack() decides it has no chance of hitting. - Added another parameter to P_AimLineAttack(): A target to be aimed at. If this is non-NULL, then all actors between the shooter and the target will be ignored. - Added new sound sequence ACS functions: SoundSequenceOnActor(int tid, string seqname); SoundSequenceOnSector(int tag, string seqname, int location); SoundSequenceOnPolyobj(int polynum, string seqname); SoundSequenceOnSector takes an extra parameter that specifies where in the sector the sound comes from (floor, ceiling, interior, or all of it). See the SECSEQ defines in zdefs.acs. - Fixed: R_RenderDecal() must save various Wall globals, because the originals may still be needed. In particular, when drawing a seg with a midtexture is split by foreground geometry, the first drawseg generated from it will have the correct WallSZ1,2 values, but subsequent ones will have whatever R_RenderDecal() left behind. These values are used to calculate the upper and lower bounds of the midtexture. (Ironically, my work to Build-ify things had done away with these globals, but that's gone now.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
ACSF_SoundSequenceOnActor,
ACSF_SoundSequenceOnSector,
ACSF_SoundSequenceOnPolyobj,
ACSF_GetPolyobjX,
ACSF_GetPolyobjY,
ACSF_CheckSight,
ACSF_SpawnForced,
ACSF_AnnouncerSound, // Skulltag
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
ACSF_SetPointer,
* Updated to ZDoom r3370: - Fixed: Forgot to initialize inventoryItem to NULL in DrawBar. - Fixed: Runtime error on Mac OS X. For whatever reason merely having the call to CFUserNotificationDisplayAlert() in I_FatalError caused exception handling to quit working. Moving it to a separate file seems to fix this. Also removed the warning about FRenderer having a non-virtual destructor. - Added pukename console command. This is mostly the same as puke, except the scripts are named, and to run a script using ACS_ExecuteAlways, you need to add "always" after the script name but before any arguments. e.g.: « pukename "A Script" 1 » will run the script "A Script" with a single argument of 1, provided the script is not already running. « pukename "A Script" always 1 » Will always run the script "A Script" with a single argument of 1. - Added action functions that work with script names instead of script numbers. They are named the same as their ACS function equivalents. e.g. From DECORATE, you can now use ACS_NamedExecuteAlways to run a script with a name. - Make deferred scripts work with named scripts. - Added ACS_Named* function variants of the ACS_* specials that take script names instead of numbers. As these are functions and not specials, they can only be used from inside ACS. - Fixed: Mac universal binary build. (I actually just realized that my DRDTeam build script ended up just working because of this modification.) - Allow any parameterized SBarInfo value to use parentheses to help make the syntax a little more consistent. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1285 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:26:03 +00:00
ACSF_ACS_NamedExecute,
ACSF_ACS_NamedSuspend,
ACSF_ACS_NamedTerminate,
ACSF_ACS_NamedLockedExecute,
ACSF_ACS_NamedLockedExecuteDoor,
ACSF_ACS_NamedExecuteWithResult,
ACSF_ACS_NamedExecuteAlways,
ACSF_UniqueTID,
ACSF_IsTIDUsed,
ACSF_Sqrt,
ACSF_FixedSqrt,
ACSF_VectorLength,
ACSF_SetHUDClipRect,
ACSF_SetHUDWrapWidth,
// ZDaemon
ACSF_GetTeamScore = 19620, // (int team)
ACSF_SetTeamScore, // (int team, int value)
Update to ZDoom r1585: - Added ACS GetChar function. - Added Gez's submission for polyobjects being able to crush corpses but made it an explicit MAPINFO option only. - Changed APlayerPawn::DamageFade to a PalEntry from 3 floats. - Removed #pragma warnings from cmdlib.h and fixed the places where they were still triggered. These #pragmas were responsible for >90% of the GCC warnings that were not listed in VC++. - Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the parameter handling of the sound functions for attenuation was changed. Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values. Also added the option to specify attenuation with direct values in addition to the predefined names. - fixed a few Heretic actors: * The pod generator's attacksound was wrong * The teleglitter generators need different flags if they are supposed to work with z-aware spawning of the glitter. * The knight's axes need the THRUGHOST flag. - Fixed non-POD passing in G_BuildSaveName() and other things GCC warned about. - Added support for imploded zips. - Fixed: Some missile spawning functions ignored the FastSpeed setting. - Fixed: P_CheckSwitchRange tried to access a line's backsector without checking if it is valid. - Fixed: Fast projectile could not be frozen by the Time freezer. - Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight, SetActivator, SetActivatorToTarget. - Added Species property for actors and separated Hexen's Demon1 and Demon2 into different species. - Added handling for UDMF user keys. - Added support for ACS functions that can be defined without recompiling ACC. - Fixed: The short lump name for embedded files must be cleared so that they are not found by a normal lump search. - Added AProp_Notarget actor property. - Fixed: TraceBleed was missing a NULL pointer check, - Fixed: P_RandomChaseDir could crash for friendly monsters that belong to a player which left the game. - Changed A_PodGrow so that it plays the generator's attack sound instead of "misc/podgrow". - Added transference of a select few flags from PowerProtection to its owner. - Added actor type parameters to A_PodPain() and A_MakePod(). - The savegame path is now passed through NicePath(), since it's user- specifiable. - Added save_dir cvar. When non-empty, it controls where savegames go. - SBARINFO update: * Added the ability to center things with fullscreenoffsets enabled. Due to some limitations the syntax is [-]<integer> [+ center]. * Fixed: the translucent flag on drawinventorybar didn't work quite right. * Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The fullscreen inventory bar wasn't scaled correctly. - fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines. - Added more compatibility settings, submitted by Gez. - Fixed: Doom's fullscreen HUD was limited to 6 keys. - Made 'next endgame' work again for cases where it is supposed to be the same as 'next endgame4'. - GCC nitpick fix: Classes being used as template parameters may not be defined locally in a function. Fixed FWadFile::SetNamespace for that. - Improved error reporting for incorrect textures in maps. - Fixed: When music was stopped this was not set in the global music state. - Fixed: Friendly monsters did not target enemy players in deathmatch. - Fixed: Completely empty patches (8 0-bytes) could not be handled by the texture manager. They now get assigned a new FEmptyTexture object that is just a 1x1 pixel transparent texture. - Fixed: Multiple namespace markers of the same type were no longer detected. - Fixed sprite renaming. - Maps defined with Hexen-style MAPINFOs now run their scripts in the proper order. - Fixed: FWadCollection::CheckNumForName() read the lump each iteration before checking for the end marker. On 32-bit systems, this is -1, but on 64-bit systems, it is a very large integer that is highly unlikely to be in mapped memory. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
};
int DLevelScript::SideFromID(int id, int side)
{
if (side != 0 && side != 1) return -1;
if (id == 0)
{
if (activationline == NULL) return -1;
if (activationline->sidedef[side] == NULL) return -1;
return activationline->sidedef[side]->Index;
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
}
else
{
int line = P_FindLineFromID(id, -1);
if (line == -1) return -1;
if (lines[line].sidedef[side] == NULL) return -1;
return lines[line].sidedef[side]->Index;
Update to ZDoom r1585: - Added ACS GetChar function. - Added Gez's submission for polyobjects being able to crush corpses but made it an explicit MAPINFO option only. - Changed APlayerPawn::DamageFade to a PalEntry from 3 floats. - Removed #pragma warnings from cmdlib.h and fixed the places where they were still triggered. These #pragmas were responsible for >90% of the GCC warnings that were not listed in VC++. - Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the parameter handling of the sound functions for attenuation was changed. Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values. Also added the option to specify attenuation with direct values in addition to the predefined names. - fixed a few Heretic actors: * The pod generator's attacksound was wrong * The teleglitter generators need different flags if they are supposed to work with z-aware spawning of the glitter. * The knight's axes need the THRUGHOST flag. - Fixed non-POD passing in G_BuildSaveName() and other things GCC warned about. - Added support for imploded zips. - Fixed: Some missile spawning functions ignored the FastSpeed setting. - Fixed: P_CheckSwitchRange tried to access a line's backsector without checking if it is valid. - Fixed: Fast projectile could not be frozen by the Time freezer. - Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight, SetActivator, SetActivatorToTarget. - Added Species property for actors and separated Hexen's Demon1 and Demon2 into different species. - Added handling for UDMF user keys. - Added support for ACS functions that can be defined without recompiling ACC. - Fixed: The short lump name for embedded files must be cleared so that they are not found by a normal lump search. - Added AProp_Notarget actor property. - Fixed: TraceBleed was missing a NULL pointer check, - Fixed: P_RandomChaseDir could crash for friendly monsters that belong to a player which left the game. - Changed A_PodGrow so that it plays the generator's attack sound instead of "misc/podgrow". - Added transference of a select few flags from PowerProtection to its owner. - Added actor type parameters to A_PodPain() and A_MakePod(). - The savegame path is now passed through NicePath(), since it's user- specifiable. - Added save_dir cvar. When non-empty, it controls where savegames go. - SBARINFO update: * Added the ability to center things with fullscreenoffsets enabled. Due to some limitations the syntax is [-]<integer> [+ center]. * Fixed: the translucent flag on drawinventorybar didn't work quite right. * Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The fullscreen inventory bar wasn't scaled correctly. - fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines. - Added more compatibility settings, submitted by Gez. - Fixed: Doom's fullscreen HUD was limited to 6 keys. - Made 'next endgame' work again for cases where it is supposed to be the same as 'next endgame4'. - GCC nitpick fix: Classes being used as template parameters may not be defined locally in a function. Fixed FWadFile::SetNamespace for that. - Improved error reporting for incorrect textures in maps. - Fixed: When music was stopped this was not set in the global music state. - Fixed: Friendly monsters did not target enemy players in deathmatch. - Fixed: Completely empty patches (8 0-bytes) could not be handled by the texture manager. They now get assigned a new FEmptyTexture object that is just a 1x1 pixel transparent texture. - Fixed: Multiple namespace markers of the same type were no longer detected. - Fixed sprite renaming. - Maps defined with Hexen-style MAPINFOs now run their scripts in the proper order. - Fixed: FWadCollection::CheckNumForName() read the lump each iteration before checking for the end marker. On 32-bit systems, this is -1, but on 64-bit systems, it is a very large integer that is highly unlikely to be in mapped memory. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
}
}
int DLevelScript::LineFromID(int id)
{
if (id == 0)
{
if (activationline == NULL) return -1;
return int(activationline - lines);
}
else
{
return P_FindLineFromID(id, -1);
}
}
static void SetUserVariable(AActor *self, FName varname, int index, int value)
{
PSymbol *sym = self->GetClass()->Symbols.FindSymbol(varname, true);
int max;
PSymbolVariable *var;
if (sym == NULL || sym->SymbolType != SYM_Variable ||
!(var = static_cast<PSymbolVariable *>(sym))->bUserVar)
{
return;
}
if (var->ValueType.Type == VAL_Int)
{
max = 1;
}
else if (var->ValueType.Type == VAL_Array && var->ValueType.BaseType == VAL_Int)
{
max = var->ValueType.size;
}
else
{
return;
}
// Set the value of the specified user variable.
if (index >= 0 && index < max)
{
((int *)(reinterpret_cast<BYTE *>(self) + var->offset))[index] = value;
}
}
static int GetUserVariable(AActor *self, FName varname, int index)
{
PSymbol *sym = self->GetClass()->Symbols.FindSymbol(varname, true);
int max;
PSymbolVariable *var;
if (sym == NULL || sym->SymbolType != SYM_Variable ||
!(var = static_cast<PSymbolVariable *>(sym))->bUserVar)
{
return 0;
}
if (var->ValueType.Type == VAL_Int)
{
max = 1;
}
else if (var->ValueType.Type == VAL_Array && var->ValueType.BaseType == VAL_Int)
{
max = var->ValueType.size;
}
else
{
return 0;
}
// Get the value of the specified user variable.
if (index >= 0 && index < max)
{
return ((int *)(reinterpret_cast<BYTE *>(self) + var->offset))[index];
}
return 0;
}
Update to ZDoom r1585: - Added ACS GetChar function. - Added Gez's submission for polyobjects being able to crush corpses but made it an explicit MAPINFO option only. - Changed APlayerPawn::DamageFade to a PalEntry from 3 floats. - Removed #pragma warnings from cmdlib.h and fixed the places where they were still triggered. These #pragmas were responsible for >90% of the GCC warnings that were not listed in VC++. - Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the parameter handling of the sound functions for attenuation was changed. Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values. Also added the option to specify attenuation with direct values in addition to the predefined names. - fixed a few Heretic actors: * The pod generator's attacksound was wrong * The teleglitter generators need different flags if they are supposed to work with z-aware spawning of the glitter. * The knight's axes need the THRUGHOST flag. - Fixed non-POD passing in G_BuildSaveName() and other things GCC warned about. - Added support for imploded zips. - Fixed: Some missile spawning functions ignored the FastSpeed setting. - Fixed: P_CheckSwitchRange tried to access a line's backsector without checking if it is valid. - Fixed: Fast projectile could not be frozen by the Time freezer. - Added several new ACS functions: GetActorMomX/Y/Z, GetActorViewHeight, SetActivator, SetActivatorToTarget. - Added Species property for actors and separated Hexen's Demon1 and Demon2 into different species. - Added handling for UDMF user keys. - Added support for ACS functions that can be defined without recompiling ACC. - Fixed: The short lump name for embedded files must be cleared so that they are not found by a normal lump search. - Added AProp_Notarget actor property. - Fixed: TraceBleed was missing a NULL pointer check, - Fixed: P_RandomChaseDir could crash for friendly monsters that belong to a player which left the game. - Changed A_PodGrow so that it plays the generator's attack sound instead of "misc/podgrow". - Added transference of a select few flags from PowerProtection to its owner. - Added actor type parameters to A_PodPain() and A_MakePod(). - The savegame path is now passed through NicePath(), since it's user- specifiable. - Added save_dir cvar. When non-empty, it controls where savegames go. - SBARINFO update: * Added the ability to center things with fullscreenoffsets enabled. Due to some limitations the syntax is [-]<integer> [+ center]. * Fixed: the translucent flag on drawinventorybar didn't work quite right. * Fixed: Extremely minor inaccuracy in the Doom SBarInfo code. The fullscreen inventory bar wasn't scaled correctly. - fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines. - Added more compatibility settings, submitted by Gez. - Fixed: Doom's fullscreen HUD was limited to 6 keys. - Made 'next endgame' work again for cases where it is supposed to be the same as 'next endgame4'. - GCC nitpick fix: Classes being used as template parameters may not be defined locally in a function. Fixed FWadFile::SetNamespace for that. - Improved error reporting for incorrect textures in maps. - Fixed: When music was stopped this was not set in the global music state. - Fixed: Friendly monsters did not target enemy players in deathmatch. - Fixed: Completely empty patches (8 0-bytes) could not be handled by the texture manager. They now get assigned a new FEmptyTexture object that is just a 1x1 pixel transparent texture. - Fixed: Multiple namespace markers of the same type were no longer detected. - Fixed sprite renaming. - Maps defined with Hexen-style MAPINFOs now run their scripts in the proper order. - Fixed: FWadCollection::CheckNumForName() read the lump each iteration before checking for the end marker. On 32-bit systems, this is -1, but on 64-bit systems, it is a very large integer that is highly unlikely to be in mapped memory. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@325 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-15 18:02:01 +00:00
int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
{
AActor *actor;
switch(funcIndex)
{
case ACSF_GetLineUDMFInt:
return GetUDMFInt(UDMF_Line, LineFromID(args[0]), FBehavior::StaticLookupString(args[1]));
case ACSF_GetLineUDMFFixed:
return GetUDMFFixed(UDMF_Line, LineFromID(args[0]), FBehavior::StaticLookupString(args[1]));
case ACSF_GetThingUDMFInt:
case ACSF_GetThingUDMFFixed:
return 0; // Not implemented yet
case ACSF_GetSectorUDMFInt:
return GetUDMFInt(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
case ACSF_GetSectorUDMFFixed:
return GetUDMFFixed(UDMF_Sector, P_FindSectorFromTag(args[0], -1), FBehavior::StaticLookupString(args[1]));
case ACSF_GetSideUDMFInt:
return GetUDMFInt(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
case ACSF_GetSideUDMFFixed:
return GetUDMFFixed(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
case ACSF_GetActorVelX:
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
actor = SingleActorFromTID(args[0], activator);
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
return actor != NULL? actor->velx : 0;
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
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
case ACSF_GetActorVelY:
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
actor = SingleActorFromTID(args[0], activator);
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
return actor != NULL? actor->vely : 0;
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
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
case ACSF_GetActorVelZ:
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
actor = SingleActorFromTID(args[0], activator);
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
return actor != NULL? actor->velz : 0;
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
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
case ACSF_SetPointer:
if (activator)
{
AActor *ptr = SingleActorFromTID(args[1], activator);
if (argCount > 2)
{
ptr = COPY_AAPTR(ptr, args[2]);
}
if (ptr == activator) ptr = NULL;
ASSIGN_AAPTR(activator, args[0], ptr, (argCount > 3) ? args[3] : 0);
return ptr != NULL;
}
return 0;
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
case ACSF_SetActivator:
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
if (argCount > 1 && args[1] != AAPTR_DEFAULT) // condition (x != AAPTR_DEFAULT) is essentially condition (x).
{
activator = COPY_AAPTR(SingleActorFromTID(args[0], activator), args[1]);
}
else
{
activator = SingleActorFromTID(args[0], NULL);
}
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
return activator != NULL;
case ACSF_SetActivatorToTarget:
// [KS] I revised this a little bit
actor = SingleActorFromTID(args[0], activator);
if (actor != NULL)
{
if (actor->player != NULL && actor->player->playerstate == PST_LIVE)
{
P_BulletSlope(actor, &actor);
}
else
{
actor = actor->target;
}
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
if (actor != NULL) // [FDARI] moved this (actor != NULL)-branch inside the other, so that it is only tried when it can be true
{
activator = actor;
return 1;
}
}
return 0;
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
case ACSF_GetActorViewHeight:
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
actor = SingleActorFromTID(args[0], activator);
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 (actor != NULL)
{
if (actor->player != NULL)
{
return actor->player->mo->ViewHeight + actor->player->crouchviewdelta;
}
else
{
return actor->GetClass()->Meta.GetMetaFixed(AMETA_CameraHeight, actor->height/2);
}
}
else return 0;
case ACSF_GetChar:
{
const char *p = FBehavior::StaticLookupString(args[0]);
if (p != NULL && args[1] >= 0 && args[1] < int(strlen(p)))
{
return p[args[1]];
}
else
{
return 0;
}
}
- Update to ZDoom r1532: - Swapped snes_spc out for the full Game Music Emu library. - Fixed: The Hexen status bar still uses MAX_MANA for some calculations instead of MaxAmount. - Added Blzut3's submission for displaying underwater stats in SBARINFO. - Added Gez's AMMO_CHECKBOTH submission. - Added Gez's THRUSPECIES submission. - Added loading directories into the lump directory. - fixed: The Dehacked parser could not parse flag values with the highest bit set because it used atoi to convert the string into a number. - fixed: bouncing sounds were limited to inventory items. - Rewrote IWAD detection code to use the ResourceFile classes instead of reading the WAD directory directly. As a side effect it should now be possible to use Zip and 7z for IWADs, too. - Added 'EndTitle' nextmap option which goes to the regular title loop after the game has finished. - Added NOBOSSRIP flag. Note: we are now at flags6! - Added SetSkyScrollSpeed(int skyplane, fixed speed) ACS function. - Added THRUACTORS flag that disables all actor<->actor collision detection. - Added DONTSEEKINVISIBLE flag for missiles that can't home in on invisible targets. - Added SFX_TRANSFERPITCH flag to A_SpawnItemEx. - Added Ultimate Freedoom IWAD detection. - Added GetAirSupply and SetAirSupply functions to ACS. - Fixed: The *surface sound was not played when drowning was switched off by setting the level's air supply to 0. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@338 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-04 13:59:08 +00:00
case ACSF_GetAirSupply:
{
if (args[0] < 0 || args[0] >= MAXPLAYERS || !playeringame[args[0]])
{
return 0;
}
else
{
return players[args[0]].air_finished - level.time;
}
}
case ACSF_SetAirSupply:
{
if (args[0] < 0 || args[0] >= MAXPLAYERS || !playeringame[args[0]])
{
return 0;
}
else
{
players[args[0]].air_finished = args[1] + level.time;
return 1;
}
}
case ACSF_SetSkyScrollSpeed:
{
if (args[0] == 1) level.skyspeed1 = FIXED2FLOAT(args[1]);
else if (args[0] == 2) level.skyspeed2 = FIXED2FLOAT(args[1]);
return 1;
}
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
case ACSF_GetArmorType:
{
if (args[1] < 0 || args[1] >= MAXPLAYERS || !playeringame[args[1]])
{
return 0;
}
else
{
FName p(FBehavior::StaticLookupString(args[0]));
ABasicArmor * armor = (ABasicArmor *) players[args[1]].mo->FindInventory(NAME_BasicArmor);
Update to ZDoom r1669: - added a compatibility option to restore the original Heretic bug where a Minotaur couldn't spawn floor flames when standing in water having its feet clipped. - added vid_vsync to display options. - fixed: Animations of type 'Range' must be disabled if the textures don't come from the same definition unit (i.e both containing file and use type are identical.) - changed: Item pushing is now only done once per P_XYMovement call. - Increased the push factor of Heretic's pod to 0.5 so that its behavior more closely matches the original which depended on several bugs in the engine. - Removed damage thrust clamping in P_DamageMobj and changed the thrust calculation to use floats to prevent overflows. The prevention of the overflows was the only reason the clamping was done. - Added Raven's dagger-like vector sprite for the player to the automap code. - Changed wad namespacing so that wads with a missing end marker will be loaded as if they had one more lump with that end marker. This matches the behaviour of previously released ZDooms. (The warning is still present, so there's no excuse to release more wads like this.) - Moved Raw Input processing into a seperate method of FInputDevice so that all the devices can share the same setup code. - Removed F16 mapping for SDL, because I guess it's not present in SDL 1.2. - Added Gez's Skulltag feature patch, including: * BUMPSPECIAL flag: actors with this flag will run their special if collided on by a player * WEAPON.NOAUTOAIM flag, though it is restricted to attacks that spawn a missile (it will not affect autoaim settings for a hitscan or railgun, and that's deliberate) * A_FireSTGrenade codepointer, extended to be parameterizable * The grenade (as the default actor for A_FireSTGrenade) * Protective armors à la RedArmor: they work with a DamageFactor; for example to recreate the RedArmor from Skulltag, copy its code from skulltag.pk3 but remove the "native" keyword and add DamageFactor "Fire" 0.1 to its properties. - Fixed: I_ShutdownInput must NULL all pointers because it can be called twice if an ENDOOM screen is displayed. - Fixed: R_DrawSkyStriped used frontyScale without initializing it first. - Fixed: P_LineAttack may not check the puff actor for MF6_FORCEPAIN because it's not necessarily spawned yet. - Fixed: FWeaponSlots::PickNext/PrevWeapon must be limited to one iteration through the weapon slots. Otherwise they will hang if there's no weapons in a player's inventory. - Added Line_SetTextureScale. - Fixed: sv_smartaim 3 treated the player like a shootable decoration. - Added A_CheckIfInTargetLOS - Removed redundant A_CheckIfTargetInSight. - Fixed: The initial play of a GME song always started track 0. - Fixed: The RAWINPUT buffer that GetRawInputData() fills in is 40 bytes on Win32 but 48 bytes on Win64, so Raw Mouse on x64 builds was getting random data off the stack because I also interpreted the error return incorrectly. - added parameter to A_FadeOut so that removing the actor can be made an option. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@344 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-14 18:05:00 +00:00
if (armor && armor->ArmorType == p) return armor->Amount;
}
return 0;
}
case ACSF_SpawnSpotForced:
return DoSpawnSpot(args[0], args[1], args[2], args[3], true);
case ACSF_SpawnSpotFacingForced:
return DoSpawnSpotFacing(args[0], args[1], args[2], true);
case ACSF_CheckActorProperty:
return (CheckActorProperty(args[0], args[1], args[2]));
Update to ZDoom r1799: - Added PinkSilver's SetActorVelocity code submission (with optimizations.) - Added the frandom decorate function, which is exactly like random except that it works with floating point instead of integers. - Split the bounce types completely into separate flags and consolidated the various bounce-related flags spread across the different Actor flags field into a single BounceFlags field. - Fixed: P_BounceWall() should calculate the XY velocity using a real square root and not P_AproxDistance(), because the latter can cause them to speed up or slow down. - made menu dimming a mapping option but kept the CVARS as user override. - Fixed: R_CreatePlayerTranslation() only initialized the first truecolor palette entry. - Fixed: D3DPal::Update() used BorderColor == 0 as the condition for skipping an entry. It should be SM14 as in UploadPalette(). - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do for you, GCC!) The AMD feature flags weren't stored anywhere, either; not that it really matters. - Add an alternate PIC-compliant __cpuid macro in x86.cpp. - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads from DMX sounds. - Fixed: PNGTexture must not use the FArchive >> operator as a short hand for reading 4-byte integers, because that operator works with little endian numbers--a no-op on Intel processors, but bad joojoo on PowerPCs. - fixed: Weapons must first check if they can be switched and afterwards if they can be fired. These checks were reversed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@443 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-06 16:58:38 +00:00
case ACSF_SetActorVelocity:
if (args[0] == 0)
{
P_Thing_SetVelocity(activator, args[1], args[2], args[3], !!args[4], !!args[5]);
Update to ZDoom r1799: - Added PinkSilver's SetActorVelocity code submission (with optimizations.) - Added the frandom decorate function, which is exactly like random except that it works with floating point instead of integers. - Split the bounce types completely into separate flags and consolidated the various bounce-related flags spread across the different Actor flags field into a single BounceFlags field. - Fixed: P_BounceWall() should calculate the XY velocity using a real square root and not P_AproxDistance(), because the latter can cause them to speed up or slow down. - made menu dimming a mapping option but kept the CVARS as user override. - Fixed: R_CreatePlayerTranslation() only initialized the first truecolor palette entry. - Fixed: D3DPal::Update() used BorderColor == 0 as the condition for skipping an entry. It should be SM14 as in UploadPalette(). - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do for you, GCC!) The AMD feature flags weren't stored anywhere, either; not that it really matters. - Add an alternate PIC-compliant __cpuid macro in x86.cpp. - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads from DMX sounds. - Fixed: PNGTexture must not use the FArchive >> operator as a short hand for reading 4-byte integers, because that operator works with little endian numbers--a no-op on Intel processors, but bad joojoo on PowerPCs. - fixed: Weapons must first check if they can be switched and afterwards if they can be fired. These checks were reversed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@443 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-06 16:58:38 +00:00
}
else
{
TActorIterator<AActor> iterator (args[0]);
while ( (actor = iterator.Next ()) )
{
P_Thing_SetVelocity(actor, args[1], args[2], args[3], !!args[4], !!args[5]);
Update to ZDoom r1799: - Added PinkSilver's SetActorVelocity code submission (with optimizations.) - Added the frandom decorate function, which is exactly like random except that it works with floating point instead of integers. - Split the bounce types completely into separate flags and consolidated the various bounce-related flags spread across the different Actor flags field into a single BounceFlags field. - Fixed: P_BounceWall() should calculate the XY velocity using a real square root and not P_AproxDistance(), because the latter can cause them to speed up or slow down. - made menu dimming a mapping option but kept the CVARS as user override. - Fixed: R_CreatePlayerTranslation() only initialized the first truecolor palette entry. - Fixed: D3DPal::Update() used BorderColor == 0 as the condition for skipping an entry. It should be SM14 as in UploadPalette(). - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do for you, GCC!) The AMD feature flags weren't stored anywhere, either; not that it really matters. - Add an alternate PIC-compliant __cpuid macro in x86.cpp. - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads from DMX sounds. - Fixed: PNGTexture must not use the FArchive >> operator as a short hand for reading 4-byte integers, because that operator works with little endian numbers--a no-op on Intel processors, but bad joojoo on PowerPCs. - fixed: Weapons must first check if they can be switched and afterwards if they can be fired. These checks were reversed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@443 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-06 16:58:38 +00:00
}
}
return 0;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case ACSF_SetUserVariable:
{
int cnt = 0;
FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None)
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
{
if (args[0] == 0)
{
if (activator != NULL)
{
SetUserVariable(activator, varname, 0, args[2]);
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
}
cnt++;
}
else
{
TActorIterator<AActor> iterator(args[0]);
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
while ( (actor = iterator.Next()) )
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
{
SetUserVariable(actor, varname, 0, args[2]);
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
cnt++;
}
}
}
return cnt;
}
case ACSF_GetUserVariable:
{
FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None)
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
{
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL);
return a != NULL ? GetUserVariable(a, varname, 0) : 0;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
}
return 0;
}
case ACSF_SetUserArray:
{
int cnt = 0;
FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None)
{
if (args[0] == 0)
{
if (activator != NULL)
{
SetUserVariable(activator, varname, args[2], args[3]);
}
cnt++;
}
else
{
TActorIterator<AActor> iterator(args[0]);
while ( (actor = iterator.Next()) )
{
SetUserVariable(actor, varname, args[2], args[3]);
cnt++;
}
}
}
return cnt;
}
case ACSF_GetUserArray:
{
FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None)
{
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL);
return a != NULL ? GetUserVariable(a, varname, args[2]) : 0;
}
return 0;
}
case ACSF_Radius_Quake2:
P_StartQuake(activator, args[0], args[1], args[2], args[3], args[4], FBehavior::StaticLookupString(args[5]));
break;
case ACSF_CheckActorClass:
{
Update to ZDoom r2198: - let players check MF2_NOTRANSLATE so that mods can create player classes which are not subject to default player color handling. - fixed: The ChexPlayer was missing default colorset definitions. - Final Doom needs its finale flats changed, too. - It's "BGCASTCALL", not "BOSSBACK". - Added BOOM/MBF BEX-style narrative background text substitution. There are two changes because of this: * A cluster's flat definition can now be preceded by a $ to do a string table lookup. * Since the standard flat names are now in the LANGUAGE lump, the normal Dehacked substitution for these is no longer handled specially and so will not be automatically disabled merely by providing your own MAPINFO. - Setting a Player.ColorRange now completely disables the translation rather than just making it an identity map. - Added support for the original games' player translations, including Hexen's table-based ones. - Fixed: CheckActorClass needed a NULL check. - Fixed: FFont::StringWidth() counted the ']' character of a named color escape sequence in its width calculation. - Fixed: FSinglePicFont should set the character size by the scaled size of the texture. - Fixed: snd_musicvolume needs to check GSnd for NULL, since somebody might have set an atexit for it, which gets executed after the sound system shuts down. - Fixed: FPlayList::Backup() failed to wrap around below entry 0 because Position is unsigned now. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@744 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-06 11:03:55 +00:00
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL);
return a == NULL ? false : a->GetClass()->TypeName == FName(FBehavior::StaticLookupString(args[1]));
}
- fixed: Calculating sector heights with transparent door hacks was wrong. - fixed: Sector height was wrong for sectors that have a slope transfer for a horizontal plane. - better error reporting for shader compile errors. Update to ZDoom r1942: - Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch, use a larger aiming range, ignore non-targets in P_AimLineAttack(), and aim at the target anyway even if P_AimLineAttack() decides it has no chance of hitting. - Added another parameter to P_AimLineAttack(): A target to be aimed at. If this is non-NULL, then all actors between the shooter and the target will be ignored. - Added new sound sequence ACS functions: SoundSequenceOnActor(int tid, string seqname); SoundSequenceOnSector(int tag, string seqname, int location); SoundSequenceOnPolyobj(int polynum, string seqname); SoundSequenceOnSector takes an extra parameter that specifies where in the sector the sound comes from (floor, ceiling, interior, or all of it). See the SECSEQ defines in zdefs.acs. - Fixed: R_RenderDecal() must save various Wall globals, because the originals may still be needed. In particular, when drawing a seg with a midtexture is split by foreground geometry, the first drawseg generated from it will have the correct WallSZ1,2 values, but subsequent ones will have whatever R_RenderDecal() left behind. These values are used to calculate the upper and lower bounds of the midtexture. (Ironically, my work to Build-ify things had done away with these globals, but that's gone now.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
case ACSF_SoundSequenceOnActor:
{
const char *seqname = FBehavior::StaticLookupString(args[1]);
if (seqname != NULL)
{
if (args[0] == 0)
{
if (activator != NULL)
{
SN_StartSequence(activator, seqname, 0);
}
}
else
{
FActorIterator it(args[0]);
AActor *actor;
while ( (actor = it.Next()) )
{
SN_StartSequence(actor, seqname, 0);
}
}
}
}
break;
case ACSF_SoundSequenceOnSector:
{
const char *seqname = FBehavior::StaticLookupString(args[1]);
int space = args[2] < CHAN_FLOOR || args[2] > CHAN_INTERIOR ? CHAN_FULLHEIGHT : args[2];
if (seqname != NULL)
{
int secnum = -1;
while ((secnum = P_FindSectorFromTag(args[0], secnum)) >= 0)
{
SN_StartSequence(&sectors[secnum], args[2], seqname, 0);
}
}
}
break;
case ACSF_SoundSequenceOnPolyobj:
{
const char *seqname = FBehavior::StaticLookupString(args[1]);
if (seqname != NULL)
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
if (poly != NULL)
{
SN_StartSequence(poly, seqname, 0);
}
}
}
break;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
case ACSF_GetPolyobjX:
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
if (poly != NULL)
{
return poly->StartSpot.x;
}
}
return FIXED_MAX;
case ACSF_GetPolyobjY:
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
if (poly != NULL)
{
return poly->StartSpot.y;
}
}
return FIXED_MAX;
case ACSF_CheckSight:
{
AActor *source;
AActor *dest;
int flags = SF_IGNOREVISIBILITY;
if (args[2] & 1) flags |= SF_IGNOREWATERBOUNDARY;
if (args[2] & 2) flags |= SF_SEEPASTBLOCKEVERYTHING | SF_SEEPASTSHOOTABLELINES;
if (args[0] == 0)
{
source = (AActor *) activator;
if (args[1] == 0) return 1; // [KS] I'm sure the activator can see itself.
TActorIterator<AActor> dstiter (args[1]);
while ( (dest = dstiter.Next ()) )
{
if (P_CheckSight(source, dest, flags)) return 1;
}
}
else
{
TActorIterator<AActor> srciter (args[0]);
while ( (source = srciter.Next ()) )
{
if (args[1] != 0)
{
TActorIterator<AActor> dstiter (args[1]);
while ( (dest = dstiter.Next ()) )
{
if (P_CheckSight(source, dest, flags)) return 1;
}
}
else
{
if (P_CheckSight(source, activator, flags)) return 1;
}
}
}
return 0;
}
case ACSF_SpawnForced:
return DoSpawn(args[0], args[1], args[2], args[3], args[4], args[5], true);
* Updated to ZDoom r3370: - Fixed: Forgot to initialize inventoryItem to NULL in DrawBar. - Fixed: Runtime error on Mac OS X. For whatever reason merely having the call to CFUserNotificationDisplayAlert() in I_FatalError caused exception handling to quit working. Moving it to a separate file seems to fix this. Also removed the warning about FRenderer having a non-virtual destructor. - Added pukename console command. This is mostly the same as puke, except the scripts are named, and to run a script using ACS_ExecuteAlways, you need to add "always" after the script name but before any arguments. e.g.: « pukename "A Script" 1 » will run the script "A Script" with a single argument of 1, provided the script is not already running. « pukename "A Script" always 1 » Will always run the script "A Script" with a single argument of 1. - Added action functions that work with script names instead of script numbers. They are named the same as their ACS function equivalents. e.g. From DECORATE, you can now use ACS_NamedExecuteAlways to run a script with a name. - Make deferred scripts work with named scripts. - Added ACS_Named* function variants of the ACS_* specials that take script names instead of numbers. As these are functions and not specials, they can only be used from inside ACS. - Fixed: Mac universal binary build. (I actually just realized that my DRDTeam build script ended up just working because of this modification.) - Allow any parameterized SBarInfo value to use parentheses to help make the syntax a little more consistent. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1285 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:26:03 +00:00
case ACSF_ACS_NamedExecute:
case ACSF_ACS_NamedSuspend:
case ACSF_ACS_NamedTerminate:
case ACSF_ACS_NamedLockedExecute:
case ACSF_ACS_NamedLockedExecuteDoor:
case ACSF_ACS_NamedExecuteWithResult:
case ACSF_ACS_NamedExecuteAlways:
{
int scriptnum = -FName(FBehavior::StaticLookupString(args[0]));
int arg1 = argCount > 1 ? args[1] : 0;
int arg2 = argCount > 2 ? args[2] : 0;
int arg3 = argCount > 3 ? args[3] : 0;
int arg4 = argCount > 4 ? args[4] : 0;
return P_ExecuteSpecial(NamedACSToNormalACS[funcIndex - ACSF_ACS_NamedExecute],
activationline, activator, backSide,
scriptnum, arg1, arg2, arg3, arg4);
}
break;
case ACSF_UniqueTID:
return P_FindUniqueTID(argCount > 0 ? args[0] : 0, argCount > 1 ? args[1] : 0);
case ACSF_IsTIDUsed:
return P_IsTIDUsed(args[0]);
case ACSF_Sqrt:
return xs_FloorToInt(sqrt(double(args[0])));
case ACSF_FixedSqrt:
return FLOAT2FIXED(sqrt(FIXED2DBL(args[0])));
case ACSF_VectorLength:
return FLOAT2FIXED(TVector2<double>(FIXED2DBL(args[0]), FIXED2DBL(args[1])).Length());
case ACSF_SetHUDClipRect:
ClipRectLeft = argCount > 0 ? args[0] : 0;
ClipRectTop = argCount > 1 ? args[1] : 0;
ClipRectWidth = argCount > 2 ? args[2] : 0;
ClipRectHeight = argCount > 3 ? args[3] : 0;
WrapWidth = argCount > 4 ? args[4] : 0;
break;
case ACSF_SetHUDWrapWidth:
WrapWidth = argCount > 0 ? args[0] : 0;
break;
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
default:
break;
}
return 0;
}
enum
{
PRINTNAME_LEVELNAME = -1,
PRINTNAME_LEVEL = -2,
PRINTNAME_SKILL = -3,
};
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
#define NEXTWORD (LittleLong(*pc++))
#define NEXTBYTE (fmt==ACS_LittleEnhanced?getbyte(pc):NEXTWORD)
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
#define NEXTSHORT (fmt==ACS_LittleEnhanced?getshort(pc):NEXTWORD)
#define STACK(a) (Stack[sp - (a)])
#define PushToStack(a) (Stack[sp++] = (a))
// Direct instructions that take strings need to have the tag applied.
#define TAGSTR(a) (a|activeBehavior->GetLibraryID())
inline int getbyte (int *&pc)
{
int res = *(BYTE *)pc;
pc = (int *)((BYTE *)pc+1);
return res;
}
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
inline int getshort (int *&pc)
{
int res = LittleShort( *(SWORD *)pc);
pc = (int *)((BYTE *)pc+2);
return res;
}
int DLevelScript::RunScript ()
{
DACSThinker *controller = DACSThinker::ActiveThinker;
SDWORD *locals = localvars;
ScriptFunction *activeFunction = NULL;
FRemapTable *translation = 0;
int resultValue = 1;
// Hexen truncates all special arguments to bytes (only when using an old MAPINFO and old ACS format
const int specialargmask = ((level.flags2 & LEVEL2_HEXENHACK) && activeBehavior->GetFormat() == ACS_Old) ? 255 : ~0;
switch (state)
{
case SCRIPT_Delayed:
// Decrement the delay counter and enter state running
// if it hits 0
if (--statedata == 0)
state = SCRIPT_Running;
break;
case SCRIPT_TagWait:
// Wait for tagged sector(s) to go inactive, then enter
// state running
{
int secnum = -1;
while ((secnum = P_FindSectorFromTag (statedata, secnum)) >= 0)
if (sectors[secnum].floordata || sectors[secnum].ceilingdata)
return resultValue;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
// If we got here, none of the tagged sectors were busy
state = SCRIPT_Running;
}
break;
case SCRIPT_PolyWait:
// Wait for polyobj(s) to stop moving, then enter state running
if (!PO_Busy (statedata))
{
state = SCRIPT_Running;
}
break;
case SCRIPT_ScriptWaitPre:
// Wait for a script to start running, then enter state scriptwait
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
if (controller->RunningScripts.CheckKey(statedata) != NULL)
state = SCRIPT_ScriptWait;
break;
case SCRIPT_ScriptWait:
// Wait for a script to stop running, then enter state running
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
if (controller->RunningScripts.CheckKey(statedata) != NULL)
return resultValue;
state = SCRIPT_Running;
PutFirst ();
break;
default:
break;
}
SDWORD Stack[STACK_SIZE];
int sp = 0;
int *pc = this->pc;
ACSFormat fmt = activeBehavior->GetFormat();
unsigned int runaway = 0; // used to prevent infinite loops
int pcd;
FString work;
const char *lookup;
int optstart = -1;
int temp;
while (state == SCRIPT_Running)
{
if (++runaway > 2000000)
{
Printf ("Runaway %s terminated\n", ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
break;
}
if (fmt == ACS_LittleEnhanced)
{
pcd = getbyte(pc);
if (pcd >= 256-16)
{
pcd = (256-16) + ((pcd - (256-16)) << 8) + getbyte(pc);
}
}
else
{
pcd = NEXTWORD;
}
switch (pcd)
{
default:
Printf ("Unknown P-Code %d in %s\n", pcd, ScriptPresentation(script).GetChars());
// fall through
case PCD_TERMINATE:
DPrintf ("%s finished\n", ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
break;
case PCD_NOP:
break;
case PCD_SUSPEND:
state = SCRIPT_Suspended;
break;
case PCD_TAGSTRING:
Stack[sp-1] |= activeBehavior->GetLibraryID();
break;
case PCD_PUSHNUMBER:
PushToStack (uallong(pc[0]));
pc++;
break;
case PCD_PUSHBYTE:
PushToStack (*(BYTE *)pc);
pc = (int *)((BYTE *)pc + 1);
break;
case PCD_PUSH2BYTES:
Stack[sp] = ((BYTE *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1];
sp += 2;
pc = (int *)((BYTE *)pc + 2);
break;
case PCD_PUSH3BYTES:
Stack[sp] = ((BYTE *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2];
sp += 3;
pc = (int *)((BYTE *)pc + 3);
break;
case PCD_PUSH4BYTES:
Stack[sp] = ((BYTE *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2];
Stack[sp+3] = ((BYTE *)pc)[3];
sp += 4;
pc = (int *)((BYTE *)pc + 4);
break;
case PCD_PUSH5BYTES:
Stack[sp] = ((BYTE *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2];
Stack[sp+3] = ((BYTE *)pc)[3];
Stack[sp+4] = ((BYTE *)pc)[4];
sp += 5;
pc = (int *)((BYTE *)pc + 5);
break;
case PCD_PUSHBYTES:
temp = *(BYTE *)pc;
pc = (int *)((BYTE *)pc + temp + 1);
for (temp = -temp; temp; temp++)
{
PushToStack (*((BYTE *)pc + temp));
}
break;
case PCD_DUP:
Stack[sp] = Stack[sp-1];
sp++;
break;
case PCD_SWAP:
swapvalues(Stack[sp-2], Stack[sp-1]);
break;
case PCD_LSPEC1:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(1) & specialargmask, 0, 0, 0, 0);
sp -= 1;
break;
case PCD_LSPEC2:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0, 0, 0);
sp -= 2;
break;
case PCD_LSPEC3:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0, 0);
sp -= 3;
break;
case PCD_LSPEC4:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0);
sp -= 4;
break;
case PCD_LSPEC5:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(5) & specialargmask,
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask);
sp -= 5;
break;
case PCD_LSPEC5RESULT:
STACK(5) = P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(5) & specialargmask,
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask);
sp -= 4;
break;
case PCD_LSPEC1DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]) & specialargmask ,0, 0, 0, 0);
pc += 1;
break;
case PCD_LSPEC2DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask, 0, 0, 0);
pc += 2;
break;
case PCD_LSPEC3DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask, 0, 0);
pc += 3;
break;
case PCD_LSPEC4DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask,
uallong(pc[3]) & specialargmask, 0);
pc += 4;
break;
case PCD_LSPEC5DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask,
uallong(pc[3]) & specialargmask,
uallong(pc[4]) & specialargmask);
pc += 5;
break;
// Parameters for PCD_LSPEC?DIRECTB are by definition bytes so never need and-ing.
case PCD_LSPEC1DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], 0, 0, 0, 0);
pc = (int *)((BYTE *)pc + 2);
break;
case PCD_LSPEC2DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], 0, 0, 0);
pc = (int *)((BYTE *)pc + 3);
break;
case PCD_LSPEC3DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3], 0, 0);
pc = (int *)((BYTE *)pc + 4);
break;
case PCD_LSPEC4DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3],
((BYTE *)pc)[4], 0);
pc = (int *)((BYTE *)pc + 5);
break;
case PCD_LSPEC5DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3],
((BYTE *)pc)[4], ((BYTE *)pc)[5]);
pc = (int *)((BYTE *)pc + 6);
break;
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
case PCD_CALLFUNC:
{
int argCount = NEXTBYTE;
int funcIndex = NEXTSHORT;
int retval = CallFunction(argCount, funcIndex, &STACK(argCount));
sp -= argCount-1;
STACK(1) = retval;
}
break;
- Update to ZDoom r3751: Added the item flag IF_RESTRICTABSOLUTELY. When this is set, players of the wrong class cannot pickup an item at all. (For instance, normally players in Hexen can still pick up other players' weapons for ammo. With this flag set, they cannot do that either.) The complete FMapThing is overkill for storing player starts, so use a new minimal structure for them. Added MAPINFO flag RandomPlayerStarts. In this mode, no voodoo dolls are spawned. Instead, all player starts are added to a pool, and players spawn at a random spot. Pass playernum as a parameter to P_SpawnPlayer(). Now P_SpawnMapThing() is the only thing that uses the MapThing's type to determine the which player is spawning. Fix some GCC 4.7.1 warnings. Added UsePlayerStartZ MAPINFO option to cause P_SpawnPlayer() to offset the spawned player's Z position by the MapThing's Z, just like for any other MapThing. P_SpawnPlayer() now respects a player's SPAWNCEILING and SPAWNFLOAT flags. Fixed: MF6_BUMPSPECIAL only worked when bumped from X/Y movement but not Z movement. Make floatbobbing a purely cosmetic effect that does not alter an actor's real position in the world. We don't need to keep the FloatBobOffsets[] verison of DoWaggle around. What I didn't have this saved? ugh Fixed: The action function version of ACS_NamedExecuteWithResult only accepted three script parameters. Fixed: Editing the player (thing #1) with DeHacked would remove its MF2_PUSHWALL flag. This was not supposed to be committed as part of r3737. Don't use abbreviations in exception descriptions. Do do not disable config writing before DoGameSetup() (introduced in r3653) if the config file does not already exist. This way, we can create a default config file without removing anything from an existing config file if things go wrong early during setup. Added Hacx 2.0 detection. Let's go ahead and bump the version in trunk. Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors. Fixed: DDrawFB should not recreate all its resources when the palette changes if we were the one responsible for the palette change. Fixed: DDrawFB::CreateSurfacesComplex() starting tries at 2 instead of 0 is not "debugging cruft" since it counts down, not up. (Partially reverts r3195) Fixed: ACS function pointer instructions need to call GetFunction on the tagged module instead of the active behavior. Added support for Eternity Engine's function pointer ACS instructions. (Note that an alternative ACS compiler is necessary to use these instructions properly.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1420 b0f79afe-0144-0410-b225-9a4edf0717df
2012-07-08 08:24:45 +00:00
case PCD_PUSHFUNCTION:
{
int funcnum = NEXTBYTE;
PushToStack(funcnum | activeBehavior->GetLibraryID());
break;
}
case PCD_CALL:
case PCD_CALLDISCARD:
- Update to ZDoom r3751: Added the item flag IF_RESTRICTABSOLUTELY. When this is set, players of the wrong class cannot pickup an item at all. (For instance, normally players in Hexen can still pick up other players' weapons for ammo. With this flag set, they cannot do that either.) The complete FMapThing is overkill for storing player starts, so use a new minimal structure for them. Added MAPINFO flag RandomPlayerStarts. In this mode, no voodoo dolls are spawned. Instead, all player starts are added to a pool, and players spawn at a random spot. Pass playernum as a parameter to P_SpawnPlayer(). Now P_SpawnMapThing() is the only thing that uses the MapThing's type to determine the which player is spawning. Fix some GCC 4.7.1 warnings. Added UsePlayerStartZ MAPINFO option to cause P_SpawnPlayer() to offset the spawned player's Z position by the MapThing's Z, just like for any other MapThing. P_SpawnPlayer() now respects a player's SPAWNCEILING and SPAWNFLOAT flags. Fixed: MF6_BUMPSPECIAL only worked when bumped from X/Y movement but not Z movement. Make floatbobbing a purely cosmetic effect that does not alter an actor's real position in the world. We don't need to keep the FloatBobOffsets[] verison of DoWaggle around. What I didn't have this saved? ugh Fixed: The action function version of ACS_NamedExecuteWithResult only accepted three script parameters. Fixed: Editing the player (thing #1) with DeHacked would remove its MF2_PUSHWALL flag. This was not supposed to be committed as part of r3737. Don't use abbreviations in exception descriptions. Do do not disable config writing before DoGameSetup() (introduced in r3653) if the config file does not already exist. This way, we can create a default config file without removing anything from an existing config file if things go wrong early during setup. Added Hacx 2.0 detection. Let's go ahead and bump the version in trunk. Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors. Fixed: DDrawFB should not recreate all its resources when the palette changes if we were the one responsible for the palette change. Fixed: DDrawFB::CreateSurfacesComplex() starting tries at 2 instead of 0 is not "debugging cruft" since it counts down, not up. (Partially reverts r3195) Fixed: ACS function pointer instructions need to call GetFunction on the tagged module instead of the active behavior. Added support for Eternity Engine's function pointer ACS instructions. (Note that an alternative ACS compiler is necessary to use these instructions properly.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1420 b0f79afe-0144-0410-b225-9a4edf0717df
2012-07-08 08:24:45 +00:00
case PCD_CALLSTACK:
{
int funcnum;
int i;
ScriptFunction *func;
- Update to ZDoom r3751: Added the item flag IF_RESTRICTABSOLUTELY. When this is set, players of the wrong class cannot pickup an item at all. (For instance, normally players in Hexen can still pick up other players' weapons for ammo. With this flag set, they cannot do that either.) The complete FMapThing is overkill for storing player starts, so use a new minimal structure for them. Added MAPINFO flag RandomPlayerStarts. In this mode, no voodoo dolls are spawned. Instead, all player starts are added to a pool, and players spawn at a random spot. Pass playernum as a parameter to P_SpawnPlayer(). Now P_SpawnMapThing() is the only thing that uses the MapThing's type to determine the which player is spawning. Fix some GCC 4.7.1 warnings. Added UsePlayerStartZ MAPINFO option to cause P_SpawnPlayer() to offset the spawned player's Z position by the MapThing's Z, just like for any other MapThing. P_SpawnPlayer() now respects a player's SPAWNCEILING and SPAWNFLOAT flags. Fixed: MF6_BUMPSPECIAL only worked when bumped from X/Y movement but not Z movement. Make floatbobbing a purely cosmetic effect that does not alter an actor's real position in the world. We don't need to keep the FloatBobOffsets[] verison of DoWaggle around. What I didn't have this saved? ugh Fixed: The action function version of ACS_NamedExecuteWithResult only accepted three script parameters. Fixed: Editing the player (thing #1) with DeHacked would remove its MF2_PUSHWALL flag. This was not supposed to be committed as part of r3737. Don't use abbreviations in exception descriptions. Do do not disable config writing before DoGameSetup() (introduced in r3653) if the config file does not already exist. This way, we can create a default config file without removing anything from an existing config file if things go wrong early during setup. Added Hacx 2.0 detection. Let's go ahead and bump the version in trunk. Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors. Fixed: DDrawFB should not recreate all its resources when the palette changes if we were the one responsible for the palette change. Fixed: DDrawFB::CreateSurfacesComplex() starting tries at 2 instead of 0 is not "debugging cruft" since it counts down, not up. (Partially reverts r3195) Fixed: ACS function pointer instructions need to call GetFunction on the tagged module instead of the active behavior. Added support for Eternity Engine's function pointer ACS instructions. (Note that an alternative ACS compiler is necessary to use these instructions properly.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1420 b0f79afe-0144-0410-b225-9a4edf0717df
2012-07-08 08:24:45 +00:00
FBehavior *module;
SDWORD *mylocals;
- Update to ZDoom r3751: Added the item flag IF_RESTRICTABSOLUTELY. When this is set, players of the wrong class cannot pickup an item at all. (For instance, normally players in Hexen can still pick up other players' weapons for ammo. With this flag set, they cannot do that either.) The complete FMapThing is overkill for storing player starts, so use a new minimal structure for them. Added MAPINFO flag RandomPlayerStarts. In this mode, no voodoo dolls are spawned. Instead, all player starts are added to a pool, and players spawn at a random spot. Pass playernum as a parameter to P_SpawnPlayer(). Now P_SpawnMapThing() is the only thing that uses the MapThing's type to determine the which player is spawning. Fix some GCC 4.7.1 warnings. Added UsePlayerStartZ MAPINFO option to cause P_SpawnPlayer() to offset the spawned player's Z position by the MapThing's Z, just like for any other MapThing. P_SpawnPlayer() now respects a player's SPAWNCEILING and SPAWNFLOAT flags. Fixed: MF6_BUMPSPECIAL only worked when bumped from X/Y movement but not Z movement. Make floatbobbing a purely cosmetic effect that does not alter an actor's real position in the world. We don't need to keep the FloatBobOffsets[] verison of DoWaggle around. What I didn't have this saved? ugh Fixed: The action function version of ACS_NamedExecuteWithResult only accepted three script parameters. Fixed: Editing the player (thing #1) with DeHacked would remove its MF2_PUSHWALL flag. This was not supposed to be committed as part of r3737. Don't use abbreviations in exception descriptions. Do do not disable config writing before DoGameSetup() (introduced in r3653) if the config file does not already exist. This way, we can create a default config file without removing anything from an existing config file if things go wrong early during setup. Added Hacx 2.0 detection. Let's go ahead and bump the version in trunk. Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors. Fixed: DDrawFB should not recreate all its resources when the palette changes if we were the one responsible for the palette change. Fixed: DDrawFB::CreateSurfacesComplex() starting tries at 2 instead of 0 is not "debugging cruft" since it counts down, not up. (Partially reverts r3195) Fixed: ACS function pointer instructions need to call GetFunction on the tagged module instead of the active behavior. Added support for Eternity Engine's function pointer ACS instructions. (Note that an alternative ACS compiler is necessary to use these instructions properly.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1420 b0f79afe-0144-0410-b225-9a4edf0717df
2012-07-08 08:24:45 +00:00
if(pcd == PCD_CALLSTACK)
{
funcnum = STACK(1);
module = FBehavior::StaticGetModule(funcnum>>16);
--sp;
funcnum &= 0xFFFF; // Clear out tag
}
else
{
module = activeBehavior;
funcnum = NEXTBYTE;
}
func = module->GetFunction (funcnum, module);
if (func == NULL)
{
Printf ("Function %d in %s out of range\n", funcnum, ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
break;
}
if (sp + func->LocalCount + 64 > STACK_SIZE)
{ // 64 is the margin for the function's working space
Printf ("Out of stack space in %s\n", ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
break;
}
mylocals = locals;
// The function's first argument is also its first local variable.
locals = &Stack[sp - func->ArgCount];
// Make space on the stack for any other variables the function uses.
for (i = 0; i < func->LocalCount; ++i)
{
Stack[sp+i] = 0;
}
sp += i;
::new(&Stack[sp]) CallReturn(activeBehavior->PC2Ofs(pc), activeFunction,
activeBehavior, mylocals, pcd == PCD_CALLDISCARD, runaway);
sp += (sizeof(CallReturn) + sizeof(int) - 1) / sizeof(int);
pc = module->Ofs2PC (func->Address);
activeFunction = func;
activeBehavior = module;
fmt = module->GetFormat();
}
break;
case PCD_RETURNVOID:
case PCD_RETURNVAL:
{
int value;
union
{
SDWORD *retsp;
CallReturn *ret;
};
if (pcd == PCD_RETURNVAL)
{
value = Stack[--sp];
}
else
{
value = 0;
}
sp -= sizeof(CallReturn)/sizeof(int);
retsp = &Stack[sp];
activeBehavior->GetFunctionProfileData(activeFunction)->AddRun(runaway - ret->EntryInstrCount);
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
sp = int(locals - Stack);
pc = ret->ReturnModule->Ofs2PC(ret->ReturnAddress);
activeFunction = ret->ReturnFunction;
activeBehavior = ret->ReturnModule;
fmt = activeBehavior->GetFormat();
locals = ret->ReturnLocals;
if (!ret->bDiscardResult)
{
Stack[sp++] = value;
}
ret->~CallReturn();
}
break;
case PCD_ADD:
STACK(2) = STACK(2) + STACK(1);
sp--;
break;
case PCD_SUBTRACT:
STACK(2) = STACK(2) - STACK(1);
sp--;
break;
case PCD_MULTIPLY:
STACK(2) = STACK(2) * STACK(1);
sp--;
break;
case PCD_DIVIDE:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
STACK(2) = STACK(2) / STACK(1);
sp--;
}
break;
case PCD_MODULUS:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
STACK(2) = STACK(2) % STACK(1);
sp--;
}
break;
case PCD_EQ:
STACK(2) = (STACK(2) == STACK(1));
sp--;
break;
case PCD_NE:
STACK(2) = (STACK(2) != STACK(1));
sp--;
break;
case PCD_LT:
STACK(2) = (STACK(2) < STACK(1));
sp--;
break;
case PCD_GT:
STACK(2) = (STACK(2) > STACK(1));
sp--;
break;
case PCD_LE:
STACK(2) = (STACK(2) <= STACK(1));
sp--;
break;
case PCD_GE:
STACK(2) = (STACK(2) >= STACK(1));
sp--;
break;
case PCD_ASSIGNSCRIPTVAR:
locals[NEXTBYTE] = STACK(1);
sp--;
break;
case PCD_ASSIGNMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) = STACK(1);
sp--;
break;
case PCD_ASSIGNWORLDVAR:
ACS_WorldVars[NEXTBYTE] = STACK(1);
sp--;
break;
case PCD_ASSIGNGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] = STACK(1);
sp--;
break;
case PCD_ASSIGNMAPARRAY:
activeBehavior->SetArrayVal (*(activeBehavior->MapVars[NEXTBYTE]), STACK(2), STACK(1));
sp -= 2;
break;
case PCD_ASSIGNWORLDARRAY:
ACS_WorldArrays[NEXTBYTE][STACK(2)] = STACK(1);
sp -= 2;
break;
case PCD_ASSIGNGLOBALARRAY:
ACS_GlobalArrays[NEXTBYTE][STACK(2)] = STACK(1);
sp -= 2;
break;
case PCD_PUSHSCRIPTVAR:
PushToStack (locals[NEXTBYTE]);
break;
case PCD_PUSHMAPVAR:
PushToStack (*(activeBehavior->MapVars[NEXTBYTE]));
break;
case PCD_PUSHWORLDVAR:
PushToStack (ACS_WorldVars[NEXTBYTE]);
break;
case PCD_PUSHGLOBALVAR:
PushToStack (ACS_GlobalVars[NEXTBYTE]);
break;
case PCD_PUSHMAPARRAY:
STACK(1) = activeBehavior->GetArrayVal (*(activeBehavior->MapVars[NEXTBYTE]), STACK(1));
break;
case PCD_PUSHWORLDARRAY:
STACK(1) = ACS_WorldArrays[NEXTBYTE][STACK(1)];
break;
case PCD_PUSHGLOBALARRAY:
STACK(1) = ACS_GlobalArrays[NEXTBYTE][STACK(1)];
break;
case PCD_ADDSCRIPTVAR:
locals[NEXTBYTE] += STACK(1);
sp--;
break;
case PCD_ADDMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) += STACK(1);
sp--;
break;
case PCD_ADDWORLDVAR:
ACS_WorldVars[NEXTBYTE] += STACK(1);
sp--;
break;
case PCD_ADDGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] += STACK(1);
sp--;
break;
case PCD_ADDMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) + STACK(1));
sp -= 2;
}
break;
case PCD_ADDWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] += STACK(1);
sp -= 2;
}
break;
case PCD_ADDGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] += STACK(1);
sp -= 2;
}
break;
case PCD_SUBSCRIPTVAR:
locals[NEXTBYTE] -= STACK(1);
sp--;
break;
case PCD_SUBMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) -= STACK(1);
sp--;
break;
case PCD_SUBWORLDVAR:
ACS_WorldVars[NEXTBYTE] -= STACK(1);
sp--;
break;
case PCD_SUBGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] -= STACK(1);
sp--;
break;
case PCD_SUBMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) - STACK(1));
sp -= 2;
}
break;
case PCD_SUBWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] -= STACK(1);
sp -= 2;
}
break;
case PCD_SUBGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] -= STACK(1);
sp -= 2;
}
break;
case PCD_MULSCRIPTVAR:
locals[NEXTBYTE] *= STACK(1);
sp--;
break;
case PCD_MULMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) *= STACK(1);
sp--;
break;
case PCD_MULWORLDVAR:
ACS_WorldVars[NEXTBYTE] *= STACK(1);
sp--;
break;
case PCD_MULGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] *= STACK(1);
sp--;
break;
case PCD_MULMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) * STACK(1));
sp -= 2;
}
break;
case PCD_MULWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] *= STACK(1);
sp -= 2;
}
break;
case PCD_MULGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] *= STACK(1);
sp -= 2;
}
break;
case PCD_DIVSCRIPTVAR:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
locals[NEXTBYTE] /= STACK(1);
sp--;
}
break;
case PCD_DIVMAPVAR:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
*(activeBehavior->MapVars[NEXTBYTE]) /= STACK(1);
sp--;
}
break;
case PCD_DIVWORLDVAR:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
ACS_WorldVars[NEXTBYTE] /= STACK(1);
sp--;
}
break;
case PCD_DIVGLOBALVAR:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
ACS_GlobalVars[NEXTBYTE] /= STACK(1);
sp--;
}
break;
case PCD_DIVMAPARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) / STACK(1));
sp -= 2;
}
break;
case PCD_DIVWORLDARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] /= STACK(1);
sp -= 2;
}
break;
case PCD_DIVGLOBALARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_DivideBy0;
}
else
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] /= STACK(1);
sp -= 2;
}
break;
case PCD_MODSCRIPTVAR:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
locals[NEXTBYTE] %= STACK(1);
sp--;
}
break;
case PCD_MODMAPVAR:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
*(activeBehavior->MapVars[NEXTBYTE]) %= STACK(1);
sp--;
}
break;
case PCD_MODWORLDVAR:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
ACS_WorldVars[NEXTBYTE] %= STACK(1);
sp--;
}
break;
case PCD_MODGLOBALVAR:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
ACS_GlobalVars[NEXTBYTE] %= STACK(1);
sp--;
}
break;
case PCD_MODMAPARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) % STACK(1));
sp -= 2;
}
break;
case PCD_MODWORLDARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] %= STACK(1);
sp -= 2;
}
break;
case PCD_MODGLOBALARRAY:
if (STACK(1) == 0)
{
state = SCRIPT_ModulusBy0;
}
else
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] %= STACK(1);
sp -= 2;
}
break;
//[MW] start
case PCD_ANDSCRIPTVAR:
locals[NEXTBYTE] &= STACK(1);
sp--;
break;
case PCD_ANDMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) &= STACK(1);
sp--;
break;
case PCD_ANDWORLDVAR:
ACS_WorldVars[NEXTBYTE] &= STACK(1);
sp--;
break;
case PCD_ANDGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] &= STACK(1);
sp--;
break;
case PCD_ANDMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) & STACK(1));
sp -= 2;
}
break;
case PCD_ANDWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] &= STACK(1);
sp -= 2;
}
break;
case PCD_ANDGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] &= STACK(1);
sp -= 2;
}
break;
case PCD_EORSCRIPTVAR:
locals[NEXTBYTE] ^= STACK(1);
sp--;
break;
case PCD_EORMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) ^= STACK(1);
sp--;
break;
case PCD_EORWORLDVAR:
ACS_WorldVars[NEXTBYTE] ^= STACK(1);
sp--;
break;
case PCD_EORGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] ^= STACK(1);
sp--;
break;
case PCD_EORMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) ^ STACK(1));
sp -= 2;
}
break;
case PCD_EORWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] ^= STACK(1);
sp -= 2;
}
break;
case PCD_EORGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] ^= STACK(1);
sp -= 2;
}
break;
case PCD_ORSCRIPTVAR:
locals[NEXTBYTE] |= STACK(1);
sp--;
break;
case PCD_ORMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) |= STACK(1);
sp--;
break;
case PCD_ORWORLDVAR:
ACS_WorldVars[NEXTBYTE] |= STACK(1);
sp--;
break;
case PCD_ORGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] |= STACK(1);
sp--;
break;
case PCD_ORMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) | STACK(1));
sp -= 2;
}
break;
case PCD_ORWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] |= STACK(1);
sp -= 2;
}
break;
case PCD_ORGLOBALARRAY:
{
int a = NEXTBYTE;
int i = STACK(2);
ACS_GlobalArrays[a][STACK(2)] |= STACK(1);
sp -= 2;
}
break;
case PCD_LSSCRIPTVAR:
locals[NEXTBYTE] <<= STACK(1);
sp--;
break;
case PCD_LSMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) <<= STACK(1);
sp--;
break;
case PCD_LSWORLDVAR:
ACS_WorldVars[NEXTBYTE] <<= STACK(1);
sp--;
break;
case PCD_LSGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] <<= STACK(1);
sp--;
break;
case PCD_LSMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) << STACK(1));
sp -= 2;
}
break;
case PCD_LSWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] <<= STACK(1);
sp -= 2;
}
break;
case PCD_LSGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] <<= STACK(1);
sp -= 2;
}
break;
case PCD_RSSCRIPTVAR:
locals[NEXTBYTE] >>= STACK(1);
sp--;
break;
case PCD_RSMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) >>= STACK(1);
sp--;
break;
case PCD_RSWORLDVAR:
ACS_WorldVars[NEXTBYTE] >>= STACK(1);
sp--;
break;
case PCD_RSGLOBALVAR:
ACS_GlobalVars[NEXTBYTE] >>= STACK(1);
sp--;
break;
case PCD_RSMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(2);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) >> STACK(1));
sp -= 2;
}
break;
case PCD_RSWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(2)] >>= STACK(1);
sp -= 2;
}
break;
case PCD_RSGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(2)] >>= STACK(1);
sp -= 2;
}
break;
//[MW] end
case PCD_INCSCRIPTVAR:
++locals[NEXTBYTE];
break;
case PCD_INCMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) += 1;
break;
case PCD_INCWORLDVAR:
++ACS_WorldVars[NEXTBYTE];
break;
case PCD_INCGLOBALVAR:
++ACS_GlobalVars[NEXTBYTE];
break;
case PCD_INCMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(1);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) + 1);
sp--;
}
break;
case PCD_INCWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(1)] += 1;
sp--;
}
break;
case PCD_INCGLOBALARRAY:
{
int a = NEXTBYTE;
ACS_GlobalArrays[a][STACK(1)] += 1;
sp--;
}
break;
case PCD_DECSCRIPTVAR:
--locals[NEXTBYTE];
break;
case PCD_DECMAPVAR:
*(activeBehavior->MapVars[NEXTBYTE]) -= 1;
break;
case PCD_DECWORLDVAR:
--ACS_WorldVars[NEXTBYTE];
break;
case PCD_DECGLOBALVAR:
--ACS_GlobalVars[NEXTBYTE];
break;
case PCD_DECMAPARRAY:
{
int a = *(activeBehavior->MapVars[NEXTBYTE]);
int i = STACK(1);
activeBehavior->SetArrayVal (a, i, activeBehavior->GetArrayVal (a, i) - 1);
sp--;
}
break;
case PCD_DECWORLDARRAY:
{
int a = NEXTBYTE;
ACS_WorldArrays[a][STACK(1)] -= 1;
sp--;
}
break;
case PCD_DECGLOBALARRAY:
{
int a = NEXTBYTE;
int i = STACK(1);
ACS_GlobalArrays[a][STACK(1)] -= 1;
sp--;
}
break;
case PCD_GOTO:
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
break;
case PCD_GOTOSTACK:
pc = activeBehavior->Jump2PC (STACK(1));
sp--;
break;
case PCD_IFGOTO:
if (STACK(1))
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
else
pc++;
sp--;
break;
case PCD_DROP:
case PCD_SETRESULTVALUE:
resultValue = STACK(1);
sp--;
break;
case PCD_DELAY:
statedata = STACK(1) + (fmt == ACS_Old && gameinfo.gametype == GAME_Hexen);
if (statedata > 0)
{
state = SCRIPT_Delayed;
}
sp--;
break;
case PCD_DELAYDIRECT:
statedata = uallong(pc[0]) + (fmt == ACS_Old && gameinfo.gametype == GAME_Hexen);
pc++;
if (statedata > 0)
{
state = SCRIPT_Delayed;
}
break;
case PCD_DELAYDIRECTB:
statedata = *(BYTE *)pc + (fmt == ACS_Old && gameinfo.gametype == GAME_Hexen);
if (statedata > 0)
{
state = SCRIPT_Delayed;
}
pc = (int *)((BYTE *)pc + 1);
break;
case PCD_RANDOM:
STACK(2) = Random (STACK(2), STACK(1));
sp--;
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case PCD_RANDOMDIRECT:
PushToStack (Random (uallong(pc[0]), uallong(pc[1])));
pc += 2;
break;
case PCD_RANDOMDIRECTB:
PushToStack (Random (((BYTE *)pc)[0], ((BYTE *)pc)[1]));
pc = (int *)((BYTE *)pc + 2);
break;
case PCD_THINGCOUNT:
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
STACK(2) = ThingCount (STACK(2), -1, STACK(1), -1);
sp--;
break;
case PCD_THINGCOUNTDIRECT:
PushToStack (ThingCount (uallong(pc[0]), -1, uallong(pc[1]), -1));
pc += 2;
break;
case PCD_THINGCOUNTNAME:
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
STACK(2) = ThingCount (-1, STACK(2), STACK(1), -1);
sp--;
break;
case PCD_THINGCOUNTNAMESECTOR:
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
STACK(3) = ThingCount (-1, STACK(3), STACK(2), STACK(1));
sp -= 2;
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
break;
case PCD_THINGCOUNTSECTOR:
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
STACK(3) = ThingCount (STACK(3), -1, STACK(2), STACK(1));
sp -= 2;
break;
case PCD_TAGWAIT:
state = SCRIPT_TagWait;
statedata = STACK(1);
sp--;
break;
case PCD_TAGWAITDIRECT:
state = SCRIPT_TagWait;
statedata = uallong(pc[0]);
pc++;
break;
case PCD_POLYWAIT:
state = SCRIPT_PolyWait;
statedata = STACK(1);
sp--;
break;
case PCD_POLYWAITDIRECT:
state = SCRIPT_PolyWait;
statedata = uallong(pc[0]);
pc++;
break;
case PCD_CHANGEFLOOR:
ChangeFlat (STACK(2), STACK(1), 0);
sp -= 2;
break;
case PCD_CHANGEFLOORDIRECT:
ChangeFlat (uallong(pc[0]), TAGSTR(uallong(pc[1])), 0);
pc += 2;
break;
case PCD_CHANGECEILING:
ChangeFlat (STACK(2), STACK(1), 1);
sp -= 2;
break;
case PCD_CHANGECEILINGDIRECT:
ChangeFlat (uallong(pc[0]), TAGSTR(uallong(pc[1])), 1);
pc += 2;
break;
case PCD_RESTART:
{
const ScriptPtr *scriptp;
scriptp = activeBehavior->FindScript (script);
pc = activeBehavior->GetScriptAddress (scriptp);
}
break;
case PCD_ANDLOGICAL:
STACK(2) = (STACK(2) && STACK(1));
sp--;
break;
case PCD_ORLOGICAL:
STACK(2) = (STACK(2) || STACK(1));
sp--;
break;
case PCD_ANDBITWISE:
STACK(2) = (STACK(2) & STACK(1));
sp--;
break;
case PCD_ORBITWISE:
STACK(2) = (STACK(2) | STACK(1));
sp--;
break;
case PCD_EORBITWISE:
STACK(2) = (STACK(2) ^ STACK(1));
sp--;
break;
case PCD_NEGATELOGICAL:
STACK(1) = !STACK(1);
break;
* Updated to ZDoom r3450: - Fix signed/unsigned mismatch warned by GCC. - Moved "Go away!" text into language.enu. - In conjunction with all the below changes, attempt to fix A_CheckSightOrRange and A_CheckSight for multiplayer: They now always check through the eyes of every player. For players whose cameras are not players, they also check through the eyes of those cameras. - Using spynext/spyprev to switch from a non-player to a player now writes a command to the network stream and lets Net_DoCommand() take care of it later. The logic here is that if a player is viewing from something that isn't another player, then every player needs to know about it for sync purposes. Consequently, when they stop viewing from a non-player and switch to a player, everybody needs to know about that too. But if they are viewing from a player, it doesn't matter which player it is, so they can spynext/spyprev all they want without letting the other players know about it (and without potentially breaking demos--due to the above-mentioned two codepointers--while doing it during demo playback). - Replaced the instances of checking players[consoleplayer].camera for a valid pointer to ones that do it for every player. - Fixed: Upon changing levels, all players but the consoleplayer would have their cameras NULLed. - Fixed: player_t::FixPointers() needs to bypass the read barriers, or it won't be able to do substitutions of old objects that are pending deletion. - Revised the fix from r3442: Make the line a nonrepeatable Door_Open instead of completely clearing the line's special. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1315 b0f79afe-0144-0410-b225-9a4edf0717df
2012-03-17 18:48:17 +00:00
case PCD_NEGATEBINARY:
STACK(1) = ~STACK(1);
break;
case PCD_LSHIFT:
STACK(2) = (STACK(2) << STACK(1));
sp--;
break;
case PCD_RSHIFT:
STACK(2) = (STACK(2) >> STACK(1));
sp--;
break;
case PCD_UNARYMINUS:
STACK(1) = -STACK(1);
break;
case PCD_IFNOTGOTO:
if (!STACK(1))
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
else
pc++;
sp--;
break;
case PCD_LINESIDE:
PushToStack (backSide);
break;
case PCD_SCRIPTWAIT:
statedata = STACK(1);
sp--;
scriptwait:
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
if (controller->RunningScripts.CheckKey(statedata) != NULL)
state = SCRIPT_ScriptWait;
else
state = SCRIPT_ScriptWaitPre;
PutLast ();
break;
case PCD_SCRIPTWAITDIRECT:
statedata = uallong(pc[0]);
pc++;
goto scriptwait;
case PCD_SCRIPTWAITNAMED:
statedata = -FName(FBehavior::StaticLookupString(STACK(1)));
sp--;
goto scriptwait;
case PCD_CLEARLINESPECIAL:
if (activationline != NULL)
{
activationline->special = 0;
DPrintf("Cleared line special on line %d\n", (int)(activationline - lines));
}
break;
case PCD_CASEGOTO:
if (STACK(1) == uallong(pc[0]))
{
pc = activeBehavior->Ofs2PC (uallong(pc[1]));
sp--;
}
else
{
pc += 2;
}
break;
case PCD_CASEGOTOSORTED:
// The count and jump table are 4-byte aligned
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
pc = (int *)(((size_t)pc + 3) & ~3);
{
int numcases = uallong(pc[0]); pc++;
int min = 0, max = numcases-1;
while (min <= max)
{
int mid = (min + max) / 2;
SDWORD caseval = pc[mid*2];
if (caseval == STACK(1))
{
pc = activeBehavior->Ofs2PC (LittleLong(pc[mid*2+1]));
sp--;
break;
}
else if (caseval < STACK(1))
{
min = mid + 1;
}
else
{
max = mid - 1;
}
}
if (min > max)
{
// The case was not found, so go to the next instruction.
pc += numcases * 2;
}
}
break;
case PCD_BEGINPRINT:
STRINGBUILDER_START(work);
break;
case PCD_PRINTSTRING:
case PCD_PRINTLOCALIZED:
lookup = FBehavior::StaticLookupString (STACK(1));
if (pcd == PCD_PRINTLOCALIZED)
{
lookup = GStrings(lookup);
}
if (lookup != NULL)
{
work += lookup;
}
--sp;
break;
case PCD_PRINTNUMBER:
work.AppendFormat ("%d", STACK(1));
--sp;
break;
Update to ZDoom r1312: - Fixed: The save percentage for Doom's green armor was slightly too low which caused roundoff errors that made it less than 1/3 effective. - Added support for "RRGGBB" strings to V_GetColor. - Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly. - Changed GetSpriteIndex to cache the last used sprite name so that the code using this function doesn't have to do it itself. - Moved some more code for the state parser into p_states.cpp. - Fixed: TDeletingArray should not try to delete NULL pointers. - Added binary (b) and hexadecimal (x) cast types for ACS's various print statements. - Added ClassifyActor(tid) ACS builtin function. This takes a TID and returns a set of bits describing the actor. If TID is 0, it returns information about the activator. If there is more than one actor with the given TID, only the first one is considered. Currently defined bits are: ACTOR_NONE No actors with this TID exist (only when TID is not 0). ACTOR_WORLD Activator is the world (only when TID is 0). ACTOR_PLAYER Actor is a player (includes bots and voodoo dolls). ACTOR_BOT Actor is a bot. ACTOR_VOODOODOLL Actor is a voodoo doll. ACTOR_MONSTER Actor is a monster. ACTOR_ALIVE Actor is alive (players/monsters only). ACTOR_DEAD Actor is dead (players/monsters only). ACTOR_MISSILE Actor is a missile. ACTOR_GENERIC Actor exists, but no further information is available. - Moved ExpandEnvVars() from d_main.cpp to cmdlib.cpp. - AutoExec paths now support the same variable expansion as the search paths. Additionally, on Windows, the default autoexec path is now relative to $PROGDIR, rather than using a fixed path to the executable's current directory. - All usable Autoload and AutoExec sections are now created at the top of the config file along with some brief explanatory notes so they are readily visible to anyone who wants to edit them. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@254 b0f79afe-0144-0410-b225-9a4edf0717df
2008-12-07 16:38:02 +00:00
case PCD_PRINTBINARY:
work.AppendFormat ("%B", STACK(1));
--sp;
break;
case PCD_PRINTHEX:
work.AppendFormat ("%X", STACK(1));
--sp;
break;
case PCD_PRINTCHARACTER:
work += (char)STACK(1);
--sp;
break;
case PCD_PRINTFIXED:
work.AppendFormat ("%g", FIXED2FLOAT(STACK(1)));
--sp;
break;
// [BC] Print activator's name
// [RH] Fancied up a bit
case PCD_PRINTNAME:
{
player_t *player = NULL;
if (STACK(1) < 0)
{
switch (STACK(1))
{
case PRINTNAME_LEVELNAME:
work += level.LevelName;
break;
case PRINTNAME_LEVEL:
work += level.mapname;
break;
case PRINTNAME_SKILL:
work += G_SkillName();
break;
default:
work += ' ';
break;
}
sp--;
break;
}
else if (STACK(1) == 0 || (unsigned)STACK(1) > MAXPLAYERS)
{
if (activator)
{
player = activator->player;
}
}
else if (playeringame[STACK(1)-1])
{
player = &players[STACK(1)-1];
}
else
{
work.AppendFormat ("Player %d", STACK(1));
sp--;
break;
}
if (player)
{
work += player->userinfo.netname;
}
else if (activator)
{
work += activator->GetTag();
}
else
{
work += ' ';
}
sp--;
}
break;
// [JB] Print map character array
case PCD_PRINTMAPCHARARRAY:
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
case PCD_PRINTMAPCHRANGE:
{
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
int capacity, offset;
if (pcd == PCD_PRINTMAPCHRANGE)
{
capacity = STACK(1);
offset = STACK(2);
if (capacity < 1 || offset < 0)
{
sp -= 4;
break;
}
sp -= 2;
}
else
{
capacity = 0x7FFFFFFF;
offset = 0;
}
int a = *(activeBehavior->MapVars[STACK(1)]);
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
offset += STACK(2);
int c;
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
while(capacity-- && (c = activeBehavior->GetArrayVal (a, offset)) != '\0') {
work += (char)c;
offset++;
}
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
sp-= 2;
}
break;
// [JB] Print world character array
case PCD_PRINTWORLDCHARARRAY:
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
case PCD_PRINTWORLDCHRANGE:
{
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
int capacity, offset;
if (pcd == PCD_PRINTWORLDCHRANGE)
{
capacity = STACK(1);
offset = STACK(2);
if (capacity < 1 || offset < 0)
{
sp -= 4;
break;
}
sp -= 2;
}
else
{
capacity = 0x7FFFFFFF;
offset = 0;
}
int a = STACK(1);
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
offset += STACK(2);
int c;
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
while(capacity-- && (c = ACS_WorldArrays[a][offset]) != '\0') {
work += (char)c;
offset++;
}
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
sp-= 2;
}
break;
// [JB] Print global character array
case PCD_PRINTGLOBALCHARARRAY:
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
case PCD_PRINTGLOBALCHRANGE:
{
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
int capacity, offset;
if (pcd == PCD_PRINTGLOBALCHRANGE)
{
capacity = STACK(1);
offset = STACK(2);
if (capacity < 1 || offset < 0)
{
sp -= 4;
break;
}
sp -= 2;
}
else
{
capacity = 0x7FFFFFFF;
offset = 0;
}
int a = STACK(1);
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
offset += STACK(2);
int c;
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
while(capacity-- && (c = ACS_GlobalArrays[a][offset]) != '\0') {
work += (char)c;
offset++;
}
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
sp-= 2;
}
break;
// [GRB] Print key name(s) for a command
case PCD_PRINTBIND:
lookup = FBehavior::StaticLookupString (STACK(1));
if (lookup != NULL)
{
int key1 = 0, key2 = 0;
Bindings.GetKeysForCommand ((char *)lookup, &key1, &key2);
if (key2)
work << KeyNames[key1] << " or " << KeyNames[key2];
else if (key1)
work << KeyNames[key1];
else
work << "??? (" << (char *)lookup << ')';
}
--sp;
break;
case PCD_ENDPRINT:
case PCD_ENDPRINTBOLD:
case PCD_MOREHUDMESSAGE:
case PCD_ENDLOG:
if (pcd == PCD_ENDLOG)
{
Printf ("%s\n", work.GetChars());
STRINGBUILDER_FINISH(work);
}
else if (pcd != PCD_MOREHUDMESSAGE)
{
AActor *screen = activator;
// If a missile is the activator, make the thing that
// launched the missile the target of the print command.
if (screen != NULL &&
screen->player == NULL &&
(screen->flags & MF_MISSILE) &&
screen->target != NULL)
{
screen = screen->target;
}
if (pcd == PCD_ENDPRINTBOLD || screen == NULL ||
screen->CheckLocalView (consoleplayer))
{
C_MidPrint (activefont, work);
}
STRINGBUILDER_FINISH(work);
}
else
{
optstart = -1;
}
break;
case PCD_OPTHUDMESSAGE:
optstart = sp;
break;
case PCD_ENDHUDMESSAGE:
case PCD_ENDHUDMESSAGEBOLD:
if (optstart == -1)
{
optstart = sp;
}
{
AActor *screen = activator;
if (screen != NULL &&
screen->player == NULL &&
(screen->flags & MF_MISSILE) &&
screen->target != NULL)
{
screen = screen->target;
}
if (pcd == PCD_ENDHUDMESSAGEBOLD || screen == NULL ||
players[consoleplayer].mo == screen)
{
int type = Stack[optstart-6];
int id = Stack[optstart-5];
EColorRange color;
float x = FIXED2FLOAT(Stack[optstart-3]);
float y = FIXED2FLOAT(Stack[optstart-2]);
float holdTime = FIXED2FLOAT(Stack[optstart-1]);
fixed_t alpha;
DHUDMessage *msg;
if (type & HUDMSG_COLORSTRING)
{
color = V_FindFontColor(FBehavior::StaticLookupString(Stack[optstart-4]));
}
else
{
color = CLAMPCOLOR(Stack[optstart-4]);
}
switch (type & 0xFF)
{
default: // normal
alpha = (optstart < sp) ? Stack[optstart] : FRACUNIT;
msg = new DHUDMessage (activefont, work, x, y, hudwidth, hudheight, color, holdTime);
break;
case 1: // fade out
{
float fadeTime = (optstart < sp) ? FIXED2FLOAT(Stack[optstart]) : 0.5f;
alpha = (optstart < sp-1) ? Stack[optstart+1] : FRACUNIT;
msg = new DHUDMessageFadeOut (activefont, work, x, y, hudwidth, hudheight, color, holdTime, fadeTime);
}
break;
case 2: // type on, then fade out
{
float typeTime = (optstart < sp) ? FIXED2FLOAT(Stack[optstart]) : 0.05f;
float fadeTime = (optstart < sp-1) ? FIXED2FLOAT(Stack[optstart+1]) : 0.5f;
alpha = (optstart < sp-2) ? Stack[optstart+2] : FRACUNIT;
msg = new DHUDMessageTypeOnFadeOut (activefont, work, x, y, hudwidth, hudheight, color, typeTime, holdTime, fadeTime);
}
break;
case 3: // fade in, then fade out
{
float inTime = (optstart < sp) ? FIXED2FLOAT(Stack[optstart]) : 0.5f;
float outTime = (optstart < sp-1) ? FIXED2FLOAT(Stack[optstart+1]) : 0.5f;
alpha = (optstart < sp-2) ? Stack[optstart+2] : FRACUNIT;
msg = new DHUDMessageFadeInOut (activefont, work, x, y, hudwidth, hudheight, color, holdTime, inTime, outTime);
}
break;
}
msg->SetClipRect(ClipRectLeft, ClipRectTop, ClipRectWidth, ClipRectHeight);
if (WrapWidth != 0)
{
msg->SetWrapWidth(WrapWidth);
}
msg->SetVisibility((type & HUDMSG_VISIBILITY_MASK) >> HUDMSG_VISIBILITY_SHIFT);
if (type & HUDMSG_NOWRAP)
{
msg->SetNoWrap(true);
}
if (type & HUDMSG_ALPHA)
{
msg->SetAlpha(alpha);
}
if (type & HUDMSG_ADDBLEND)
{
msg->SetRenderStyle(STYLE_Add);
}
StatusBar->AttachMessage (msg, id ? 0xff000000|id : 0,
(type & HUDMSG_LAYER_MASK) >> HUDMSG_LAYER_SHIFT);
if (type & HUDMSG_LOG)
{
static const char bar[] = TEXTCOLOR_ORANGE "\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36"
"\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_NORMAL "\n";
static const char logbar[] = "\n<------------------------------->\n";
char consolecolor[3];
consolecolor[0] = '\x1c';
consolecolor[1] = color >= CR_BRICK && color <= CR_YELLOW ? color + 'A' : '-';
consolecolor[2] = '\0';
AddToConsole (-1, bar);
AddToConsole (-1, consolecolor);
AddToConsole (-1, work);
AddToConsole (-1, bar);
if (Logfile)
{
fputs (logbar, Logfile);
fputs (work, Logfile);
fputs (logbar, Logfile);
fflush (Logfile);
}
}
}
}
STRINGBUILDER_FINISH(work);
sp = optstart-6;
break;
case PCD_SETFONT:
DoSetFont (STACK(1));
sp--;
break;
case PCD_SETFONTDIRECT:
DoSetFont (TAGSTR(uallong(pc[0])));
pc++;
break;
case PCD_PLAYERCOUNT:
PushToStack (CountPlayers ());
break;
case PCD_GAMETYPE:
if (gamestate == GS_TITLELEVEL)
PushToStack (GAME_TITLE_MAP);
else if (deathmatch)
PushToStack (GAME_NET_DEATHMATCH);
else if (multiplayer)
PushToStack (GAME_NET_COOPERATIVE);
else
PushToStack (GAME_SINGLE_PLAYER);
break;
case PCD_GAMESKILL:
PushToStack (G_SkillProperty(SKILLP_ACSReturn));
break;
// [BC] Start ST PCD's
case PCD_PLAYERHEALTH:
if (activator)
PushToStack (activator->health);
else
PushToStack (0);
break;
case PCD_PLAYERARMORPOINTS:
if (activator)
{
ABasicArmor *armor = activator->FindInventory<ABasicArmor>();
PushToStack (armor ? armor->Amount : 0);
}
else
{
PushToStack (0);
}
break;
case PCD_PLAYERFRAGS:
if (activator && activator->player)
PushToStack (activator->player->fragcount);
else
PushToStack (0);
break;
case PCD_MUSICCHANGE:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL)
{
S_ChangeMusic (lookup, STACK(1));
}
sp -= 2;
break;
case PCD_SINGLEPLAYER:
PushToStack (!netgame);
break;
// [BC] End ST PCD's
case PCD_TIMER:
PushToStack (level.time);
break;
case PCD_SECTORSOUND:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL)
{
if (activationline)
{
S_Sound (
Update to ZDoom r1062: - Rewrote myvsnprintf to use the StringFormat routines directly so that no additional memory needs to be allocated from the heap. - Polyobject sounds now play from their lines, similar to the way sector sounds are handled. - Why do polyobjects have a 3D start spot? Flattened it to 2D. - Moved the sector sound origin calculation out of fmodsound.cpp and into s_sound.cpp so that the near sound limiting will use the correct sound location for deciding on neighbors. - Removed the S_Sound() variant that allows for pointing the origin at an arbitrary point. It has been replaced with a variant that takes a polyobject as a source, since that was the only use that couldn't be rewritten with the other variants. This also fixes the bug that polyobject sounds were not successfully saved and caused a crash when reloading the game. Note that this is a significant change to how equality of sound sources is determined, so some things may not behave quite the same as before. (Which would be a bug, but hopefully everything still sounds the same.) - Adjusted the noise debug table so that fractional volume levels do not run into the adjacent columns. - Added a NullSoundRenderer so that most of the checks against a NULL GSnd can be removed. - Fixed: Looping sounds must always successfully allocate a channel, even if it's only a pre-evicted channel. - Added A_ClearReFire code pointer for weapons. Preferably A_WeaponReady should reset this counter but that can't be done due to unwanted side effects with existing weapons. - Changed the 'scale' variable in CVAR(turbo) to double because the calculations depended on the current floating point precision setting and only worked properly when set to 'precise' in VC++. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@130 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-04 16:54:29 +00:00
activationline->frontsector,
CHAN_AUTO, // Not CHAN_AREA, because that'd probably break existing scripts.
lookup,
(float)(STACK(1)) / 127.f,
ATTN_NORM);
}
else
{
S_Sound (
CHAN_AUTO,
lookup,
(float)(STACK(1)) / 127.f,
ATTN_NORM);
}
}
sp -= 2;
break;
case PCD_AMBIENTSOUND:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL)
{
S_Sound (CHAN_AUTO,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
sp -= 2;
break;
case PCD_LOCALAMBIENTSOUND:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL && activator->CheckLocalView (consoleplayer))
{
S_Sound (CHAN_AUTO,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
sp -= 2;
break;
case PCD_ACTIVATORSOUND:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL)
{
Update to ZDoom r1073: - Fixed: When Heretic's Mace was replaced by a non-child class A_SpawnMace still treated it as a mace and wrote into some undefined memory. - Fixed: A_BishopMissileWeave didn't initialize special2 for proper movement. - Added a speed parameter to A_SkullAttack. - Fixed: Black as first or only blood color didn't work. - Fixed: Sounds played in wi_stuff.cpp and f_finale.cpp need the CHAN_UI flag. - Fixed: Spawning a player could play the *gasp sound. - Fixed: SBARINFO's health display didn't scale to the proper maximum. - Added const char &operator[] (unsigned int index) to FString class. - Added Skulltag's Teleport_NoStop action special. - Fixed: Strife's EntityBoss didn't copy friendliness information to the sub-entities. - Fixed: Friendly spectral monsters should be able to hurt unfriendly ones and vice versa. - Fixed: In deathmatch specral missiles spawned by players should hurt other players. - Fixed: SpectralLightningBigBall didn't set the proper owner for the lightning projectiles it spawned. - Changed the EntityBoss's attack function to call the equivalent spectre functions instead of duplicating their code. - Gave many of Strife's code pointers that only had a number as name more meaningful names. - Fixed: All spectral attacks must set 'health' first before P_CheckMissileSpawn is called. - Added a compatibility option to play sector sounds from the precalculated center because some maps apparently abuse the behavior to make the sound play somewhere where it can't be heard by the player to fake silent movement. - Fixed: The S_Sound variant taking an actor must check if the actor is not NULL. - Fixed: ACS's ActivatorSound must check if the activator is valid. - Changed stats drawing so that multi-line strings can be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@132 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-19 23:52:06 +00:00
if (activator != NULL)
{
S_Sound (activator, CHAN_AUTO,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NORM);
}
else
{
S_Sound (CHAN_AUTO,
lookup,
(float)(STACK(1)) / 127.f, ATTN_NONE);
}
}
sp -= 2;
break;
case PCD_SOUNDSEQUENCE:
lookup = FBehavior::StaticLookupString (STACK(1));
if (lookup != NULL)
{
- fixed: Calculating sector heights with transparent door hacks was wrong. - fixed: Sector height was wrong for sectors that have a slope transfer for a horizontal plane. - better error reporting for shader compile errors. Update to ZDoom r1942: - Changes to both A_MonsterRail() and A_CustomRailgun(): Save actor's pitch, use a larger aiming range, ignore non-targets in P_AimLineAttack(), and aim at the target anyway even if P_AimLineAttack() decides it has no chance of hitting. - Added another parameter to P_AimLineAttack(): A target to be aimed at. If this is non-NULL, then all actors between the shooter and the target will be ignored. - Added new sound sequence ACS functions: SoundSequenceOnActor(int tid, string seqname); SoundSequenceOnSector(int tag, string seqname, int location); SoundSequenceOnPolyobj(int polynum, string seqname); SoundSequenceOnSector takes an extra parameter that specifies where in the sector the sound comes from (floor, ceiling, interior, or all of it). See the SECSEQ defines in zdefs.acs. - Fixed: R_RenderDecal() must save various Wall globals, because the originals may still be needed. In particular, when drawing a seg with a midtexture is split by foreground geometry, the first drawseg generated from it will have the correct WallSZ1,2 values, but subsequent ones will have whatever R_RenderDecal() left behind. These values are used to calculate the upper and lower bounds of the midtexture. (Ironically, my work to Build-ify things had done away with these globals, but that's gone now.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@581 b0f79afe-0144-0410-b225-9a4edf0717df
2009-10-28 20:14:24 +00:00
if (activationline != NULL)
{
SN_StartSequence (activationline->frontsector, CHAN_FULLHEIGHT, lookup, 0);
}
}
sp--;
break;
case PCD_SETLINETEXTURE:
SetLineTexture (STACK(4), STACK(3), STACK(2), STACK(1));
sp -= 4;
break;
case PCD_REPLACETEXTURES:
ReplaceTextures (STACK(3), STACK(2), STACK(1));
sp -= 3;
break;
case PCD_SETLINEBLOCKING:
{
int line = -1;
while ((line = P_FindLineFromID (STACK(2), line)) >= 0)
{
switch (STACK(1))
{
case BLOCK_NOTHING:
lines[line].flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING|ML_RAILING|ML_BLOCK_PLAYERS);
break;
case BLOCK_CREATURES:
default:
lines[line].flags &= ~(ML_BLOCKEVERYTHING|ML_RAILING|ML_BLOCK_PLAYERS);
lines[line].flags |= ML_BLOCKING;
break;
case BLOCK_EVERYTHING:
lines[line].flags &= ~(ML_RAILING|ML_BLOCK_PLAYERS);
lines[line].flags |= ML_BLOCKING|ML_BLOCKEVERYTHING;
break;
case BLOCK_RAILING:
lines[line].flags &= ~(ML_BLOCKEVERYTHING|ML_BLOCK_PLAYERS);
lines[line].flags |= ML_RAILING|ML_BLOCKING;
break;
case BLOCK_PLAYERS:
lines[line].flags &= ~(ML_BLOCKEVERYTHING|ML_BLOCKING|ML_RAILING);
lines[line].flags |= ML_BLOCK_PLAYERS;
break;
}
}
sp -= 2;
}
break;
case PCD_SETLINEMONSTERBLOCKING:
{
int line = -1;
while ((line = P_FindLineFromID (STACK(2), line)) >= 0)
{
if (STACK(1))
lines[line].flags |= ML_BLOCKMONSTERS;
else
lines[line].flags &= ~ML_BLOCKMONSTERS;
}
sp -= 2;
}
break;
case PCD_SETLINESPECIAL:
{
int linenum = -1;
int specnum = STACK(6);
int arg0 = STACK(5);
// Convert named ACS "specials" into real specials.
if (specnum >= -ACSF_ACS_NamedExecuteAlways && specnum <= -ACSF_ACS_NamedExecute)
{
specnum = NamedACSToNormalACS[-specnum - ACSF_ACS_NamedExecute];
arg0 = -FName(FBehavior::StaticLookupString(arg0));
}
while ((linenum = P_FindLineFromID (STACK(7), linenum)) >= 0)
{
line_t *line = &lines[linenum];
line->special = specnum;
line->args[0] = arg0;
line->args[1] = STACK(4);
line->args[2] = STACK(3);
line->args[3] = STACK(2);
line->args[4] = STACK(1);
DPrintf("Set special on line %d (id %d) to %d(%d,%d,%d,%d,%d)\n",
linenum, STACK(7), specnum, arg0, STACK(4), STACK(3), STACK(2), STACK(1));
}
sp -= 7;
}
break;
case PCD_SETTHINGSPECIAL:
{
int specnum = STACK(6);
int arg0 = STACK(5);
// Convert named ACS "specials" into real specials.
if (specnum >= -ACSF_ACS_NamedExecuteAlways && specnum <= -ACSF_ACS_NamedExecute)
{
specnum = NamedACSToNormalACS[-specnum - ACSF_ACS_NamedExecute];
arg0 = -FName(FBehavior::StaticLookupString(arg0));
}
if (STACK(7) != 0)
{
FActorIterator iterator (STACK(7));
AActor *actor;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
while ( (actor = iterator.Next ()) )
{
actor->special = specnum;
actor->args[0] = arg0;
actor->args[1] = STACK(4);
actor->args[2] = STACK(3);
actor->args[3] = STACK(2);
actor->args[4] = STACK(1);
}
}
else if (activator != NULL)
{
activator->special = specnum;
activator->args[0] = arg0;
activator->args[1] = STACK(4);
activator->args[2] = STACK(3);
activator->args[3] = STACK(2);
activator->args[4] = STACK(1);
}
sp -= 7;
}
break;
case PCD_THINGSOUND:
lookup = FBehavior::StaticLookupString (STACK(2));
if (lookup != NULL)
{
FActorIterator iterator (STACK(3));
AActor *spot;
while ( (spot = iterator.Next ()) )
{
S_Sound (spot, CHAN_AUTO,
lookup,
(float)(STACK(1))/127.f, ATTN_NORM);
}
}
sp -= 3;
break;
case PCD_FIXEDMUL:
STACK(2) = FixedMul (STACK(2), STACK(1));
sp--;
break;
case PCD_FIXEDDIV:
STACK(2) = FixedDiv (STACK(2), STACK(1));
sp--;
break;
case PCD_SETGRAVITY:
level.gravity = (float)STACK(1) / 65536.f;
sp--;
break;
case PCD_SETGRAVITYDIRECT:
level.gravity = (float)uallong(pc[0]) / 65536.f;
pc++;
break;
case PCD_SETAIRCONTROL:
level.aircontrol = STACK(1);
sp--;
G_AirControlChanged ();
break;
case PCD_SETAIRCONTROLDIRECT:
level.aircontrol = uallong(pc[0]);
pc++;
G_AirControlChanged ();
break;
case PCD_SPAWN:
STACK(6) = DoSpawn (STACK(6), STACK(5), STACK(4), STACK(3), STACK(2), STACK(1), false);
sp -= 5;
break;
case PCD_SPAWNDIRECT:
PushToStack (DoSpawn (TAGSTR(uallong(pc[0])), uallong(pc[1]), uallong(pc[2]), uallong(pc[3]), uallong(pc[4]), uallong(pc[5]), false));
pc += 6;
break;
case PCD_SPAWNSPOT:
STACK(4) = DoSpawnSpot (STACK(4), STACK(3), STACK(2), STACK(1), false);
sp -= 3;
break;
case PCD_SPAWNSPOTDIRECT:
PushToStack (DoSpawnSpot (TAGSTR(uallong(pc[0])), uallong(pc[1]), uallong(pc[2]), uallong(pc[3]), false));
pc += 4;
break;
case PCD_SPAWNSPOTFACING:
STACK(3) = DoSpawnSpotFacing (STACK(3), STACK(2), STACK(1), false);
sp -= 2;
break;
case PCD_CLEARINVENTORY:
ClearInventory (activator);
break;
case PCD_CLEARACTORINVENTORY:
Update to ZDoom r2249: - fixed: Explosions directly under a water surface would not hurt any actor directly above this surface. - cleaned up P_CheckSight flag handling. - Use normal texture animation for the main menu cursors. This required updating animations all the time and not just when inside a level. - fixed: IDBEHOLD altered the item counter. - fixed: P_SpawnMapThing always reduced the angular precision to 45 degrees. - removed AngleIncrements because it's not really useful. - fixed: Level redirection checked the wrong level. - Fixed: ClearActorInventory used the wrong stack index to get its parameter. - P_ZMovement() temporarily disables jumping after a landing. Don't do this if the jump timer is already running or for short falls (e.g. along the edges of slopes, since the slope floorz calculation is pretty crappy.) - Keep all damage factors in the table, even those that are 1.0. - 256 is a valid pain chance, so clamp to that, not 255. - Fixed: TMap::DelKey failed if the key's main position was nil, because it tried checking for it at the "next" position, which is an invalid pointer in that case. - Changed A_SetUserVar and A_SetUserArray so they affect the actor that called it, which is not necessarily "self". The only visible change from this should be that inventory items now set their own variables and not their owners'. - added a CrushPainSound actor property for Strife. - fixed memory leaks in SBARINFO and WAD loading code. - added GetBloodColor and GetBloodType inline functions to AActor to wrap the GetMeta calls used for this. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@756 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-27 07:46:42 +00:00
if (STACK(1) == 0)
{
ClearInventory(NULL);
}
else
{
Update to ZDoom r2249: - fixed: Explosions directly under a water surface would not hurt any actor directly above this surface. - cleaned up P_CheckSight flag handling. - Use normal texture animation for the main menu cursors. This required updating animations all the time and not just when inside a level. - fixed: IDBEHOLD altered the item counter. - fixed: P_SpawnMapThing always reduced the angular precision to 45 degrees. - removed AngleIncrements because it's not really useful. - fixed: Level redirection checked the wrong level. - Fixed: ClearActorInventory used the wrong stack index to get its parameter. - P_ZMovement() temporarily disables jumping after a landing. Don't do this if the jump timer is already running or for short falls (e.g. along the edges of slopes, since the slope floorz calculation is pretty crappy.) - Keep all damage factors in the table, even those that are 1.0. - 256 is a valid pain chance, so clamp to that, not 255. - Fixed: TMap::DelKey failed if the key's main position was nil, because it tried checking for it at the "next" position, which is an invalid pointer in that case. - Changed A_SetUserVar and A_SetUserArray so they affect the actor that called it, which is not necessarily "self". The only visible change from this should be that inventory items now set their own variables and not their owners'. - added a CrushPainSound actor property for Strife. - fixed memory leaks in SBARINFO and WAD loading code. - added GetBloodColor and GetBloodType inline functions to AActor to wrap the GetMeta calls used for this. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@756 b0f79afe-0144-0410-b225-9a4edf0717df
2010-03-27 07:46:42 +00:00
FActorIterator it(STACK(1));
AActor *actor;
for (actor = it.Next(); actor != NULL; actor = it.Next())
{
ClearInventory(actor);
}
}
sp--;
break;
case PCD_GIVEINVENTORY:
GiveInventory (activator, FBehavior::StaticLookupString (STACK(2)), STACK(1));
sp -= 2;
break;
case PCD_GIVEACTORINVENTORY:
{
const char *type = FBehavior::StaticLookupString(STACK(2));
if (STACK(3) == 0)
{
GiveInventory(NULL, FBehavior::StaticLookupString(STACK(2)), STACK(1));
}
else
{
FActorIterator it(STACK(3));
AActor *actor;
for (actor = it.Next(); actor != NULL; actor = it.Next())
{
GiveInventory(actor, type, STACK(1));
}
}
sp -= 3;
}
break;
case PCD_GIVEINVENTORYDIRECT:
GiveInventory (activator, FBehavior::StaticLookupString (TAGSTR(uallong(pc[0]))), uallong(pc[1]));
pc += 2;
break;
case PCD_TAKEINVENTORY:
TakeInventory (activator, FBehavior::StaticLookupString (STACK(2)), STACK(1));
sp -= 2;
break;
case PCD_TAKEACTORINVENTORY:
{
const char *type = FBehavior::StaticLookupString(STACK(2));
if (STACK(3) == 0)
{
TakeInventory(NULL, type, STACK(1));
}
else
{
FActorIterator it(STACK(3));
AActor *actor;
for (actor = it.Next(); actor != NULL; actor = it.Next())
{
TakeInventory(actor, type, STACK(1));
}
}
sp -= 3;
}
break;
case PCD_TAKEINVENTORYDIRECT:
TakeInventory (activator, FBehavior::StaticLookupString (TAGSTR(uallong(pc[0]))), uallong(pc[1]));
pc += 2;
break;
case PCD_CHECKINVENTORY:
STACK(1) = CheckInventory (activator, FBehavior::StaticLookupString (STACK(1)));
break;
case PCD_CHECKACTORINVENTORY:
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
STACK(2) = CheckInventory (SingleActorFromTID(STACK(2), NULL),
FBehavior::StaticLookupString (STACK(1)));
sp--;
break;
case PCD_CHECKINVENTORYDIRECT:
PushToStack (CheckInventory (activator, FBehavior::StaticLookupString (TAGSTR(uallong(pc[0])))));
pc += 1;
break;
case PCD_USEINVENTORY:
STACK(1) = UseInventory (activator, FBehavior::StaticLookupString (STACK(1)));
break;
case PCD_USEACTORINVENTORY:
{
int ret = 0;
const char *type = FBehavior::StaticLookupString(STACK(1));
if (STACK(2) == 0)
{
ret = UseInventory(NULL, type);
}
else
{
FActorIterator it(STACK(2));
AActor *actor;
for (actor = it.Next(); actor != NULL; actor = it.Next())
{
ret += UseInventory(actor, type);
}
}
STACK(2) = ret;
sp--;
}
break;
case PCD_GETSIGILPIECES:
{
ASigil *sigil;
if (activator == NULL || (sigil = activator->FindInventory<ASigil>()) == NULL)
{
PushToStack (0);
}
else
{
PushToStack (sigil->NumPieces);
}
}
break;
case PCD_GETAMMOCAPACITY:
if (activator != NULL)
{
const PClass *type = PClass::FindClass (FBehavior::StaticLookupString (STACK(1)));
AInventory *item;
if (type != NULL && type->ParentClass == RUNTIME_CLASS(AAmmo))
{
item = activator->FindInventory (type);
if (item != NULL)
{
STACK(1) = item->MaxAmount;
}
else
{
STACK(1) = ((AInventory *)GetDefaultByType (type))->MaxAmount;
}
}
else
{
STACK(1) = 0;
}
}
else
{
STACK(1) = 0;
}
break;
case PCD_SETAMMOCAPACITY:
if (activator != NULL)
{
const PClass *type = PClass::FindClass (FBehavior::StaticLookupString (STACK(2)));
AInventory *item;
if (type != NULL && type->ParentClass == RUNTIME_CLASS(AAmmo))
{
item = activator->FindInventory (type);
if (item != NULL)
{
item->MaxAmount = STACK(1);
}
else
{
item = activator->GiveInventoryType (type);
item->MaxAmount = STACK(1);
item->Amount = 0;
}
}
}
sp -= 2;
break;
case PCD_SETMUSIC:
S_ChangeMusic (FBehavior::StaticLookupString (STACK(3)), STACK(2));
sp -= 3;
break;
case PCD_SETMUSICDIRECT:
S_ChangeMusic (FBehavior::StaticLookupString (TAGSTR(uallong(pc[0]))), uallong(pc[1]));
pc += 3;
break;
case PCD_LOCALSETMUSIC:
if (activator == players[consoleplayer].mo)
{
S_ChangeMusic (FBehavior::StaticLookupString (STACK(3)), STACK(2));
}
sp -= 3;
break;
case PCD_LOCALSETMUSICDIRECT:
if (activator == players[consoleplayer].mo)
{
S_ChangeMusic (FBehavior::StaticLookupString (TAGSTR(uallong(pc[0]))), uallong(pc[1]));
}
pc += 3;
break;
case PCD_FADETO:
DoFadeTo (STACK(5), STACK(4), STACK(3), STACK(2), STACK(1));
sp -= 5;
break;
case PCD_FADERANGE:
DoFadeRange (STACK(9), STACK(8), STACK(7), STACK(6),
STACK(5), STACK(4), STACK(3), STACK(2), STACK(1));
sp -= 9;
break;
case PCD_CANCELFADE:
{
TThinkerIterator<DFlashFader> iterator;
DFlashFader *fader;
while ( (fader = iterator.Next()) )
{
if (activator == NULL || fader->WhoFor() == activator)
{
fader->Cancel ();
}
}
}
break;
case PCD_PLAYMOVIE:
STACK(1) = I_PlayMovie (FBehavior::StaticLookupString (STACK(1)));
break;
case PCD_SETACTORPOSITION:
{
bool result = false;
AActor *actor = SingleActorFromTID (STACK(5), activator);
if (actor != NULL)
result = P_MoveThing(actor, STACK(4), STACK(3), STACK(2), !!STACK(1));
sp -= 4;
STACK(1) = result;
}
break;
case PCD_GETACTORX:
case PCD_GETACTORY:
case PCD_GETACTORZ:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
if (actor == NULL)
{
STACK(1) = 0;
}
else if (pcd == PCD_GETACTORZ)
{
STACK(1) = actor->z + actor->GetBobOffset();
}
else
{
STACK(1) = (&actor->x)[pcd - PCD_GETACTORX];
}
}
break;
case PCD_GETACTORFLOORZ:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : actor->floorz;
}
break;
case PCD_GETACTORCEILINGZ:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : actor->ceilingz;
}
break;
case PCD_GETACTORANGLE:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : actor->angle >> 16;
}
break;
case PCD_GETACTORPITCH:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : actor->pitch >> 16;
}
break;
case PCD_GETLINEROWOFFSET:
if (activationline != NULL)
{
PushToStack (activationline->sidedef[0]->GetTextureYOffset(side_t::mid) >> FRACBITS);
}
else
{
PushToStack (0);
}
break;
case PCD_GETSECTORFLOORZ:
case PCD_GETSECTORCEILINGZ:
// Arguments are (tag, x, y). If you don't use slopes, then (x, y) don't
// really matter and can be left as (0, 0) if you like.
{
int secnum = P_FindSectorFromTag (STACK(3), -1);
fixed_t z = 0;
if (secnum >= 0)
{
fixed_t x = STACK(2) << FRACBITS;
fixed_t y = STACK(1) << FRACBITS;
if (pcd == PCD_GETSECTORFLOORZ)
{
z = sectors[secnum].floorplane.ZatPoint (x, y);
}
else
{
z = sectors[secnum].ceilingplane.ZatPoint (x, y);
}
}
sp -= 2;
STACK(1) = z;
}
break;
case PCD_GETSECTORLIGHTLEVEL:
{
int secnum = P_FindSectorFromTag (STACK(1), -1);
int z = -1;
if (secnum >= 0)
{
z = sectors[secnum].lightlevel;
}
STACK(1) = z;
}
break;
case PCD_SETFLOORTRIGGER:
new DPlaneWatcher (activator, activationline, backSide, false, STACK(8),
STACK(7), STACK(6), STACK(5), STACK(4), STACK(3), STACK(2), STACK(1));
sp -= 8;
break;
case PCD_SETCEILINGTRIGGER:
new DPlaneWatcher (activator, activationline, backSide, true, STACK(8),
STACK(7), STACK(6), STACK(5), STACK(4), STACK(3), STACK(2), STACK(1));
sp -= 8;
break;
case PCD_STARTTRANSLATION:
{
int i = STACK(1);
sp--;
if (i >= 1 && i <= MAX_ACS_TRANSLATIONS)
{
translation = translationtables[TRANSLATION_LevelScripted].GetVal(i - 1);
if (translation == NULL)
{
translation = new FRemapTable;
translationtables[TRANSLATION_LevelScripted].SetVal(i - 1, translation);
}
translation->MakeIdentity();
}
}
break;
case PCD_TRANSLATIONRANGE1:
{ // translation using palette shifting
int start = STACK(4);
int end = STACK(3);
int pal1 = STACK(2);
int pal2 = STACK(1);
sp -= 4;
if (translation != NULL)
translation->AddIndexRange(start, end, pal1, pal2);
}
break;
case PCD_TRANSLATIONRANGE2:
{ // translation using RGB values
// (would HSV be a good idea too?)
int start = STACK(8);
int end = STACK(7);
int r1 = STACK(6);
int g1 = STACK(5);
int b1 = STACK(4);
int r2 = STACK(3);
int g2 = STACK(2);
int b2 = STACK(1);
sp -= 8;
if (translation != NULL)
translation->AddColorRange(start, end, r1, g1, b1, r2, g2, b2);
}
break;
case PCD_TRANSLATIONRANGE3:
{ // translation using desaturation
int start = STACK(8);
int end = STACK(7);
fixed_t r1 = STACK(6);
fixed_t g1 = STACK(5);
fixed_t b1 = STACK(4);
fixed_t r2 = STACK(3);
fixed_t g2 = STACK(2);
fixed_t b2 = STACK(1);
sp -= 8;
if (translation != NULL)
translation->AddDesaturation(start, end,
FIXED2DBL(r1), FIXED2DBL(g1), FIXED2DBL(b1),
FIXED2DBL(r2), FIXED2DBL(g2), FIXED2DBL(b2));
}
break;
case PCD_ENDTRANSLATION:
// This might be useful for hardware rendering, but
// for software it is superfluous.
translation->UpdateNative();
translation = NULL;
break;
case PCD_SIN:
STACK(1) = finesine[angle_t(STACK(1)<<16)>>ANGLETOFINESHIFT];
break;
case PCD_COS:
STACK(1) = finecosine[angle_t(STACK(1)<<16)>>ANGLETOFINESHIFT];
break;
case PCD_VECTORANGLE:
STACK(2) = R_PointToAngle2 (0, 0, STACK(2), STACK(1)) >> 16;
sp--;
break;
case PCD_CHECKWEAPON:
if (activator == NULL || activator->player == NULL || // Non-players do not have weapons
activator->player->ReadyWeapon == NULL)
{
STACK(1) = 0;
}
else
{
STACK(1) = activator->player->ReadyWeapon->GetClass()->TypeName == FName(FBehavior::StaticLookupString (STACK(1)), true);
}
break;
case PCD_SETWEAPON:
if (activator == NULL || activator->player == NULL)
{
STACK(1) = 0;
}
else
{
AInventory *item = activator->FindInventory (PClass::FindClass (
FBehavior::StaticLookupString (STACK(1))));
if (item == NULL || !item->IsKindOf (RUNTIME_CLASS(AWeapon)))
{
STACK(1) = 0;
}
else if (activator->player->ReadyWeapon == item)
{
// The weapon is already selected, so setweapon succeeds by default,
// but make sure the player isn't switching away from it.
activator->player->PendingWeapon = WP_NOCHANGE;
STACK(1) = 1;
}
else
{
AWeapon *weap = static_cast<AWeapon *> (item);
if (weap->CheckAmmo (AWeapon::EitherFire, false))
{
// There's enough ammo, so switch to it.
STACK(1) = 1;
activator->player->PendingWeapon = weap;
}
else
{
STACK(1) = 0;
}
}
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case PCD_SETMARINEWEAPON:
if (STACK(2) != 0)
{
AScriptedMarine *marine;
TActorIterator<AScriptedMarine> iterator (STACK(2));
while ((marine = iterator.Next()) != NULL)
{
marine->SetWeapon ((AScriptedMarine::EMarineWeapon)STACK(1));
}
}
else
{
if (activator != NULL && activator->IsKindOf (RUNTIME_CLASS(AScriptedMarine)))
{
barrier_cast<AScriptedMarine *>(activator)->SetWeapon (
(AScriptedMarine::EMarineWeapon)STACK(1));
}
}
sp -= 2;
break;
case PCD_SETMARINESPRITE:
{
const PClass *type = PClass::FindClass (FBehavior::StaticLookupString (STACK(1)));
if (type != NULL)
{
if (STACK(2) != 0)
{
AScriptedMarine *marine;
TActorIterator<AScriptedMarine> iterator (STACK(2));
while ((marine = iterator.Next()) != NULL)
{
marine->SetSprite (type);
}
}
else
{
if (activator != NULL && activator->IsKindOf (RUNTIME_CLASS(AScriptedMarine)))
{
barrier_cast<AScriptedMarine *>(activator)->SetSprite (type);
}
}
}
else
{
Printf ("Unknown actor type: %s\n", FBehavior::StaticLookupString (STACK(1)));
}
}
sp -= 2;
break;
case PCD_SETACTORPROPERTY:
SetActorProperty (STACK(3), STACK(2), STACK(1));
sp -= 3;
break;
case PCD_GETACTORPROPERTY:
STACK(2) = GetActorProperty (STACK(2), STACK(1));
sp -= 1;
break;
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
case PCD_GETPLAYERINPUT:
STACK(2) = GetPlayerInput (STACK(2), STACK(1));
sp -= 1;
break;
case PCD_PLAYERNUMBER:
if (activator == NULL || activator->player == NULL)
{
PushToStack (-1);
}
else
{
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
PushToStack (int(activator->player - players));
}
break;
case PCD_PLAYERINGAME:
if (STACK(1) < 0 || STACK(1) > MAXPLAYERS)
{
STACK(1) = false;
}
else
{
STACK(1) = playeringame[STACK(1)];
}
break;
case PCD_PLAYERISBOT:
if (STACK(1) < 0 || STACK(1) > MAXPLAYERS || !playeringame[STACK(1)])
{
STACK(1) = false;
}
else
{
STACK(1) = players[STACK(1)].isbot;
}
break;
case PCD_ACTIVATORTID:
if (activator == NULL)
{
PushToStack (0);
}
else
{
PushToStack (activator->tid);
}
break;
case PCD_GETSCREENWIDTH:
PushToStack (SCREENWIDTH);
break;
case PCD_GETSCREENHEIGHT:
PushToStack (SCREENHEIGHT);
break;
case PCD_THING_PROJECTILE2:
// Like Thing_Projectile(Gravity) specials, but you can give the
// projectile a TID.
// Thing_Projectile2 (tid, type, angle, speed, vspeed, gravity, newtid);
P_Thing_Projectile (STACK(7), activator, STACK(6), NULL, ((angle_t)(STACK(5)<<24)),
STACK(4)<<(FRACBITS-3), STACK(3)<<(FRACBITS-3), 0, NULL, STACK(2), STACK(1), false);
sp -= 7;
break;
case PCD_SPAWNPROJECTILE:
// Same, but takes an actor name instead of a spawn ID.
P_Thing_Projectile (STACK(7), activator, 0, FBehavior::StaticLookupString (STACK(6)), ((angle_t)(STACK(5)<<24)),
STACK(4)<<(FRACBITS-3), STACK(3)<<(FRACBITS-3), 0, NULL, STACK(2), STACK(1), false);
sp -= 7;
break;
case PCD_STRLEN:
STACK(1) = SDWORD(strlen(FBehavior::StaticLookupString (STACK(1))));
break;
case PCD_GETCVAR:
{
FBaseCVar *cvar = FindCVar (FBehavior::StaticLookupString (STACK(1)), NULL);
if (cvar == NULL)
{
STACK(1) = 0;
}
else
{
UCVarValue val = cvar->GetGenericRep (CVAR_Int);
STACK(1) = val.Int;
}
}
break;
case PCD_SETHUDSIZE:
hudwidth = abs (STACK(3));
hudheight = abs (STACK(2));
if (STACK(1) != 0)
{ // Negative height means to cover the status bar
hudheight = -hudheight;
}
sp -= 3;
break;
case PCD_GETLEVELINFO:
switch (STACK(1))
{
case LEVELINFO_PAR_TIME: STACK(1) = level.partime; break;
case LEVELINFO_SUCK_TIME: STACK(1) = level.sucktime; break;
case LEVELINFO_CLUSTERNUM: STACK(1) = level.cluster; break;
case LEVELINFO_LEVELNUM: STACK(1) = level.levelnum; break;
case LEVELINFO_TOTAL_SECRETS: STACK(1) = level.total_secrets; break;
case LEVELINFO_FOUND_SECRETS: STACK(1) = level.found_secrets; break;
case LEVELINFO_TOTAL_ITEMS: STACK(1) = level.total_items; break;
case LEVELINFO_FOUND_ITEMS: STACK(1) = level.found_items; break;
case LEVELINFO_TOTAL_MONSTERS: STACK(1) = level.total_monsters; break;
case LEVELINFO_KILLED_MONSTERS: STACK(1) = level.killed_monsters; break;
default: STACK(1) = 0; break;
}
break;
case PCD_CHANGESKY:
{
const char *sky1name, *sky2name;
sky1name = FBehavior::StaticLookupString (STACK(2));
sky2name = FBehavior::StaticLookupString (STACK(1));
if (sky1name[0] != 0)
{
strncpy (level.skypic1, sky1name, 8);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
sky1texture = TexMan.GetTexture (sky1name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
}
if (sky2name[0] != 0)
{
strncpy (level.skypic2, sky2name, 8);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
sky2texture = TexMan.GetTexture (sky2name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
}
R_InitSkyMap ();
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sp -= 2;
}
break;
case PCD_SETCAMERATOTEXTURE:
{
const char *picname = FBehavior::StaticLookupString (STACK(2));
AActor *camera;
if (STACK(3) == 0)
{
camera = activator;
}
else
{
FActorIterator it (STACK(3));
camera = it.Next ();
}
if (camera != NULL)
{
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
FTextureID picnum = TexMan.CheckForTexture (picname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
if (!picnum.Exists())
{
Printf ("SetCameraToTexture: %s is not a texture\n", picname);
}
else
{
FCanvasTextureInfo::Add (camera, picnum, STACK(1));
}
}
sp -= 3;
}
break;
case PCD_SETACTORANGLE: // [GRB]
if (STACK(2) == 0)
{
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
if (activator != NULL)
activator->angle = STACK(1) << 16;
}
else
{
FActorIterator iterator (STACK(2));
AActor *actor;
while ( (actor = iterator.Next ()) )
{
actor->angle = STACK(1) << 16;
}
}
sp -= 2;
break;
case PCD_SETACTORPITCH:
if (STACK(2) == 0)
{
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
if (activator != NULL)
activator->pitch = STACK(1) << 16;
}
else
{
FActorIterator iterator (STACK(2));
AActor *actor;
while ( (actor = iterator.Next ()) )
{
actor->pitch = STACK(1) << 16;
}
}
sp -= 2;
break;
case PCD_SETACTORSTATE:
{
const char *statename = FBehavior::StaticLookupString (STACK(2));
FState *state;
if (STACK(3) == 0)
{
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
if (activator != NULL)
{
Update to ZDoom r1246: - Used the one unused byte in the state structure as a flag to tell what type the NextState parameter is. The code did some rather unsafe checks with it to determine its type. - moved all state related code into a new file: p_states.cpp. - merged all FindState functions. All the different variations are now inlined and call the same function to do the real work. - did some code cleanup and reorganization in thingdef.cpp. - Replaced the translation parser for TEXTURES with FRemapTable::AddToTranslation. - To get the game name the screenshot code might as well use the globally available GameNames array instead of creating its own list. - Moved backpack names for cheat into gameinfo. - Fixed: SNDINFO must be loaded before the textures. However, this required some changes to the MAPINFO parser which tried to access the texture manager to check if the level name patches exist. That check had to be moved to where the intermission screen is set up. - Fixed: 'bloodcolor' ignored the first parameter value when given a list of integers. Please note that this creates an incompatibility between old and new versions so if you want to create something that works with both 2.2.0 and current versions better use the string format version for the color parameter! - Rewrote the DECORATE property parser so that the parser is completely separated from the property handlers. This should allow reuse of all the handler code for a new format if Doomscript requires one. - Fixed: PClass::InitializeActorInfo copied too many bytes if a subclass's defaults were larger than the parent's. - Moved A_ChangeFlag to thingdef_codeptr.cpp. - Moved translation related code from thingdef_properties.cpp to r_translate.cpp and rewrote the translation parser to use FScanner instead of strtol. - replaced DECORATE's 'alpha default' by 'defaultalpha' for consistency. Since this was never used outside zdoom.pk3 it's not critical. - Removed support for game specific pickup messages because the only thing this was ever used for - Raven's invulnerability item - has already been split up into a Heretic and Hexen version. - Fixed: The Timidity config parser always tried to process the note number, even if it wasn't specified. - Fixed: When UpdateJoystickMenu() modifies the menu items for different controllers, the joystick axis selectors need to NULL the d.graycheck field, since this is shared by the axis sensitivity sliders' step values. - Fixed: The crosshair must be initialized after the texture manager because on the fly texture creation for graphics patches is no longer supported. - Fixed a few Linux compile errors. - Changed: Replaced weapons should not be given by generic cheats, only when explicitly giving them. - Changed 'give weapon' cheat so that in single player it only gives weapons belonging to the current game or are placed in a weapon slot to avoid giving the Chex Quest weapons in Doom and vice versa. - Fixed: The texture manager must be the first thing to be initialized because MAPINFO and DECORATE both can reference textures and letting them create their own textures is not safe. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@181 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-23 21:41:49 +00:00
state = activator->GetClass()->ActorInfo->FindStateByString (statename, !!STACK(1));
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
if (state != NULL)
{
activator->SetState (state);
STACK(3) = 1;
}
else
{
STACK(3) = 0;
}
}
}
else
{
FActorIterator iterator (STACK(3));
AActor *actor;
int count = 0;
while ( (actor = iterator.Next ()) )
{
Update to ZDoom r1246: - Used the one unused byte in the state structure as a flag to tell what type the NextState parameter is. The code did some rather unsafe checks with it to determine its type. - moved all state related code into a new file: p_states.cpp. - merged all FindState functions. All the different variations are now inlined and call the same function to do the real work. - did some code cleanup and reorganization in thingdef.cpp. - Replaced the translation parser for TEXTURES with FRemapTable::AddToTranslation. - To get the game name the screenshot code might as well use the globally available GameNames array instead of creating its own list. - Moved backpack names for cheat into gameinfo. - Fixed: SNDINFO must be loaded before the textures. However, this required some changes to the MAPINFO parser which tried to access the texture manager to check if the level name patches exist. That check had to be moved to where the intermission screen is set up. - Fixed: 'bloodcolor' ignored the first parameter value when given a list of integers. Please note that this creates an incompatibility between old and new versions so if you want to create something that works with both 2.2.0 and current versions better use the string format version for the color parameter! - Rewrote the DECORATE property parser so that the parser is completely separated from the property handlers. This should allow reuse of all the handler code for a new format if Doomscript requires one. - Fixed: PClass::InitializeActorInfo copied too many bytes if a subclass's defaults were larger than the parent's. - Moved A_ChangeFlag to thingdef_codeptr.cpp. - Moved translation related code from thingdef_properties.cpp to r_translate.cpp and rewrote the translation parser to use FScanner instead of strtol. - replaced DECORATE's 'alpha default' by 'defaultalpha' for consistency. Since this was never used outside zdoom.pk3 it's not critical. - Removed support for game specific pickup messages because the only thing this was ever used for - Raven's invulnerability item - has already been split up into a Heretic and Hexen version. - Fixed: The Timidity config parser always tried to process the note number, even if it wasn't specified. - Fixed: When UpdateJoystickMenu() modifies the menu items for different controllers, the joystick axis selectors need to NULL the d.graycheck field, since this is shared by the axis sensitivity sliders' step values. - Fixed: The crosshair must be initialized after the texture manager because on the fly texture creation for graphics patches is no longer supported. - Fixed a few Linux compile errors. - Changed: Replaced weapons should not be given by generic cheats, only when explicitly giving them. - Changed 'give weapon' cheat so that in single player it only gives weapons belonging to the current game or are placed in a weapon slot to avoid giving the Chex Quest weapons in Doom and vice versa. - Fixed: The texture manager must be the first thing to be initialized because MAPINFO and DECORATE both can reference textures and letting them create their own textures is not safe. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@181 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-23 21:41:49 +00:00
state = actor->GetClass()->ActorInfo->FindStateByString (statename, !!STACK(1));
if (state != NULL)
{
actor->SetState (state);
count++;
}
}
STACK(3) = count;
}
sp -= 2;
}
break;
case PCD_PLAYERCLASS: // [GRB]
if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS || !playeringame[STACK(1)])
{
STACK(1) = -1;
}
else
{
STACK(1) = players[STACK(1)].CurrentPlayerClass;
}
break;
case PCD_GETPLAYERINFO: // [GRB]
if (STACK(2) < 0 || STACK(2) >= MAXPLAYERS || !playeringame[STACK(2)])
{
STACK(2) = -1;
}
else
{
player_t *pl = &players[STACK(2)];
userinfo_t *userinfo = &pl->userinfo;
switch (STACK(1))
{
case PLAYERINFO_TEAM: STACK(2) = userinfo->team; break;
case PLAYERINFO_AIMDIST: STACK(2) = userinfo->GetAimDist(); break;
case PLAYERINFO_COLOR: STACK(2) = userinfo->color; break;
case PLAYERINFO_GENDER: STACK(2) = userinfo->gender; break;
case PLAYERINFO_NEVERSWITCH: STACK(2) = userinfo->neverswitch; break;
case PLAYERINFO_MOVEBOB: STACK(2) = userinfo->MoveBob; break;
case PLAYERINFO_STILLBOB: STACK(2) = userinfo->StillBob; break;
case PLAYERINFO_PLAYERCLASS: STACK(2) = userinfo->PlayerClass; break;
case PLAYERINFO_DESIREDFOV: STACK(2) = (int)pl->DesiredFOV; break;
case PLAYERINFO_FOV: STACK(2) = (int)pl->FOV; break;
default: STACK(2) = 0; break;
}
}
sp -= 1;
break;
case PCD_CHANGELEVEL:
{
G_ChangeLevel(FBehavior::StaticLookupString(STACK(4)), STACK(3), STACK(2), STACK(1));
sp -= 4;
}
break;
case PCD_SECTORDAMAGE:
{
int tag = STACK(5);
int amount = STACK(4);
FName type = FBehavior::StaticLookupString(STACK(3));
FName protection = FName (FBehavior::StaticLookupString(STACK(2)), true);
const PClass *protectClass = PClass::FindClass (protection);
int flags = STACK(1);
sp -= 5;
P_SectorDamage(tag, amount, type, protectClass, flags);
}
Update to ZDoom r1069: - Added a check to G_DoSaveGame() to prevent saving when you're not actually in a level. - Fixed: Serialized player data must always be loaded, even if it's simply to be discarded, so that anything serialized after the players will load from the correct position in the file when revisiting a hub map. - Changed: AInventory::Tick now only calls the super method if the item is not owned. Having owned inventory items interact with the world is not supposed to happen. - Fixed: case PCD_SECTORDAMAGE in p_acs.cpp was missing a terminating 'break'. - Fixed: When a weapon is destroyed, its sister weapon must also be destroyed. - Added a check for PUFFGETSOWNER to A_BFGSpray. - Moved the PUFFGETSOWNER check into P_SpawnPuff and removed the limitation to players only. - Fixed: P_SpawnMapThing still checked FMapThing::flags for the class bits instead of FMapThing::ClassFilter. - Fixed: A_CustomMissile must not let P_SpawnMissile call P_CheckMissileSpawn. It must do this itself after setting the proper owner. - Fixed: CCMD(give) increased the total item count. - Fixed: A_Stop didn't set the player specific variables to 0. - Fixed: Screenwipes now pause sounds, since there can be sounds playing during them. - UI sounds are now omitted from savegames. - Fixed: Menu sounds had been restricted to one at a time again. - Moved the P_SerializeSounds() call to the end of G_SerializeLevel() so that it will occur after the players are loaded. - Added fixes from FreeBSD for 0-length and very large string buffers passed to myvsnprintf. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@131 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-06 17:32:31 +00:00
break;
case PCD_THINGDAMAGE2:
STACK(3) = P_Thing_Damage (STACK(3), activator, STACK(2), FName(FBehavior::StaticLookupString(STACK(1))));
sp -= 2;
break;
case PCD_CHECKACTORCEILINGTEXTURE:
STACK(2) = DoCheckActorTexture(STACK(2), activator, STACK(1), false);
sp--;
break;
case PCD_CHECKACTORFLOORTEXTURE:
STACK(2) = DoCheckActorTexture(STACK(2), activator, STACK(1), true);
sp--;
break;
case PCD_GETACTORLIGHTLEVEL:
Update to ZDoom r813, including: - Added copyright/license headers to a few files. - Fixed: ACS SetMugShotState needs to check the StatusBar pointer for the proper object type. - Move SBarInfo loading code in d_main.cpp into a static method of DSBarInfo. - Removed dobject.err from the repository. It only contained a list of compiler errors for some very old version of dobject.cpp. - Fixed: A_JumpIfCloser was missing a z-check. - Added Blzut3's SBARINFO update #13: - Split sbarinfo.cpp into two files sbarinfo_display.cpp and sbarinfo_parser.cpp - Rewrote the mug shot system for SBarInfo to allow for scripting and custom states for different means of death. - SBarInfo now loads all SBarInfo lumps instead of just the last one. Clashing status bar definitions will now be cleared before the bar is read. - Fixed: When using transparency with bars the new drawing method (bg over fg) didn't work. In the case that the border value is set to 0 it will revert to the old method (fg over bg). - Fixed: drawbar lost any high res information it was given. - Added: ACS command SetMugShotState(str state) which sets the mug shot state for the activating player. - Added: keepoffsets flag to drawbar. When set the offsets in the fg image will also be applied when displaying the bar. - Fixed the TArray serializer declaration. (Thank you for your warnings, GCC! ;-) - Changed root sector marking so that it can happen incrementally. - Fixed: The TArray serializer needs to be declared as a friend of TArray in order to be able to access its fields. - Since there are no backwards compatibility issues due to savegame version bumping I closed all gaps in the level flag set. - Bumped min. Savegame version and Netgame version for 3dMidtex related changes. - Changed Jump and Crouch DMFlags into 3-way switches: 0: map default, 1: off, 2: on. Since I needed new bits the rest of the DMFlag bit values had to be changed as a result. - fixed: PTR_SlideTraverse didn't check ML_BLOCKMONSTERS for sliding actors without MF3_NOBLOCKMONST. - Added MAPINFO commands 'checkswitchrange' and 'nocheckswitchrange' that can enable or disable switch range checking globally per map. - Changed ML_3DMIDTEX to force ML_CHECKSWITCHRANGE. - Added a ML_CHECKSWITCHRANGE flag which allows checking whether the player can actually reach the switch he wants to use. - Made DActiveButton::EWhere global so that I can use it outside thr DActiveButton class. - Changed P_LineOpening to pass its result in a struct instead of global variables. - Added Eternity's 3DMIDTEX feature (no Eternity code used though.) It should be feature complete with the exception of the ML_BLOCKMONSTERS flag handling. That particular part of Eternity's implementation is sub-optimal because it hijacks an existing flag and doesn't seem to make much sense to me. Maybe I'll implement it as a separate flag later. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@62 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-19 11:19:03 +00:00
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
if (actor != NULL)
{
STACK(1) = actor->Sector->lightlevel;
}
Update to ZDoom r1312: - Fixed: The save percentage for Doom's green armor was slightly too low which caused roundoff errors that made it less than 1/3 effective. - Added support for "RRGGBB" strings to V_GetColor. - Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly. - Changed GetSpriteIndex to cache the last used sprite name so that the code using this function doesn't have to do it itself. - Moved some more code for the state parser into p_states.cpp. - Fixed: TDeletingArray should not try to delete NULL pointers. - Added binary (b) and hexadecimal (x) cast types for ACS's various print statements. - Added ClassifyActor(tid) ACS builtin function. This takes a TID and returns a set of bits describing the actor. If TID is 0, it returns information about the activator. If there is more than one actor with the given TID, only the first one is considered. Currently defined bits are: ACTOR_NONE No actors with this TID exist (only when TID is not 0). ACTOR_WORLD Activator is the world (only when TID is 0). ACTOR_PLAYER Actor is a player (includes bots and voodoo dolls). ACTOR_BOT Actor is a bot. ACTOR_VOODOODOLL Actor is a voodoo doll. ACTOR_MONSTER Actor is a monster. ACTOR_ALIVE Actor is alive (players/monsters only). ACTOR_DEAD Actor is dead (players/monsters only). ACTOR_MISSILE Actor is a missile. ACTOR_GENERIC Actor exists, but no further information is available. - Moved ExpandEnvVars() from d_main.cpp to cmdlib.cpp. - AutoExec paths now support the same variable expansion as the search paths. Additionally, on Windows, the default autoexec path is now relative to $PROGDIR, rather than using a fixed path to the executable's current directory. - All usable Autoload and AutoExec sections are now created at the top of the config file along with some brief explanatory notes so they are readily visible to anyone who wants to edit them. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@254 b0f79afe-0144-0410-b225-9a4edf0717df
2008-12-07 16:38:02 +00:00
else STACK(1) = 0;
break;
}
Update to ZDoom r813, including: - Added copyright/license headers to a few files. - Fixed: ACS SetMugShotState needs to check the StatusBar pointer for the proper object type. - Move SBarInfo loading code in d_main.cpp into a static method of DSBarInfo. - Removed dobject.err from the repository. It only contained a list of compiler errors for some very old version of dobject.cpp. - Fixed: A_JumpIfCloser was missing a z-check. - Added Blzut3's SBARINFO update #13: - Split sbarinfo.cpp into two files sbarinfo_display.cpp and sbarinfo_parser.cpp - Rewrote the mug shot system for SBarInfo to allow for scripting and custom states for different means of death. - SBarInfo now loads all SBarInfo lumps instead of just the last one. Clashing status bar definitions will now be cleared before the bar is read. - Fixed: When using transparency with bars the new drawing method (bg over fg) didn't work. In the case that the border value is set to 0 it will revert to the old method (fg over bg). - Fixed: drawbar lost any high res information it was given. - Added: ACS command SetMugShotState(str state) which sets the mug shot state for the activating player. - Added: keepoffsets flag to drawbar. When set the offsets in the fg image will also be applied when displaying the bar. - Fixed the TArray serializer declaration. (Thank you for your warnings, GCC! ;-) - Changed root sector marking so that it can happen incrementally. - Fixed: The TArray serializer needs to be declared as a friend of TArray in order to be able to access its fields. - Since there are no backwards compatibility issues due to savegame version bumping I closed all gaps in the level flag set. - Bumped min. Savegame version and Netgame version for 3dMidtex related changes. - Changed Jump and Crouch DMFlags into 3-way switches: 0: map default, 1: off, 2: on. Since I needed new bits the rest of the DMFlag bit values had to be changed as a result. - fixed: PTR_SlideTraverse didn't check ML_BLOCKMONSTERS for sliding actors without MF3_NOBLOCKMONST. - Added MAPINFO commands 'checkswitchrange' and 'nocheckswitchrange' that can enable or disable switch range checking globally per map. - Changed ML_3DMIDTEX to force ML_CHECKSWITCHRANGE. - Added a ML_CHECKSWITCHRANGE flag which allows checking whether the player can actually reach the switch he wants to use. - Made DActiveButton::EWhere global so that I can use it outside thr DActiveButton class. - Changed P_LineOpening to pass its result in a struct instead of global variables. - Added Eternity's 3DMIDTEX feature (no Eternity code used though.) It should be feature complete with the exception of the ML_BLOCKMONSTERS flag handling. That particular part of Eternity's implementation is sub-optimal because it hijacks an existing flag and doesn't seem to make much sense to me. Maybe I'll implement it as a separate flag later. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@62 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-19 11:19:03 +00:00
case PCD_SETMUGSHOTSTATE:
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
StatusBar->SetMugShotState(FBehavior::StaticLookupString(STACK(1)));
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
sp--;
Update to ZDoom r813, including: - Added copyright/license headers to a few files. - Fixed: ACS SetMugShotState needs to check the StatusBar pointer for the proper object type. - Move SBarInfo loading code in d_main.cpp into a static method of DSBarInfo. - Removed dobject.err from the repository. It only contained a list of compiler errors for some very old version of dobject.cpp. - Fixed: A_JumpIfCloser was missing a z-check. - Added Blzut3's SBARINFO update #13: - Split sbarinfo.cpp into two files sbarinfo_display.cpp and sbarinfo_parser.cpp - Rewrote the mug shot system for SBarInfo to allow for scripting and custom states for different means of death. - SBarInfo now loads all SBarInfo lumps instead of just the last one. Clashing status bar definitions will now be cleared before the bar is read. - Fixed: When using transparency with bars the new drawing method (bg over fg) didn't work. In the case that the border value is set to 0 it will revert to the old method (fg over bg). - Fixed: drawbar lost any high res information it was given. - Added: ACS command SetMugShotState(str state) which sets the mug shot state for the activating player. - Added: keepoffsets flag to drawbar. When set the offsets in the fg image will also be applied when displaying the bar. - Fixed the TArray serializer declaration. (Thank you for your warnings, GCC! ;-) - Changed root sector marking so that it can happen incrementally. - Fixed: The TArray serializer needs to be declared as a friend of TArray in order to be able to access its fields. - Since there are no backwards compatibility issues due to savegame version bumping I closed all gaps in the level flag set. - Bumped min. Savegame version and Netgame version for 3dMidtex related changes. - Changed Jump and Crouch DMFlags into 3-way switches: 0: map default, 1: off, 2: on. Since I needed new bits the rest of the DMFlag bit values had to be changed as a result. - fixed: PTR_SlideTraverse didn't check ML_BLOCKMONSTERS for sliding actors without MF3_NOBLOCKMONST. - Added MAPINFO commands 'checkswitchrange' and 'nocheckswitchrange' that can enable or disable switch range checking globally per map. - Changed ML_3DMIDTEX to force ML_CHECKSWITCHRANGE. - Added a ML_CHECKSWITCHRANGE flag which allows checking whether the player can actually reach the switch he wants to use. - Made DActiveButton::EWhere global so that I can use it outside thr DActiveButton class. - Changed P_LineOpening to pass its result in a struct instead of global variables. - Added Eternity's 3DMIDTEX feature (no Eternity code used though.) It should be feature complete with the exception of the ML_BLOCKMONSTERS flag handling. That particular part of Eternity's implementation is sub-optimal because it hijacks an existing flag and doesn't seem to make much sense to me. Maybe I'll implement it as a separate flag later. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@62 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-19 11:19:03 +00:00
break;
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
case PCD_CHECKPLAYERCAMERA:
{
int playernum = STACK(1);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
if (playernum < 0 || playernum >= MAXPLAYERS || !playeringame[playernum] || players[playernum].camera == NULL)
{
STACK(1) = -1;
}
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
else
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
{
STACK(1) = players[playernum].camera->tid;
}
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
break;
Update to ZDoom r1312: - Fixed: The save percentage for Doom's green armor was slightly too low which caused roundoff errors that made it less than 1/3 effective. - Added support for "RRGGBB" strings to V_GetColor. - Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly. - Changed GetSpriteIndex to cache the last used sprite name so that the code using this function doesn't have to do it itself. - Moved some more code for the state parser into p_states.cpp. - Fixed: TDeletingArray should not try to delete NULL pointers. - Added binary (b) and hexadecimal (x) cast types for ACS's various print statements. - Added ClassifyActor(tid) ACS builtin function. This takes a TID and returns a set of bits describing the actor. If TID is 0, it returns information about the activator. If there is more than one actor with the given TID, only the first one is considered. Currently defined bits are: ACTOR_NONE No actors with this TID exist (only when TID is not 0). ACTOR_WORLD Activator is the world (only when TID is 0). ACTOR_PLAYER Actor is a player (includes bots and voodoo dolls). ACTOR_BOT Actor is a bot. ACTOR_VOODOODOLL Actor is a voodoo doll. ACTOR_MONSTER Actor is a monster. ACTOR_ALIVE Actor is alive (players/monsters only). ACTOR_DEAD Actor is dead (players/monsters only). ACTOR_MISSILE Actor is a missile. ACTOR_GENERIC Actor exists, but no further information is available. - Moved ExpandEnvVars() from d_main.cpp to cmdlib.cpp. - AutoExec paths now support the same variable expansion as the search paths. Additionally, on Windows, the default autoexec path is now relative to $PROGDIR, rather than using a fixed path to the executable's current directory. - All usable Autoload and AutoExec sections are now created at the top of the config file along with some brief explanatory notes so they are readily visible to anyone who wants to edit them. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@254 b0f79afe-0144-0410-b225-9a4edf0717df
2008-12-07 16:38:02 +00:00
case PCD_CLASSIFYACTOR:
STACK(1) = DoClassifyActor(STACK(1));
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case PCD_MORPHACTOR:
{
int tag = STACK(7);
FName playerclass_name = FBehavior::StaticLookupString(STACK(6));
const PClass *playerclass = PClass::FindClass (playerclass_name);
FName monsterclass_name = FBehavior::StaticLookupString(STACK(5));
const PClass *monsterclass = PClass::FindClass (monsterclass_name);
int duration = STACK(4);
int style = STACK(3);
FName morphflash_name = FBehavior::StaticLookupString(STACK(2));
const PClass *morphflash = PClass::FindClass (morphflash_name);
FName unmorphflash_name = FBehavior::StaticLookupString(STACK(1));
const PClass *unmorphflash = PClass::FindClass (unmorphflash_name);
int changes = 0;
if (tag == 0)
{
if (activator != NULL && activator->player)
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
{
changes += P_MorphPlayer(activator->player, activator->player, playerclass, duration, style, morphflash, unmorphflash);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
else
{
changes += P_MorphMonster(activator, monsterclass, duration, style, morphflash, unmorphflash);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
}
else
{
FActorIterator iterator (tag);
AActor *actor;
while ( (actor = iterator.Next ()) )
{
if (actor->player)
{
changes += P_MorphPlayer(activator == NULL ? NULL : activator->player,
actor->player, playerclass, duration, style, morphflash, unmorphflash);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
else
{
changes += P_MorphMonster(actor, monsterclass, duration, style, morphflash, unmorphflash);
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
}
}
STACK(7) = changes;
sp -= 6;
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
case PCD_UNMORPHACTOR:
{
int tag = STACK(2);
bool force = !!STACK(1);
int changes = 0;
if (tag == 0)
{
if (activator->player)
{
if (P_UndoPlayerMorph(activator->player, activator->player, force))
{
changes++;
}
}
else
{
if (activator->GetClass()->IsDescendantOf(RUNTIME_CLASS(AMorphedMonster)))
{
AMorphedMonster *morphed_actor = barrier_cast<AMorphedMonster *>(activator);
if (P_UndoMonsterMorph(morphed_actor, force))
{
changes++;
}
}
}
}
else
{
FActorIterator iterator (tag);
AActor *actor;
while ( (actor = iterator.Next ()) )
{
if (actor->player)
{
if (P_UndoPlayerMorph(activator->player, actor->player, force))
{
changes++;
}
}
else
{
if (actor->GetClass()->IsDescendantOf(RUNTIME_CLASS(AMorphedMonster)))
{
AMorphedMonster *morphed_actor = static_cast<AMorphedMonster *>(actor);
if (P_UndoMonsterMorph(morphed_actor, force))
{
changes++;
}
}
}
}
}
STACK(2) = changes;
sp -= 1;
}
break;
case PCD_SAVESTRING:
// Saves the string
{
unsigned int str_otf = ACS_StringsOnTheFly.Push(work);
if (str_otf > 0xffff)
{
PushToStack(-1);
}
else
{
PushToStack((SDWORD)str_otf|ACSSTRING_OR_ONTHEFLY);
}
STRINGBUILDER_FINISH(work);
}
break;
- Update to ZDoom r3242: Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. Fixed: D3DFB::Draw3DPart() treated the screen's pitch as if it always equaled the width. Considering this hasn't been guaranteed since before the D3DFB class was even written, this should have never made it in as-is. Fixed case of damage type variables. Fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1. Changed R_InstallSpriteLump so that it doesn't abort for every seemingly misnamed lump in the sprites namespace. A warning is fully sufficient here. Added FDARI's A_Warp submission. Added Major Cooke's Death/Paintype submission. Added DavidPH's DOHARMSPECIES submission. Added DavidPH's PoisonDamageType submission. Added DavidPH's submission for allowing a special state on puffs when hitting bleeding actors. Added DavidPH's A_AlertMonsters range submission. Added DavifPH's submission for allowing THRUGHOST on puffs. Added DavifPH's fix for poisoning invulnerable players. cleaned up setPointer interface. ZDoom part of setPointer/setActivator, submitted by FDARI. Added DavidPH's ProjectileKickback submission. ZDoom implementation of strcpy, submitted by FDARI. Revert r3214, which added some completely useless warnings for GCC. I'm sure there are good reasons even GCC doesn't enable them by default when you use -Wall. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1218 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-19 17:17:46 +00:00
case PCD_STRCPYTOMAPCHRANGE:
case PCD_STRCPYTOWORLDCHRANGE:
case PCD_STRCPYTOGLOBALCHRANGE:
// source: stringid(2); stringoffset(1)
// destination: capacity (3); stringoffset(4); arrayid (5); offset(6)
{
int index = STACK(4);
int capacity = STACK(3);
if (index < 0 || STACK(1) < 0)
{
// no writable destination, or negative offset to source string
sp -= 5;
Stack[sp-1] = 0; // false
break;
}
index += STACK(6);
lookup = FBehavior::StaticLookupString (STACK(2));
if (!lookup) {
// no data, operation complete
STRCPYTORANGECOMPLETE:
sp -= 5;
Stack[sp-1] = 1; // true
break;
}
for (int i = 0;i < STACK(1); i++)
{
if (! (*(lookup++)))
{
// no data, operation complete
goto STRCPYTORANGECOMPLETE;
}
}
switch (pcd)
{
case PCD_STRCPYTOMAPCHRANGE:
{
Stack[sp-6] = activeBehavior->CopyStringToArray(STACK(5), index, capacity, lookup);
}
break;
case PCD_STRCPYTOWORLDCHRANGE:
{
int a = STACK(5);
while (capacity-- > 0)
{
ACS_WorldArrays[a][index++] = *lookup;
if (! (*(lookup++))) goto STRCPYTORANGECOMPLETE; // complete with terminating 0
}
Stack[sp-6] = !(*lookup); // true/success if only terminating 0 was not copied
}
break;
case PCD_STRCPYTOGLOBALCHRANGE:
{
int a = STACK(5);
while (capacity-- > 0)
{
ACS_GlobalArrays[a][index++] = *lookup;
if (! (*(lookup++))) goto STRCPYTORANGECOMPLETE; // complete with terminating 0
}
Stack[sp-6] = !(*lookup); // true/success if only terminating 0 was not copied
}
break;
}
sp -= 5;
}
break;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
}
if (runaway != 0 && InModuleScriptNumber >= 0)
{
activeBehavior->GetScriptPtr(InModuleScriptNumber)->ProfileData.AddRun(runaway);
}
if (state == SCRIPT_DivideBy0)
{
Printf ("Divide by zero in %s\n", ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
}
else if (state == SCRIPT_ModulusBy0)
{
Printf ("Modulus by zero in %s\n", ScriptPresentation(script).GetChars());
state = SCRIPT_PleaseRemove;
}
if (state == SCRIPT_PleaseRemove)
{
Unlink ();
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
DLevelScript **running;
if ((running = controller->RunningScripts.CheckKey(script)) != NULL &&
*running == this)
{
controller->RunningScripts.Remove(script);
}
}
else
{
this->pc = pc;
assert (sp == 0);
}
return resultValue;
}
#undef PushtoStack
static DLevelScript *P_GetScriptGoing (AActor *who, line_t *where, int num, const ScriptPtr *code, FBehavior *module,
const int *args, int argcount, int flags)
{
DACSThinker *controller = DACSThinker::ActiveThinker;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
DLevelScript **running;
if (controller && !(flags & ACS_ALWAYS) && (running = controller->RunningScripts.CheckKey(num)) != NULL)
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
if ((*running)->GetState() == DLevelScript::SCRIPT_Suspended)
{
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
(*running)->SetState(DLevelScript::SCRIPT_Running);
return *running;
}
return NULL;
}
return new DLevelScript (who, where, num, code, module, args, argcount, flags);
}
DLevelScript::DLevelScript (AActor *who, line_t *where, int num, const ScriptPtr *code, FBehavior *module,
const int *args, int argcount, int flags)
: activeBehavior (module)
{
if (DACSThinker::ActiveThinker == NULL)
new DACSThinker;
script = num;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
assert(code->VarCount >= code->ArgCount);
numlocalvars = code->VarCount;
localvars = new SDWORD[code->VarCount];
memset(localvars, 0, code->VarCount * sizeof(SDWORD));
for (int i = 0; i < MIN<int>(argcount, code->ArgCount); ++i)
{
localvars[i] = args[i];
}
pc = module->GetScriptAddress(code);
InModuleScriptNumber = module->GetScriptIndex(code);
activator = who;
activationline = where;
backSide = flags & ACS_BACKSIDE;
activefont = SmallFont;
hudwidth = hudheight = 0;
ClipRectLeft = ClipRectTop = ClipRectWidth = ClipRectHeight = WrapWidth = 0;
state = SCRIPT_Running;
// Hexen waited one second before executing any open scripts. I didn't realize
// this when I wrote my ACS implementation. Now that I know, it's still best to
// run them right away because there are several map properties that can't be
// set in an editor. If an open script sets them, it looks dumb if a second
// goes by while they're in their default state.
if (!(flags & ACS_ALWAYS))
DACSThinker::ActiveThinker->RunningScripts[num] = this;
Link();
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 (level.flags2 & LEVEL2_HEXENHACK)
{
PutLast();
}
DPrintf("%s started.\n", ScriptPresentation(num).GetChars());
}
static void SetScriptState (int script, DLevelScript::EScriptState state)
{
DACSThinker *controller = DACSThinker::ActiveThinker;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
DLevelScript **running;
* Updated to ZDoom r3360: - Added ability to use a constant for the maximum comparator for health and armor drawbars. - Added support for loading named ACS scripts. You can't run them directly at the moment, but you can still use them for automatically executed script types (like open and enter). - Change the DACSThinker::RunningScripts array into a TMap so that it can catalog the new range of ACS scripts (up to 32767). - Removed snd_3dspread, because it totally does not do what I want. I was using it to preserve some of the stereoness of stereo sounds played in 3D. My testing was done only with stereo speakers, however, and I did not realize that it was moving the perceived physical location of the sound itself (because it sounded fine with my two speakers). So when 3D spread started working with mono sounds as well in FMOD 4.28, sound positioning was completely broken for everything when outputting to more than two speakers, because sounds were being spread across a 180 degree arc. Whoops! Stereo sounds are now completely mono when not played by you, the listener. - Added keys on the automap for Heretic in easy mode. - Fixed: Sound limiting applied even to sounds that were already playing on the same actor+channel. Since in this case, it's really just restarting the sound, it shouldn't limit it. (Since it's already playing, we know the limit wasn't exceeded when it started playing, so it shouldn't be exceeded if we restart it now.) - Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings. This is because the automap calls it with its own bindings, which effectively cancelled all doublebindings while the automap was open. - Fixed: CheckMobjBlocking() did not consider one-sided lines without the ML_BLOCKING flag to be blocking. - Fixed: Forgot to divide the length of the SVCT chunks in ACS objects by 4 to get the actual number of scripts to set VarCount for. - Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1284 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:10:35 +00:00
if (controller != NULL && (running = controller->RunningScripts.CheckKey(script)) != NULL)
{
(*running)->SetState (state);
}
}
void P_DoDeferedScripts ()
{
acsdefered_t *def;
const ScriptPtr *scriptdata;
FBehavior *module;
// Handle defered scripts in this step, too
def = level.info->defered;
while (def)
{
acsdefered_t *next = def->next;
switch (def->type)
{
case acsdefered_t::defexecute:
case acsdefered_t::defexealways:
scriptdata = FBehavior::StaticFindScript (def->script, module);
if (scriptdata)
{
P_GetScriptGoing ((unsigned)def->playernum < MAXPLAYERS &&
playeringame[def->playernum] ? players[def->playernum].mo : NULL,
NULL, def->script,
scriptdata, module,
def->args, 3,
def->type == acsdefered_t::defexealways ? ACS_ALWAYS : 0);
}
else
{
Printf ("P_DoDeferredScripts: Unknown %s\n", ScriptPresentation(def->script).GetChars());
}
break;
case acsdefered_t::defsuspend:
SetScriptState (def->script, DLevelScript::SCRIPT_Suspended);
DPrintf ("Deferred suspend of %s\n", ScriptPresentation(def->script).GetChars());
break;
case acsdefered_t::defterminate:
SetScriptState (def->script, DLevelScript::SCRIPT_PleaseRemove);
DPrintf ("Deferred terminate of %s\n", ScriptPresentation(def->script).GetChars());
break;
}
delete def;
def = next;
}
level.info->defered = NULL;
}
static void addDefered (level_info_t *i, acsdefered_t::EType type, int script, const int *args, int argcount, AActor *who)
{
if (i)
{
acsdefered_t *def = new acsdefered_t;
int j;
def->next = i->defered;
def->type = type;
def->script = script;
* Updated to ZDoom r3450: - Fix signed/unsigned mismatch warned by GCC. - Moved "Go away!" text into language.enu. - In conjunction with all the below changes, attempt to fix A_CheckSightOrRange and A_CheckSight for multiplayer: They now always check through the eyes of every player. For players whose cameras are not players, they also check through the eyes of those cameras. - Using spynext/spyprev to switch from a non-player to a player now writes a command to the network stream and lets Net_DoCommand() take care of it later. The logic here is that if a player is viewing from something that isn't another player, then every player needs to know about it for sync purposes. Consequently, when they stop viewing from a non-player and switch to a player, everybody needs to know about that too. But if they are viewing from a player, it doesn't matter which player it is, so they can spynext/spyprev all they want without letting the other players know about it (and without potentially breaking demos--due to the above-mentioned two codepointers--while doing it during demo playback). - Replaced the instances of checking players[consoleplayer].camera for a valid pointer to ones that do it for every player. - Fixed: Upon changing levels, all players but the consoleplayer would have their cameras NULLed. - Fixed: player_t::FixPointers() needs to bypass the read barriers, or it won't be able to do substitutions of old objects that are pending deletion. - Revised the fix from r3442: Make the line a nonrepeatable Door_Open instead of completely clearing the line's special. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1315 b0f79afe-0144-0410-b225-9a4edf0717df
2012-03-17 18:48:17 +00:00
for (j = 0; (size_t)j < countof(def->args) && j < argcount; ++j)
{
def->args[j] = args[j];
}
* Updated to ZDoom r3450: - Fix signed/unsigned mismatch warned by GCC. - Moved "Go away!" text into language.enu. - In conjunction with all the below changes, attempt to fix A_CheckSightOrRange and A_CheckSight for multiplayer: They now always check through the eyes of every player. For players whose cameras are not players, they also check through the eyes of those cameras. - Using spynext/spyprev to switch from a non-player to a player now writes a command to the network stream and lets Net_DoCommand() take care of it later. The logic here is that if a player is viewing from something that isn't another player, then every player needs to know about it for sync purposes. Consequently, when they stop viewing from a non-player and switch to a player, everybody needs to know about that too. But if they are viewing from a player, it doesn't matter which player it is, so they can spynext/spyprev all they want without letting the other players know about it (and without potentially breaking demos--due to the above-mentioned two codepointers--while doing it during demo playback). - Replaced the instances of checking players[consoleplayer].camera for a valid pointer to ones that do it for every player. - Fixed: Upon changing levels, all players but the consoleplayer would have their cameras NULLed. - Fixed: player_t::FixPointers() needs to bypass the read barriers, or it won't be able to do substitutions of old objects that are pending deletion. - Revised the fix from r3442: Make the line a nonrepeatable Door_Open instead of completely clearing the line's special. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1315 b0f79afe-0144-0410-b225-9a4edf0717df
2012-03-17 18:48:17 +00:00
while ((size_t)j < countof(def->args))
{
def->args[j++] = 0;
}
if (who != NULL && who->player != NULL)
{
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
def->playernum = int(who->player - players);
}
else
{
def->playernum = -1;
}
i->defered = def;
DPrintf ("%s on map %s deferred\n", ScriptPresentation(script).GetChars(), i->mapname);
}
}
EXTERN_CVAR (Bool, sv_cheats)
int P_StartScript (AActor *who, line_t *where, int script, const char *map, const int *args, int argcount, int flags)
{
if (map == NULL || 0 == strnicmp (level.mapname, map, 8))
{
FBehavior *module = NULL;
const ScriptPtr *scriptdata;
if ((scriptdata = FBehavior::StaticFindScript (script, module)) != NULL)
{
if ((flags & ACS_NET) && netgame && !sv_cheats)
{
// If playing multiplayer and cheats are disallowed, check to
// make sure only net scripts are run.
if (!(scriptdata->Flags & SCRIPTF_Net))
{
Printf(PRINT_BOLD, "%s tried to puke %s (\n",
who->player->userinfo.netname, ScriptPresentation(script).GetChars());
for (int i = 0; i < argcount; ++i)
{
Printf(PRINT_BOLD, "%d%s", args[i], i == argcount-1 ? "" : ", ");
}
Printf(PRINT_BOLD, ")\n");
return false;
}
}
DLevelScript *runningScript = P_GetScriptGoing (who, where, script,
scriptdata, module, args, argcount, flags);
if (runningScript != NULL)
{
if (flags & ACS_WANTRESULT)
{
return runningScript->RunScript();
}
return true;
}
return false;
}
else
{
if (!(flags & ACS_NET) || (who && who->player == &players[consoleplayer]))
{
Printf("P_StartScript: Unknown %s\n", ScriptPresentation(script).GetChars());
}
}
}
else
{
addDefered (FindLevelInfo (map),
(flags & ACS_ALWAYS) ? acsdefered_t::defexealways : acsdefered_t::defexecute,
script, args, argcount, who);
return true;
}
return false;
}
void P_SuspendScript (int script, char *map)
{
if (strnicmp (level.mapname, map, 8))
addDefered (FindLevelInfo (map), acsdefered_t::defsuspend, script, NULL, 0, NULL);
else
SetScriptState (script, DLevelScript::SCRIPT_Suspended);
}
void P_TerminateScript (int script, char *map)
{
if (strnicmp (level.mapname, map, 8))
addDefered (FindLevelInfo (map), acsdefered_t::defterminate, script, NULL, 0, NULL);
else
SetScriptState (script, DLevelScript::SCRIPT_PleaseRemove);
}
FArchive &operator<< (FArchive &arc, acsdefered_t *&defertop)
{
BYTE more;
if (arc.IsStoring ())
{
acsdefered_t *defer = defertop;
more = 1;
while (defer)
{
BYTE type;
arc << more;
type = (BYTE)defer->type;
* Updated to ZDoom r3370: - Fixed: Forgot to initialize inventoryItem to NULL in DrawBar. - Fixed: Runtime error on Mac OS X. For whatever reason merely having the call to CFUserNotificationDisplayAlert() in I_FatalError caused exception handling to quit working. Moving it to a separate file seems to fix this. Also removed the warning about FRenderer having a non-virtual destructor. - Added pukename console command. This is mostly the same as puke, except the scripts are named, and to run a script using ACS_ExecuteAlways, you need to add "always" after the script name but before any arguments. e.g.: « pukename "A Script" 1 » will run the script "A Script" with a single argument of 1, provided the script is not already running. « pukename "A Script" always 1 » Will always run the script "A Script" with a single argument of 1. - Added action functions that work with script names instead of script numbers. They are named the same as their ACS function equivalents. e.g. From DECORATE, you can now use ACS_NamedExecuteAlways to run a script with a name. - Make deferred scripts work with named scripts. - Added ACS_Named* function variants of the ACS_* specials that take script names instead of numbers. As these are functions and not specials, they can only be used from inside ACS. - Fixed: Mac universal binary build. (I actually just realized that my DRDTeam build script ended up just working because of this modification.) - Allow any parameterized SBarInfo value to use parentheses to help make the syntax a little more consistent. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1285 b0f79afe-0144-0410-b225-9a4edf0717df
2012-02-20 12:26:03 +00:00
arc << type;
P_SerializeACSScriptNumber(arc, defer->script, false);
arc << defer->playernum << defer->args[0] << defer->args[1] << defer->args[2];
defer = defer->next;
}
more = 0;
arc << more;
}
else
{
acsdefered_t **defer = &defertop;
arc << more;
while (more)
{
*defer = new acsdefered_t;
arc << more;
(*defer)->type = (acsdefered_t::EType)more;
P_SerializeACSScriptNumber(arc, (*defer)->script, false);
arc << (*defer)->playernum << (*defer)->args[0] << (*defer)->args[1] << (*defer)->args[2];
defer = &((*defer)->next);
arc << more;
}
*defer = NULL;
}
return arc;
}
CCMD (scriptstat)
{
if (DACSThinker::ActiveThinker == NULL)
{
Printf ("No scripts are running.\n");
}
else
{
DACSThinker::ActiveThinker->DumpScriptStatus ();
}
}
void DACSThinker::DumpScriptStatus ()
{
static const char *stateNames[] =
{
"Running",
"Suspended",
"Delayed",
"TagWait",
"PolyWait",
"ScriptWaitPre",
"ScriptWait",
"PleaseRemove"
};
DLevelScript *script = Scripts;
while (script != NULL)
{
Printf("%s: %s\n", ScriptPresentation(script->script).GetChars(), stateNames[script->state]);
script = script->next;
}
}
// Profiling support --------------------------------------------------------
ACSProfileInfo::ACSProfileInfo()
{
Reset();
}
void ACSProfileInfo::Reset()
{
TotalInstr = 0;
NumRuns = 0;
MinInstrPerRun = UINT_MAX;
MaxInstrPerRun = 0;
}
void ACSProfileInfo::AddRun(unsigned int num_instr)
{
TotalInstr += num_instr;
NumRuns++;
if (num_instr < MinInstrPerRun)
{
MinInstrPerRun = num_instr;
}
if (num_instr > MaxInstrPerRun)
{
MaxInstrPerRun = num_instr;
}
}
void ArrangeScriptProfiles(TArray<ProfileCollector> &profiles)
{
for (unsigned int mod_num = 0; mod_num < FBehavior::StaticModules.Size(); ++mod_num)
{
FBehavior *module = FBehavior::StaticModules[mod_num];
ProfileCollector prof;
prof.Module = module;
for (int i = 0; i < module->NumScripts; ++i)
{
prof.Index = i;
prof.ProfileData = &module->Scripts[i].ProfileData;
profiles.Push(prof);
}
}
}
void ArrangeFunctionProfiles(TArray<ProfileCollector> &profiles)
{
for (unsigned int mod_num = 0; mod_num < FBehavior::StaticModules.Size(); ++mod_num)
{
FBehavior *module = FBehavior::StaticModules[mod_num];
ProfileCollector prof;
prof.Module = module;
for (int i = 0; i < module->NumFunctions; ++i)
{
ScriptFunction *func = (ScriptFunction *)module->Functions + i;
if (func->ImportNum == 0)
{
prof.Index = i;
prof.ProfileData = module->FunctionProfileData + i;
profiles.Push(prof);
}
}
}
}
void ClearProfiles(TArray<ProfileCollector> &profiles)
{
for (unsigned int i = 0; i < profiles.Size(); ++i)
{
profiles[i].ProfileData->Reset();
}
}
static int STACK_ARGS sort_by_total_instr(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
assert(a != NULL && a->ProfileData != NULL);
assert(b != NULL && b->ProfileData != NULL);
return (int)(b->ProfileData->TotalInstr - a->ProfileData->TotalInstr);
}
static int STACK_ARGS sort_by_min(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
return b->ProfileData->MinInstrPerRun - a->ProfileData->MinInstrPerRun;
}
static int STACK_ARGS sort_by_max(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
return b->ProfileData->MaxInstrPerRun - a->ProfileData->MaxInstrPerRun;
}
static int STACK_ARGS sort_by_avg(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
int a_avg = a->ProfileData->NumRuns == 0 ? 0 : int(a->ProfileData->TotalInstr / a->ProfileData->NumRuns);
int b_avg = b->ProfileData->NumRuns == 0 ? 0 : int(b->ProfileData->TotalInstr / b->ProfileData->NumRuns);
return b_avg - a_avg;
}
static int STACK_ARGS sort_by_runs(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
return b->ProfileData->NumRuns - a->ProfileData->NumRuns;
}
static void ShowProfileData(TArray<ProfileCollector> &profiles, long ilimit,
int (STACK_ARGS *sorter)(const void *, const void *), bool functions)
{
static const char *const typelabels[2] = { "script", "function" };
if (profiles.Size() == 0)
{
return;
}
unsigned int limit;
char modname[13];
char scriptname[21];
qsort(&profiles[0], profiles.Size(), sizeof(ProfileCollector), sorter);
if (ilimit > 0)
{
Printf(TEXTCOLOR_ORANGE "Top %ld %ss:\n", ilimit, typelabels[functions]);
limit = (unsigned int)ilimit;
}
else
{
Printf(TEXTCOLOR_ORANGE "All %ss:\n", typelabels[functions]);
limit = UINT_MAX;
}
Printf(TEXTCOLOR_YELLOW "Module %-20s Total Runs Avg Min Max\n", typelabels[functions]);
Printf(TEXTCOLOR_YELLOW "------------ -------------------- ---------- ------- ------- ------- -------\n");
for (unsigned int i = 0; i < limit && i < profiles.Size(); ++i)
{
ProfileCollector *prof = &profiles[i];
if (prof->ProfileData->NumRuns == 0)
{ // Don't list ones that haven't run.
continue;
}
// Module name
mysnprintf(modname, sizeof(modname), prof->Module->GetModuleName());
// Script/function name
if (functions)
{
DWORD *fnames = (DWORD *)prof->Module->FindChunk(MAKE_ID('F','N','A','M'));
if (prof->Index >= 0 && prof->Index < (int)LittleLong(fnames[2]))
{
mysnprintf(scriptname, sizeof(scriptname), "%s",
(char *)(fnames + 2) + LittleLong(fnames[3+prof->Index]));
}
else
{
mysnprintf(scriptname, sizeof(scriptname), "Function %d", prof->Index);
}
}
else
{
mysnprintf(scriptname, sizeof(scriptname), "%s",
ScriptPresentation(prof->Module->GetScriptPtr(prof->Index)->Number).GetChars() + 7);
}
Printf("%-12s %-20s%11llu%8u%8u%8u%8u\n",
modname, scriptname,
prof->ProfileData->TotalInstr,
prof->ProfileData->NumRuns,
unsigned(prof->ProfileData->TotalInstr / prof->ProfileData->NumRuns),
prof->ProfileData->MinInstrPerRun,
prof->ProfileData->MaxInstrPerRun
);
}
}
CCMD(acsprofile)
{
static int (STACK_ARGS *sort_funcs[])(const void*, const void *) =
{
sort_by_total_instr,
sort_by_min,
sort_by_max,
sort_by_avg,
sort_by_runs
};
static const char *sort_names[] = { "total", "min", "max", "avg", "runs" };
static const BYTE sort_match_len[] = { 1, 2, 2, 1, 1 };
TArray<ProfileCollector> ScriptProfiles, FuncProfiles;
long limit = 10;
int (STACK_ARGS *sorter)(const void *, const void *) = sort_by_total_instr;
assert(countof(sort_names) == countof(sort_match_len));
ArrangeScriptProfiles(ScriptProfiles);
ArrangeFunctionProfiles(FuncProfiles);
if (argv.argc() > 1)
{
// `acsprofile clear` will zero all profiling information collected so far.
if (stricmp(argv[1], "clear") == 0)
{
ClearProfiles(ScriptProfiles);
ClearProfiles(FuncProfiles);
return;
}
for (int i = 1; i < argv.argc(); ++i)
{
// If it's a number, set the display limit.
char *endptr;
long num = strtol(argv[i], &endptr, 0);
if (endptr != argv[i])
{
limit = num;
continue;
}
// If it's a name, set the sort method. We accept partial matches for
// options that are shorter than the sort name.
size_t optlen = strlen(argv[i]);
int j;
for (j = 0; j < countof(sort_names); ++j)
{
if (optlen < sort_match_len[j] || optlen > strlen(sort_names[j]))
{ // Too short or long to match.
continue;
}
if (strnicmp(argv[i], sort_names[j], optlen) == 0)
{
sorter = sort_funcs[j];
break;
}
}
if (j == countof(sort_names))
{
Printf("Unknown option '%s'\n", argv[i]);
Printf("acsprofile clear : Reset profiling information\n");
Printf("acsprofile [total|min|max|avg|runs] [<limit>]\n");
return;
}
}
}
ShowProfileData(ScriptProfiles, limit, sorter, false);
ShowProfileData(FuncProfiles, limit, sorter, true);
}