gzdoom-last-svn/src/po_man.cpp

2289 lines
53 KiB
C++
Raw Normal View History

//**************************************************************************
//**
//** PO_MAN.C : Heretic 2 : Raven Software, Corp.
//**
//** $RCSfile: po_man.c,v $
//** $Revision: 1.22 $
//** $Date: 95/09/28 18:20:56 $
//** $Author: cjr $
//**
//**************************************************************************
// HEADER FILES ------------------------------------------------------------
#include "doomdef.h"
#include "p_local.h"
#include "r_local.h"
#include "i_system.h"
#include "w_wad.h"
#include "m_swap.h"
#include "m_bbox.h"
#include "tables.h"
#include "s_sndseq.h"
#include "a_sharedglobal.h"
#include "r_main.h"
- 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
#include "p_lnspec.h"
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
#include "r_interpolate.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 "g_level.h"
#include "po_man.h"
#include "p_setup.h"
#include "vectors.h"
// MACROS ------------------------------------------------------------------
#define PO_MAXPOLYSEGS 64
// TYPES -------------------------------------------------------------------
inline vertex_t *side_t::V1() const
{
return this == linedef->sidedef[0]? linedef->v1 : linedef->v2;
}
inline vertex_t *side_t::V2() const
{
return this == linedef->sidedef[0]? linedef->v2 : linedef->v1;
}
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
inline FArchive &operator<< (FArchive &arc, podoortype_t &type)
{
BYTE val = (BYTE)type;
arc << val;
type = (podoortype_t)val;
return arc;
}
class DPolyAction : public DThinker
{
DECLARE_CLASS (DPolyAction, DThinker)
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
HAS_OBJECT_POINTERS
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
public:
DPolyAction (int polyNum);
void Serialize (FArchive &arc);
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
void Destroy();
void Stop();
int GetSpeed() const { return m_Speed; }
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void StopInterpolation ();
protected:
DPolyAction ();
int m_PolyObj;
int m_Speed;
int m_Dist;
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
TObjPtr<DInterpolation> m_Interpolation;
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void SetInterpolation ();
};
class DRotatePoly : public DPolyAction
{
DECLARE_CLASS (DRotatePoly, DPolyAction)
public:
DRotatePoly (int polyNum);
void Tick ();
private:
DRotatePoly ();
friend bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide);
};
class DMovePoly : public DPolyAction
{
DECLARE_CLASS (DMovePoly, DPolyAction)
public:
DMovePoly (int polyNum);
void Serialize (FArchive &arc);
void Tick ();
protected:
DMovePoly ();
int m_Angle;
fixed_t m_xSpeed; // for sliding walls
fixed_t m_ySpeed;
friend bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle, fixed_t dist, bool overRide);
};
class DMovePolyTo : public DPolyAction
{
DECLARE_CLASS(DMovePolyTo, DPolyAction)
public:
DMovePolyTo(int polyNum);
void Serialize(FArchive &arc);
void Tick();
protected:
DMovePolyTo();
fixed_t m_xSpeed;
fixed_t m_ySpeed;
fixed_t m_xTarget;
fixed_t m_yTarget;
friend bool EV_MovePolyTo(line_t *line, int polyNum, int speed, fixed_t x, fixed_t y, bool overRide);
};
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
class DPolyDoor : public DMovePoly
{
DECLARE_CLASS (DPolyDoor, DMovePoly)
public:
DPolyDoor (int polyNum, podoortype_t type);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Direction;
int m_TotalDist;
int m_Tics;
int m_WaitTics;
podoortype_t m_Type;
bool m_Close;
friend bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle, int delay, int distance, podoortype_t type);
private:
DPolyDoor ();
};
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
void PO_Init (void);
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX,
fixed_t startSpotY);
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
static void UnLinkPolyobj (FPolyObj *po);
static void LinkPolyobj (FPolyObj *po);
static bool CheckMobjBlocking (side_t *seg, FPolyObj *po);
static void InitBlockMap (void);
static void IterFindPolySides (FPolyObj *po, side_t *side);
static void SpawnPolyobj (int index, int tag, int type);
static void TranslateToStartSpot (int tag, int originX, int originY);
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
static void DoMovePolyobj (FPolyObj *po, int x, int y);
static void InitSegLists ();
static void KillSegLists ();
static FPolyNode *NewPolyNode();
static void FreePolyNode();
static void ReleaseAllPolyNodes();
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern seg_t *segs;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
polyblock_t **PolyBlockMap;
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
FPolyObj *polyobjs; // list of all poly-objects on the level
int po_NumPolyobjs;
polyspawns_t *polyspawns; // [RH] Let P_SpawnMapThings() find our thingies for us
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static TArray<SDWORD> KnownPolySides;
static FPolyNode *FreePolyNodes;
// CODE --------------------------------------------------------------------
//==========================================================================
//
//
//
//==========================================================================
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
IMPLEMENT_POINTY_CLASS (DPolyAction)
DECLARE_POINTER(m_Interpolation)
END_POINTERS
DPolyAction::DPolyAction ()
{
}
void DPolyAction::Serialize (FArchive &arc)
{
Super::Serialize (arc);
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
arc << m_PolyObj << m_Speed << m_Dist << m_Interpolation;
}
DPolyAction::DPolyAction (int polyNum)
{
m_PolyObj = polyNum;
m_Speed = 0;
m_Dist = 0;
SetInterpolation ();
}
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
void DPolyAction::Destroy()
{
- 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
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
if (poly->specialdata == this)
{
poly->specialdata = NULL;
}
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
StopInterpolation();
Super::Destroy();
}
void DPolyAction::Stop()
{
FPolyObj *poly = PO_GetPolyobj(m_PolyObj);
SN_StopSequence(poly);
Destroy();
}
void DPolyAction::SetInterpolation ()
{
- 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
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
m_Interpolation = poly->SetInterpolation();
}
void DPolyAction::StopInterpolation ()
{
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
if (m_Interpolation != NULL)
{
- Added Skulltag's texture compression feature. Update to ZDoom r1024: - Fixed: There was still an inventory bar check in FMugShot::GetFace() after separating it from DDoomStatusBar. - Fixed: When following links in S_StartSound(), the function used sfx instead of S_Sfx as the array base for getting the NearLimit. - Repositioned the declaration of the file string in D_DoomMain() so that it won't be left on the stack at exit. - Fixed: PSymbol needs a virtual destructor so that PSymbolActionFunction can free its Arguments. - Symbols for native classes are now freed on exit. - Removed the 8-character limit on endpic names from the parser. (Though it might still be present in the texture manager; I don't remember.) - Fixed: EndSequence needs a proper constructor. - Fixed: The EndSequence structure was not fully initialized. - While doing the interpolation rewrite I noticed that DScroller and DPolyAction were doing some things in their destructor that needed to be done in the Destroy method. - Rewrote the interpolation code. Interpolations are no longer some objects that are separate from the rest of the engine. Instead, they are owned by the thinkers starting them. Also, polyobjects only spawn a single interpolation for each polyobject instead of a single one for each vertex. Also, different types of interpolation objects are used for different types of interpolation so that they can do some additional work if eventually needed. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@117 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-08 09:24:55 +00:00
m_Interpolation->DelRef();
m_Interpolation = NULL;
}
}
//==========================================================================
//
//
//
//==========================================================================
IMPLEMENT_CLASS (DRotatePoly)
DRotatePoly::DRotatePoly ()
{
}
DRotatePoly::DRotatePoly (int polyNum)
: Super (polyNum)
{
}
//==========================================================================
//
//
//
//==========================================================================
IMPLEMENT_CLASS (DMovePoly)
DMovePoly::DMovePoly ()
{
}
void DMovePoly::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << m_Angle << m_xSpeed << m_ySpeed;
}
DMovePoly::DMovePoly (int polyNum)
: Super (polyNum)
{
m_Angle = 0;
m_xSpeed = 0;
m_ySpeed = 0;
}
//==========================================================================
//
//
//
//
//==========================================================================
IMPLEMENT_CLASS(DMovePolyTo)
DMovePolyTo::DMovePolyTo()
{
}
void DMovePolyTo::Serialize(FArchive &arc)
{
Super::Serialize(arc);
arc << m_xSpeed << m_ySpeed << m_xTarget << m_yTarget;
}
DMovePolyTo::DMovePolyTo(int polyNum)
: Super(polyNum)
{
m_xSpeed = 0;
m_ySpeed = 0;
m_xTarget = 0;
m_yTarget = 0;
}
//==========================================================================
//
//
//
//==========================================================================
IMPLEMENT_CLASS (DPolyDoor)
DPolyDoor::DPolyDoor ()
{
}
void DPolyDoor::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << m_Direction << m_TotalDist << m_Tics << m_WaitTics << m_Type << m_Close;
}
DPolyDoor::DPolyDoor (int polyNum, podoortype_t type)
: Super (polyNum), m_Type (type)
{
m_Direction = 0;
m_TotalDist = 0;
m_Tics = 0;
m_WaitTics = 0;
m_Close = false;
}
// ===== Polyobj Event Code =====
//==========================================================================
//
// T_RotatePoly
//
//==========================================================================
void DRotatePoly::Tick ()
{
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
if (poly == NULL) return;
if (poly->RotatePolyobj (m_Speed))
{
unsigned int absSpeed = abs (m_Speed);
if (m_Dist == -1)
{ // perpetual polyobj
return;
}
m_Dist -= absSpeed;
if (m_Dist == 0)
{
SN_StopSequence (poly);
Destroy ();
}
else if ((unsigned int)m_Dist < absSpeed)
{
m_Speed = m_Dist * (m_Speed < 0 ? -1 : 1);
}
}
}
//==========================================================================
//
// EV_RotatePoly
//
//==========================================================================
bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle,
int direction, bool overRide)
{
int mirror;
DRotatePoly *pe;
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
FPolyObj *poly;
- 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 ( (poly = PO_GetPolyobj(polyNum)) )
{
if (poly->specialdata && !overRide)
{ // poly is already moving
return false;
}
}
else
{
Printf("EV_RotatePoly: Invalid polyobj num: %d\n", polyNum);
return false;
}
pe = new DRotatePoly (polyNum);
if (byteAngle)
{
if (byteAngle == 255)
{
pe->m_Dist = ~0;
}
else
{
pe->m_Dist = byteAngle*(ANGLE_90/64); // Angle
}
}
else
{
pe->m_Dist = ANGLE_MAX-1;
}
pe->m_Speed = (speed*direction*(ANGLE_90/64))>>3;
poly->specialdata = pe;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
while ( (mirror = poly->GetMirror()) )
{
- 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
poly = PO_GetPolyobj(mirror);
if (poly == NULL)
{
Printf ("EV_RotatePoly: Invalid polyobj num: %d\n", polyNum);
break;
}
if (poly && poly->specialdata && !overRide)
{ // mirroring poly is already in motion
break;
}
pe = new DRotatePoly (mirror);
poly->specialdata = pe;
if (byteAngle)
{
if (byteAngle == 255)
{
pe->m_Dist = ~0;
}
else
{
pe->m_Dist = byteAngle*(ANGLE_90/64); // Angle
}
}
else
{
pe->m_Dist = ANGLE_MAX-1;
}
direction = -direction;
pe->m_Speed = (speed*direction*(ANGLE_90/64))>>3;
polyNum = mirror;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
return true;
}
//==========================================================================
//
// T_MovePoly
//
//==========================================================================
void DMovePoly::Tick ()
{
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
if (poly != NULL)
{
if (poly->MovePolyobj (m_xSpeed, m_ySpeed))
{
int absSpeed = abs (m_Speed);
m_Dist -= absSpeed;
if (m_Dist <= 0)
{
SN_StopSequence (poly);
Destroy ();
}
else if (m_Dist < absSpeed)
{
m_Speed = m_Dist * (m_Speed < 0 ? -1 : 1);
m_xSpeed = FixedMul (m_Speed, finecosine[m_Angle]);
m_ySpeed = FixedMul (m_Speed, finesine[m_Angle]);
}
}
}
}
//==========================================================================
//
// EV_MovePoly
//
//==========================================================================
bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle,
fixed_t dist, bool overRide)
{
int mirror;
DMovePoly *pe;
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
FPolyObj *poly;
angle_t an;
- 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 ( (poly = PO_GetPolyobj(polyNum)) )
{
if (poly->specialdata && !overRide)
{ // poly is already moving
return false;
}
}
else
{
Printf("EV_MovePoly: Invalid polyobj num: %d\n", polyNum);
return false;
}
pe = new DMovePoly (polyNum);
pe->m_Dist = dist; // Distance
pe->m_Speed = speed;
poly->specialdata = pe;
an = angle;
pe->m_Angle = an>>ANGLETOFINESHIFT;
pe->m_xSpeed = FixedMul (pe->m_Speed, finecosine[pe->m_Angle]);
pe->m_ySpeed = FixedMul (pe->m_Speed, finesine[pe->m_Angle]);
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
// Do not interpolate very fast moving polyobjects. The minimum tic count is
// 3 instead of 2, because the moving crate effect in Massmouth 2, Hostitality
// that this fixes isn't quite fast enough to move the crate back to its start
// in just 1 tic.
if (dist/speed <= 2)
{
pe->StopInterpolation ();
}
while ( (mirror = poly->GetMirror()) )
{
- 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
poly = PO_GetPolyobj(mirror);
if (poly && poly->specialdata && !overRide)
{ // mirroring poly is already in motion
break;
}
pe = new DMovePoly (mirror);
poly->specialdata = pe;
pe->m_Dist = dist; // Distance
pe->m_Speed = speed;
an = an+ANGLE_180; // reverse the angle
pe->m_Angle = an>>ANGLETOFINESHIFT;
pe->m_xSpeed = FixedMul (pe->m_Speed, finecosine[pe->m_Angle]);
pe->m_ySpeed = FixedMul (pe->m_Speed, finesine[pe->m_Angle]);
polyNum = mirror;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
if (dist/speed <= 2)
{
pe->StopInterpolation ();
}
}
return true;
}
//==========================================================================
//
// DMovePolyTo :: Tick
//
//==========================================================================
void DMovePolyTo::Tick ()
{
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
if (poly != NULL)
{
if (poly->MovePolyobj (m_xSpeed, m_ySpeed))
{
int absSpeed = abs (m_Speed);
m_Dist -= absSpeed;
if (m_Dist <= 0)
{
SN_StopSequence (poly);
Destroy ();
}
else if (m_Dist < absSpeed)
{
m_Speed = m_Dist * (m_Speed < 0 ? -1 : 1);
m_xSpeed = m_xTarget - poly->StartSpot.x;
m_ySpeed = m_yTarget - poly->StartSpot.y;
}
}
}
}
//==========================================================================
//
// EV_MovePolyTo
//
//==========================================================================
bool EV_MovePolyTo(line_t *line, int polyNum, int speed, fixed_t targx, fixed_t targy, bool overRide)
{
int mirror;
DMovePolyTo *pe;
FPolyObj *poly;
TVector2<double> dist;
double distlen;
bool nointerp;
if ( (poly = PO_GetPolyobj(polyNum)) )
{
if (poly->specialdata && !overRide)
{ // poly is already moving
return false;
}
}
else
{
Printf("EV_MovePolyTo: Invalid polyobj num: %d\n", polyNum);
return false;
}
dist.X = targx - poly->StartSpot.x;
dist.Y = targy - poly->StartSpot.y;
pe = new DMovePolyTo(polyNum);
poly->specialdata = pe;
pe->m_Dist = xs_RoundToInt(distlen = dist.MakeUnit());
pe->m_Speed = speed;
pe->m_xSpeed = xs_RoundToInt(speed * dist.X);
pe->m_ySpeed = xs_RoundToInt(speed * dist.Y);
pe->m_xTarget = targx;
pe->m_yTarget = targy;
nointerp = (pe->m_Dist / pe->m_Speed) <= 2;
if (nointerp)
{
pe->StopInterpolation();
}
while ( (mirror = poly->GetMirror()) )
{
poly = PO_GetPolyobj(mirror);
if (poly && poly->specialdata && !overRide)
{ // mirroring poly is already in motion
break;
}
// reverse the direction
dist.X = -dist.X;
dist.Y = -dist.Y;
pe = new DMovePolyTo(mirror);
poly->specialdata = pe;
pe->m_Dist = xs_RoundToInt(distlen);
pe->m_Speed = speed;
pe->m_xSpeed = xs_RoundToInt(speed * dist.X);
pe->m_ySpeed = xs_RoundToInt(speed * dist.Y);
pe->m_xTarget = xs_RoundToInt(poly->StartSpot.x + distlen * dist.X);
pe->m_yTarget = xs_RoundToInt(poly->StartSpot.y + distlen * dist.Y);
polyNum = mirror;
SN_StartSequence(poly, poly->seqType, SEQ_DOOR, 0);
if (nointerp)
{
pe->StopInterpolation();
}
}
return true;
}
//==========================================================================
//
// T_PolyDoor
//
//==========================================================================
void DPolyDoor::Tick ()
{
int absSpeed;
FPolyObj *poly = PO_GetPolyobj (m_PolyObj);
if (poly == NULL) return;
if (m_Tics)
{
if (!--m_Tics)
{
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, m_Close);
}
return;
}
switch (m_Type)
{
case PODOOR_SLIDE:
if (m_Dist <= 0 || poly->MovePolyobj (m_xSpeed, m_ySpeed))
{
absSpeed = abs (m_Speed);
m_Dist -= absSpeed;
if (m_Dist <= 0)
{
SN_StopSequence (poly);
if (!m_Close)
{
m_Dist = m_TotalDist;
m_Close = true;
m_Tics = m_WaitTics;
m_Direction = (ANGLE_MAX>>ANGLETOFINESHIFT) - m_Direction;
m_xSpeed = -m_xSpeed;
m_ySpeed = -m_ySpeed;
}
else
{
Destroy ();
}
}
}
else
{
if (poly->crush || !m_Close)
{ // continue moving if the poly is a crusher, or is opening
return;
}
else
{ // open back up
m_Dist = m_TotalDist - m_Dist;
m_Direction = (ANGLE_MAX>>ANGLETOFINESHIFT)-
m_Direction;
m_xSpeed = -m_xSpeed;
m_ySpeed = -m_ySpeed;
m_Close = false;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
}
break;
case PODOOR_SWING:
if (poly->RotatePolyobj (m_Speed))
{
absSpeed = abs (m_Speed);
if (m_Dist == -1)
{ // perpetual polyobj
return;
}
m_Dist -= absSpeed;
if (m_Dist <= 0)
{
SN_StopSequence (poly);
if (!m_Close)
{
m_Dist = m_TotalDist;
m_Close = true;
m_Tics = m_WaitTics;
m_Speed = -m_Speed;
}
else
{
Destroy ();
}
}
}
else
{
if(poly->crush || !m_Close)
{ // continue moving if the poly is a crusher, or is opening
return;
}
else
{ // open back up and rewait
m_Dist = m_TotalDist - m_Dist;
m_Speed = -m_Speed;
m_Close = false;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
}
break;
default:
break;
}
}
//==========================================================================
//
// EV_OpenPolyDoor
//
//==========================================================================
bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle,
int delay, int distance, podoortype_t type)
{
int mirror;
DPolyDoor *pd;
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
FPolyObj *poly;
- 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( (poly = PO_GetPolyobj(polyNum)) )
{
if (poly->specialdata)
{ // poly is already moving
return false;
}
}
else
{
Printf("EV_OpenPolyDoor: Invalid polyobj num: %d\n", polyNum);
return false;
}
pd = new DPolyDoor (polyNum, type);
if (type == PODOOR_SLIDE)
{
pd->m_WaitTics = delay;
pd->m_Speed = speed;
pd->m_Dist = pd->m_TotalDist = distance; // Distance
pd->m_Direction = angle >> ANGLETOFINESHIFT;
pd->m_xSpeed = FixedMul (pd->m_Speed, finecosine[pd->m_Direction]);
pd->m_ySpeed = FixedMul (pd->m_Speed, finesine[pd->m_Direction]);
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
else if (type == PODOOR_SWING)
{
pd->m_WaitTics = delay;
pd->m_Direction = 1; // ADD: PODOOR_SWINGL, PODOOR_SWINGR
pd->m_Speed = (speed*pd->m_Direction*(ANGLE_90/64))>>3;
pd->m_Dist = pd->m_TotalDist = angle;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
poly->specialdata = pd;
while ( (mirror = poly->GetMirror()) )
{
- 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
poly = PO_GetPolyobj (mirror);
if (poly && poly->specialdata)
{ // mirroring poly is already in motion
break;
}
pd = new DPolyDoor (mirror, type);
poly->specialdata = pd;
if (type == PODOOR_SLIDE)
{
pd->m_WaitTics = delay;
pd->m_Speed = speed;
pd->m_Dist = pd->m_TotalDist = distance; // Distance
pd->m_Direction = (angle + ANGLE_180) >> ANGLETOFINESHIFT; // reverse the angle
pd->m_xSpeed = FixedMul (pd->m_Speed, finecosine[pd->m_Direction]);
pd->m_ySpeed = FixedMul (pd->m_Speed, finesine[pd->m_Direction]);
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
else if (type == PODOOR_SWING)
{
pd->m_WaitTics = delay;
pd->m_Direction = -1; // ADD: same as above
pd->m_Speed = (speed*pd->m_Direction*(ANGLE_90/64))>>3;
pd->m_Dist = pd->m_TotalDist = angle;
SN_StartSequence (poly, poly->seqType, SEQ_DOOR, 0);
}
polyNum = mirror;
}
return true;
}
//==========================================================================
//
// EV_StopPoly
//
//==========================================================================
bool EV_StopPoly(int polynum)
{
FPolyObj *poly;
if (NULL != (poly = PO_GetPolyobj(polynum)))
{
if (poly->specialdata != NULL)
{
poly->specialdata->Stop();
}
return true;
}
return false;
}
// ===== Higher Level Poly Interface code =====
//==========================================================================
//
- 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
// PO_GetPolyobj
//
//==========================================================================
- 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
FPolyObj *PO_GetPolyobj (int polyNum)
{
int i;
for (i = 0; i < po_NumPolyobjs; i++)
{
if (polyobjs[i].tag == polyNum)
{
return &polyobjs[i];
}
}
return NULL;
}
//==========================================================================
//
//
//
//==========================================================================
FPolyObj::FPolyObj()
{
StartSpot.x = StartSpot.y = 0;
angle = 0;
tag = 0;
memset(bbox, 0, sizeof(bbox));
validcount = 0;
crush = 0;
bHurtOnTouch = false;
seqType = 0;
size = 0;
subsectorlinks = NULL;
specialdata = NULL;
interpolation = NULL;
}
//==========================================================================
//
// GetPolyobjMirror
//
//==========================================================================
int FPolyObj::GetMirror()
{
return Linedefs[0]->args[1];
}
//==========================================================================
//
// ThrustMobj
//
//==========================================================================
void FPolyObj::ThrustMobj (AActor *actor, side_t *side)
{
int thrustAngle;
int thrustX;
int thrustY;
DPolyAction *pe;
int force;
if (!(actor->flags&MF_SHOOTABLE) && !actor->player)
{
return;
}
vertex_t *v1 = side->V1();
vertex_t *v2 = side->V2();
thrustAngle = (R_PointToAngle2 (v1->x, v1->y, v2->x, v2->y) - ANGLE_90) >> ANGLETOFINESHIFT;
pe = static_cast<DPolyAction *>(specialdata);
if (pe)
{
if (pe->IsKindOf (RUNTIME_CLASS (DRotatePoly)))
{
force = pe->GetSpeed() >> 8;
}
else
{
force = pe->GetSpeed() >> 3;
}
if (force < FRACUNIT)
{
force = FRACUNIT;
}
else if (force > 4*FRACUNIT)
{
force = 4*FRACUNIT;
}
}
else
{
force = FRACUNIT;
}
thrustX = FixedMul (force, finecosine[thrustAngle]);
thrustY = FixedMul (force, finesine[thrustAngle]);
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
actor->velx += thrustX;
actor->vely += thrustY;
if (crush)
{
if (bHurtOnTouch || !P_CheckMove (actor, actor->x + thrustX, actor->y + thrustY))
{
P_DamageMobj (actor, NULL, NULL, crush, NAME_Crush);
P_TraceBleed (crush, actor);
}
}
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_POLYGRIND) actor->Grind(false); // crush corpses that get caught in a polyobject's way
}
//==========================================================================
//
// UpdateSegBBox
//
//==========================================================================
void FPolyObj::UpdateBBox ()
{
for(unsigned i=0;i<Linedefs.Size(); i++)
{
line_t *line = Linedefs[i];
if (line->v1->x < line->v2->x)
{
line->bbox[BOXLEFT] = line->v1->x;
line->bbox[BOXRIGHT] = line->v2->x;
}
else
{
line->bbox[BOXLEFT] = line->v2->x;
line->bbox[BOXRIGHT] = line->v1->x;
}
if (line->v1->y < line->v2->y)
{
line->bbox[BOXBOTTOM] = line->v1->y;
line->bbox[BOXTOP] = line->v2->y;
}
else
{
line->bbox[BOXBOTTOM] = line->v2->y;
line->bbox[BOXTOP] = line->v1->y;
}
// Update the line's slopetype
line->dx = line->v2->x - line->v1->x;
line->dy = line->v2->y - line->v1->y;
if (!line->dx)
{
line->slopetype = ST_VERTICAL;
}
else if (!line->dy)
{
line->slopetype = ST_HORIZONTAL;
}
else
{
line->slopetype = ((line->dy ^ line->dx) >= 0) ? ST_POSITIVE : ST_NEGATIVE;
}
}
CalcCenter();
}
void FPolyObj::CalcCenter()
{
SQWORD cx = 0, cy = 0;
for(unsigned i=0;i<Vertices.Size(); i++)
{
cx += Vertices[i]->x;
cy += Vertices[i]->y;
}
CenterSpot.x = (fixed_t)(cx / Vertices.Size());
CenterSpot.y = (fixed_t)(cy / Vertices.Size());
}
//==========================================================================
//
// PO_MovePolyobj
//
//==========================================================================
bool FPolyObj::MovePolyobj (int x, int y, bool force)
{
UnLinkPolyobj ();
DoMovePolyobj (x, y);
if (!force)
{
bool blocked = false;
for(unsigned i=0;i < Sidedefs.Size(); i++)
{
if (CheckMobjBlocking(Sidedefs[i]))
{
blocked = true;
}
}
if (blocked)
{
DoMovePolyobj (-x, -y);
LinkPolyobj();
return false;
}
}
StartSpot.x += x;
StartSpot.y += y;
CenterSpot.x += x;
CenterSpot.y += y;
LinkPolyobj ();
ClearSubsectorLinks();
return true;
}
//==========================================================================
//
// DoMovePolyobj
//
//==========================================================================
void FPolyObj::DoMovePolyobj (int x, int y)
{
for(unsigned i=0;i < Vertices.Size(); i++)
{
Vertices[i]->x += x;
Vertices[i]->y += y;
PrevPts[i].x += x;
PrevPts[i].y += y;
}
for (unsigned i = 0; i < Linedefs.Size(); i++)
{
Linedefs[i]->bbox[BOXTOP] += y;
Linedefs[i]->bbox[BOXBOTTOM] += y;
Linedefs[i]->bbox[BOXLEFT] += x;
Linedefs[i]->bbox[BOXRIGHT] += x;
}
}
//==========================================================================
//
// RotatePt
//
//==========================================================================
static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX, fixed_t startSpotY)
{
fixed_t tr_x = *x;
fixed_t tr_y = *y;
*x = DMulScale16 (tr_x, finecosine[an], -tr_y, finesine[an])+startSpotX;
*y = DMulScale16 (tr_x, finesine[an], tr_y, finecosine[an])+startSpotY;
}
//==========================================================================
//
// PO_RotatePolyobj
//
//==========================================================================
bool FPolyObj::RotatePolyobj (angle_t angle)
{
int an;
bool blocked;
an = (this->angle+angle)>>ANGLETOFINESHIFT;
UnLinkPolyobj();
for(unsigned i=0;i < Vertices.Size(); i++)
{
PrevPts[i].x = Vertices[i]->x;
PrevPts[i].y = Vertices[i]->y;
Vertices[i]->x = OriginalPts[i].x;
Vertices[i]->y = OriginalPts[i].y;
RotatePt(an, &Vertices[i]->x, &Vertices[i]->y, StartSpot.x, StartSpot.y);
}
blocked = false;
validcount++;
UpdateBBox();
for(unsigned i=0;i < Sidedefs.Size(); i++)
{
if (CheckMobjBlocking(Sidedefs[i]))
{
blocked = true;
}
}
if (blocked)
{
for(unsigned i=0;i < Vertices.Size(); i++)
{
Vertices[i]->x = PrevPts[i].x;
Vertices[i]->y = PrevPts[i].y;
}
UpdateBBox();
LinkPolyobj();
return false;
}
this->angle += angle;
LinkPolyobj();
ClearSubsectorLinks();
return true;
}
//==========================================================================
//
// UnLinkPolyobj
//
//==========================================================================
void FPolyObj::UnLinkPolyobj ()
{
polyblock_t *link;
int i, j;
int index;
// remove the polyobj from each blockmap section
for(j = bbox[BOXBOTTOM]; j <= bbox[BOXTOP]; j++)
{
index = j*bmapwidth;
for(i = bbox[BOXLEFT]; i <= bbox[BOXRIGHT]; i++)
{
if(i >= 0 && i < bmapwidth && j >= 0 && j < bmapheight)
{
link = PolyBlockMap[index+i];
while(link != NULL && link->polyobj != this)
{
link = link->next;
}
if(link == NULL)
{ // polyobj not located in the link cell
continue;
}
link->polyobj = NULL;
}
}
}
}
//==========================================================================
//
// CheckMobjBlocking
//
//==========================================================================
bool FPolyObj::CheckMobjBlocking (side_t *sd)
{
static TArray<AActor *> checker;
FBlockNode *block;
AActor *mobj;
int i, j, k;
int left, right, top, bottom;
line_t *ld;
bool blocked;
ld = sd->linedef;
top = (ld->bbox[BOXTOP]-bmaporgy) >> MAPBLOCKSHIFT;
bottom = (ld->bbox[BOXBOTTOM]-bmaporgy) >> MAPBLOCKSHIFT;
left = (ld->bbox[BOXLEFT]-bmaporgx) >> MAPBLOCKSHIFT;
right = (ld->bbox[BOXRIGHT]-bmaporgx) >> MAPBLOCKSHIFT;
blocked = false;
checker.Clear();
bottom = bottom < 0 ? 0 : bottom;
bottom = bottom >= bmapheight ? bmapheight-1 : bottom;
top = top < 0 ? 0 : top;
top = top >= bmapheight ? bmapheight-1 : top;
left = left < 0 ? 0 : left;
left = left >= bmapwidth ? bmapwidth-1 : left;
right = right < 0 ? 0 : right;
right = right >= bmapwidth ? bmapwidth-1 : right;
for (j = bottom*bmapwidth; j <= top*bmapwidth; j += bmapwidth)
{
for (i = left; i <= right; i++)
{
for (block = blocklinks[j+i]; block != NULL; block = block->NextActor)
{
mobj = block->Me;
for (k = (int)checker.Size()-1; k >= 0; --k)
{
if (checker[k] == mobj)
{
break;
}
}
if (k < 0)
{
checker.Push (mobj);
if ((mobj->flags&MF_SOLID) && !(mobj->flags&MF_NOCLIP))
{
Update to ZDoom r894: - Eliminated all use of global variables used as output for P_CheckPosition and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because the global variables can be easily overwritten with certain DECORATE constructs. - Removed some unnecessary morphing code. - Fixed some bugs in the HIRESTEX parser. - Added floating point support and #include and #define tokens to FParseContext Not used yet. - replaced the value scanning code in FParseContext::GetToken with calls to strtol. - Changed XlatParseContext::FindToken to do a binary search over the valid token names. - Fixed: The check arrays for BlockThingsIterators were not properly freed and each iterator allocated a new one as a result. - Split the Xlat parser context class into a generic part that can be used for other Lemon-based parsers in the future and a smaller Xlat-specific part. - Changed: P_TeleportMove now always sets BlockingLine to NULL and P_FindFloorCeiling doesn't set it at all. The way it was set in PIT_FindFloorCeiling didn't look correct. (Note: It's amazing how easy it is to break P_TryMove et.al. with DECORATE if you just know which combinations of code pointers will cause problems. This definitely needs to be addressed.) - Changed P_FindFloorCeiling so that it doesn't need global variables anymore. I also moved the code to set the calling actor's information into this function because that's all it is used for. This also fixes another bug: - AInventory::BecomePickup called P_FindFloorCeiling to get proper position values for the item but never set the item's information to the return value of this call. - Removed the check for Heretic when playing *evillaugh when using the Chaos Device. This sound is not defined by the other games so it won't play by default. - Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags for the morph style so that the special behavior of these two items can be switched on and off. - Added Martin Howe's morph system enhancement. - Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere. - Rewrote BlockThingsIterator code not to use callbacks anymore. - Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but P_FindFloorCeiling never did that. - Merged Check_Sides and PIT_CrossLine into A_PainShootSkull. - Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was used. This also allowed to remove all the global variable saving in P_CreateSecNodeList. - Added a new FBlockLinesIterator class that doesn't need a callback function because debugging the previous bug proved to be a bit annoying because it involved a P_BlockLinesIterator loop. - Fixed: The MBF code to move monsters away from dropoffs did not work as intended due to some random decisions in P_DoNewChaseDir. When in the avoiding dropoff mode these are ignored now. This should cure the problem that monsters hanging over a dropoff tended to drop down. - Added a NOTIMEFREEZE flag that excludes actors from being affected by the time freezer powerup. - Changed: Empty pickup messages are no longer printed. - Changed secret sector drawing in automap so that lines with the ML_SECRET flag are only drawn as part of a secret sector if that secret has already been found, even if the option is set to always show secret sectors. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@88 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-08 22:32:52 +00:00
FBoundingBox box(mobj->x, mobj->y, mobj->radius);
if (box.Right() <= ld->bbox[BOXLEFT]
|| box.Left() >= ld->bbox[BOXRIGHT]
|| box.Top() <= ld->bbox[BOXBOTTOM]
|| box.Bottom() >= ld->bbox[BOXTOP])
{
continue;
}
Update to ZDoom r894: - Eliminated all use of global variables used as output for P_CheckPosition and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because the global variables can be easily overwritten with certain DECORATE constructs. - Removed some unnecessary morphing code. - Fixed some bugs in the HIRESTEX parser. - Added floating point support and #include and #define tokens to FParseContext Not used yet. - replaced the value scanning code in FParseContext::GetToken with calls to strtol. - Changed XlatParseContext::FindToken to do a binary search over the valid token names. - Fixed: The check arrays for BlockThingsIterators were not properly freed and each iterator allocated a new one as a result. - Split the Xlat parser context class into a generic part that can be used for other Lemon-based parsers in the future and a smaller Xlat-specific part. - Changed: P_TeleportMove now always sets BlockingLine to NULL and P_FindFloorCeiling doesn't set it at all. The way it was set in PIT_FindFloorCeiling didn't look correct. (Note: It's amazing how easy it is to break P_TryMove et.al. with DECORATE if you just know which combinations of code pointers will cause problems. This definitely needs to be addressed.) - Changed P_FindFloorCeiling so that it doesn't need global variables anymore. I also moved the code to set the calling actor's information into this function because that's all it is used for. This also fixes another bug: - AInventory::BecomePickup called P_FindFloorCeiling to get proper position values for the item but never set the item's information to the return value of this call. - Removed the check for Heretic when playing *evillaugh when using the Chaos Device. This sound is not defined by the other games so it won't play by default. - Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags for the morph style so that the special behavior of these two items can be switched on and off. - Added Martin Howe's morph system enhancement. - Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere. - Rewrote BlockThingsIterator code not to use callbacks anymore. - Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but P_FindFloorCeiling never did that. - Merged Check_Sides and PIT_CrossLine into A_PainShootSkull. - Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was used. This also allowed to remove all the global variable saving in P_CreateSecNodeList. - Added a new FBlockLinesIterator class that doesn't need a callback function because debugging the previous bug proved to be a bit annoying because it involved a P_BlockLinesIterator loop. - Fixed: The MBF code to move monsters away from dropoffs did not work as intended due to some random decisions in P_DoNewChaseDir. When in the avoiding dropoff mode these are ignored now. This should cure the problem that monsters hanging over a dropoff tended to drop down. - Added a NOTIMEFREEZE flag that excludes actors from being affected by the time freezer powerup. - Changed: Empty pickup messages are no longer printed. - Changed secret sector drawing in automap so that lines with the ML_SECRET flag are only drawn as part of a secret sector if that secret has already been found, even if the option is set to always show secret sectors. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@88 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-08 22:32:52 +00:00
if (box.BoxOnLineSide(ld) != -1)
{
continue;
}
ThrustMobj (mobj, sd);
blocked = true;
}
}
}
}
}
return blocked;
}
//==========================================================================
//
// LinkPolyobj
//
//==========================================================================
void FPolyObj::LinkPolyobj ()
{
polyblock_t **link;
polyblock_t *tempLink;
// calculate the polyobj bbox
Bounds.ClearBox();
for(unsigned i = 0; i < Sidedefs.Size(); i++)
{
vertex_t *vt;
vt = Sidedefs[i]->linedef->v1;
Bounds.AddToBox(vt->x, vt->y);
vt = Sidedefs[i]->linedef->v2;
Bounds.AddToBox(vt->x, vt->y);
}
bbox[BOXRIGHT] = (Bounds.Right() - bmaporgx) >> MAPBLOCKSHIFT;
bbox[BOXLEFT] = (Bounds.Left() - bmaporgx) >> MAPBLOCKSHIFT;
bbox[BOXTOP] = (Bounds.Top() - bmaporgy) >> MAPBLOCKSHIFT;
bbox[BOXBOTTOM] = (Bounds.Bottom() - bmaporgy) >> MAPBLOCKSHIFT;
// add the polyobj to each blockmap section
for(int j = bbox[BOXBOTTOM]*bmapwidth; j <= bbox[BOXTOP]*bmapwidth;
j += bmapwidth)
{
for(int i = bbox[BOXLEFT]; i <= bbox[BOXRIGHT]; i++)
{
if(i >= 0 && i < bmapwidth && j >= 0 && j < bmapheight*bmapwidth)
{
link = &PolyBlockMap[j+i];
if(!(*link))
{ // Create a new link at the current block cell
*link = new polyblock_t;
(*link)->next = NULL;
(*link)->prev = NULL;
(*link)->polyobj = this;
continue;
}
else
{
tempLink = *link;
while(tempLink->next != NULL && tempLink->polyobj != NULL)
{
tempLink = tempLink->next;
}
}
if(tempLink->polyobj == NULL)
{
tempLink->polyobj = this;
continue;
}
else
{
tempLink->next = new polyblock_t;
tempLink->next->next = NULL;
tempLink->next->prev = tempLink;
tempLink->next->polyobj = this;
}
}
// else, don't link the polyobj, since it's off the map
}
}
}
//===========================================================================
//
// PO_ClosestPoint
//
// Given a point (x,y), returns the point (ox,oy) on the polyobject's walls
// that is nearest to (x,y). Also returns the seg this point came from.
//
//===========================================================================
void FPolyObj::ClosestPoint(fixed_t fx, fixed_t fy, fixed_t &ox, fixed_t &oy, side_t **side) const
{
unsigned int i;
double x = fx, y = fy;
double bestdist = HUGE_VAL;
double bestx = 0, besty = 0;
side_t *bestline = NULL;
for (i = 0; i < Sidedefs.Size(); ++i)
{
vertex_t *v1 = Sidedefs[i]->V1();
vertex_t *v2 = Sidedefs[i]->V2();
double a = v2->x - v1->x;
double b = v2->y - v1->y;
double den = a*a + b*b;
double ix, iy, dist;
if (den == 0)
{ // Line is actually a point!
ix = v1->x;
iy = v1->y;
}
else
{
double num = (x - v1->x) * a + (y - v1->y) * b;
double u = num / den;
if (u <= 0)
{
ix = v1->x;
iy = v1->y;
}
else if (u >= 1)
{
ix = v2->x;
iy = v2->y;
}
else
{
ix = v1->x + u * a;
iy = v1->y + u * b;
}
}
a = (ix - x);
b = (iy - y);
dist = a*a + b*b;
if (dist < bestdist)
{
bestdist = dist;
bestx = ix;
besty = iy;
bestline = Sidedefs[i];
}
}
ox = fixed_t(bestx);
oy = fixed_t(besty);
if (side != NULL)
{
*side = bestline;
}
}
//==========================================================================
//
// InitBlockMap
//
//==========================================================================
static void InitBlockMap (void)
{
int i;
PolyBlockMap = new polyblock_t *[bmapwidth*bmapheight];
memset (PolyBlockMap, 0, bmapwidth*bmapheight*sizeof(polyblock_t *));
for (i = 0; i < po_NumPolyobjs; i++)
{
polyobjs[i].LinkPolyobj();
}
}
//==========================================================================
//
// InitSideLists [RH]
//
// Group sides by vertex and collect side that are known to belong to a
// polyobject so that they can be initialized fast.
//==========================================================================
static void InitSideLists ()
{
for (int i = 0; i < numsides; ++i)
{
if (sides[i].linedef != NULL &&
(sides[i].linedef->special == Polyobj_StartLine ||
sides[i].linedef->special == Polyobj_ExplicitLine))
{
KnownPolySides.Push (i);
}
}
}
//==========================================================================
//
// KillSideLists [RH]
//
//==========================================================================
static void KillSideLists ()
{
KnownPolySides.Clear ();
KnownPolySides.ShrinkToFit ();
}
//==========================================================================
//
// AddPolyVert
//
// Helper function for IterFindPolySides()
//
//==========================================================================
static void AddPolyVert(TArray<DWORD> &vnum, DWORD vert)
{
for (unsigned int i = vnum.Size() - 1; i-- != 0; )
{
if (vnum[i] == vert)
{ // Already in the set. No need to add it.
return;
}
}
vnum.Push(vert);
}
//==========================================================================
//
// IterFindPolySides
//
// Beginning with the first vertex of the starting side, for each vertex
// in vnum, add all the sides that use it as a first vertex to the polyobj,
// and add all their second vertices to vnum. This continues until there
// are no new vertices in vnum.
//
//==========================================================================
static void IterFindPolySides (FPolyObj *po, side_t *side)
{
static TArray<DWORD> vnum;
unsigned int vnumat;
assert(sidetemp != NULL);
vnum.Clear();
vnum.Push(DWORD(side->V1() - vertexes));
vnumat = 0;
while (vnum.Size() != vnumat)
{
DWORD sidenum = sidetemp[vnum[vnumat++]].b.first;
while (sidenum != NO_SIDE)
{
po->Sidedefs.Push(&sides[sidenum]);
AddPolyVert(vnum, DWORD(sides[sidenum].V2() - vertexes));
sidenum = sidetemp[sidenum].b.next;
}
}
}
//==========================================================================
//
// SpawnPolyobj
//
//==========================================================================
static void SpawnPolyobj (int index, int tag, int type)
{
unsigned int ii;
int i;
int j;
FPolyObj *po = &polyobjs[index];
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i < 0)
{
continue;
}
side_t *sd = &sides[i];
if (sd->linedef->special == Polyobj_StartLine &&
sd->linedef->args[0] == tag)
{
if (po->Sidedefs.Size() > 0)
{
I_Error ("SpawnPolyobj: Polyobj %d already spawned.\n", tag);
}
sd->linedef->special = 0;
sd->linedef->args[0] = 0;
IterFindPolySides(&polyobjs[index], sd);
po->crush = (type != PO_SPAWN_TYPE) ? 3 : 0;
po->bHurtOnTouch = (type == PO_SPAWNHURT_TYPE);
po->tag = tag;
po->seqType = sd->linedef->args[2];
if (po->seqType < 0 || po->seqType > 63)
{
po->seqType = 0;
}
break;
}
}
if (po->Sidedefs.Size() == 0)
{
// didn't find a polyobj through PO_LINE_START
TArray<side_t *> polySideList;
unsigned int psIndexOld;
for (j = 1; j < PO_MAXPOLYSEGS; j++)
{
psIndexOld = po->Sidedefs.Size();
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i >= 0 &&
sides[i].linedef->special == Polyobj_ExplicitLine &&
sides[i].linedef->args[0] == tag)
{
if (!sides[i].linedef->args[1])
{
I_Error ("SpawnPolyobj: Explicit line missing order number (probably %d) in poly %d.\n",
j+1, tag);
}
if (sides[i].linedef->args[1] == j)
{
po->Sidedefs.Push (&sides[i]);
}
}
}
// Clear out any specials for these segs...we cannot clear them out
// in the above loop, since we aren't guaranteed one seg per linedef.
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i >= 0 &&
sides[i].linedef->special == Polyobj_ExplicitLine &&
sides[i].linedef->args[0] == tag && sides[i].linedef->args[1] == j)
{
sides[i].linedef->special = 0;
sides[i].linedef->args[0] = 0;
KnownPolySides[ii] = -1;
}
}
if (po->Sidedefs.Size() == psIndexOld)
{ // Check if an explicit line order has been skipped.
// A line has been skipped if there are any more explicit
// lines with the current tag value. [RH] Can this actually happen?
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i >= 0 &&
sides[i].linedef->special == Polyobj_ExplicitLine &&
sides[i].linedef->args[0] == tag)
{
I_Error ("SpawnPolyobj: Missing explicit line %d for poly %d\n",
j, tag);
}
}
}
}
if (po->Sidedefs.Size() > 0)
{
po->crush = (type != PO_SPAWN_TYPE) ? 3 : 0;
po->bHurtOnTouch = (type == PO_SPAWNHURT_TYPE);
po->tag = tag;
po->seqType = po->Sidedefs[0]->linedef->args[3];
// Next, change the polyobj's first line to point to a mirror
// if it exists
po->Sidedefs[0]->linedef->args[1] =
po->Sidedefs[0]->linedef->args[2];
}
else
I_Error ("SpawnPolyobj: Poly %d does not exist\n", tag);
}
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
validcount++;
for(unsigned int i=0; i<po->Sidedefs.Size(); i++)
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
{
line_t *l = po->Sidedefs[i]->linedef;
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 (l->validcount != validcount)
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
{
l->validcount = validcount;
po->Linedefs.Push(l);
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
vertex_t *v = l->v1;
int j;
for(j = po->Vertices.Size() - 1; j >= 0; j--)
{
if (po->Vertices[j] == v) break;
}
if (j < 0) po->Vertices.Push(v);
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
v = l->v2;
for(j = po->Vertices.Size() - 1; j >= 0; j--)
{
if (po->Vertices[j] == v) break;
}
if (j < 0) po->Vertices.Push(v);
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
}
}
po->Sidedefs.ShrinkToFit();
po->Linedefs.ShrinkToFit();
po->Vertices.ShrinkToFit();
}
//==========================================================================
//
// TranslateToStartSpot
//
//==========================================================================
static void TranslateToStartSpot (int tag, int originX, int originY)
{
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
FPolyObj *po;
int deltaX;
int deltaY;
po = NULL;
for (int i = 0; i < po_NumPolyobjs; i++)
{
if (polyobjs[i].tag == tag)
{
po = &polyobjs[i];
break;
}
}
if (po == NULL)
{ // didn't match the tag with a polyobj tag
I_Error("TranslateToStartSpot: Unable to match polyobj tag: %d\n", tag);
}
if (po->Sidedefs.Size() == 0)
{
I_Error ("TranslateToStartSpot: Anchor point located without a StartSpot point: %d\n", tag);
}
po->OriginalPts.Resize(po->Sidedefs.Size());
po->PrevPts.Resize(po->Sidedefs.Size());
deltaX = originX - po->StartSpot.x;
deltaY = originY - po->StartSpot.y;
for (unsigned i = 0; i < po->Sidedefs.Size(); i++)
{
po->Sidedefs[i]->Flags |= WALLF_POLYOBJ;
}
for (unsigned i = 0; i < po->Linedefs.Size(); i++)
{
po->Linedefs[i]->bbox[BOXTOP] -= deltaY;
po->Linedefs[i]->bbox[BOXBOTTOM] -= deltaY;
po->Linedefs[i]->bbox[BOXLEFT] -= deltaX;
po->Linedefs[i]->bbox[BOXRIGHT] -= deltaX;
}
for (unsigned i = 0; i < po->Vertices.Size(); i++)
{
po->Vertices[i]->x -= deltaX;
po->Vertices[i]->y -= deltaY;
po->OriginalPts[i].x = po->Vertices[i]->x - po->StartSpot.x;
po->OriginalPts[i].y = po->Vertices[i]->y - po->StartSpot.y;
}
po->CalcCenter();
// For compatibility purposes
po->CenterSubsector = R_PointInSubsector(po->CenterSpot.x, po->CenterSpot.y);
}
//==========================================================================
//
// PO_Init
//
//==========================================================================
void PO_Init (void)
{
// [RH] Hexen found the polyobject-related things by reloading the map's
// THINGS lump here and scanning through it. I have P_SpawnMapThing()
// record those things instead, so that in here we simply need to
// look at the polyspawns list.
polyspawns_t *polyspawn, **prev;
int polyIndex;
// [RH] Make this faster
InitSideLists ();
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
polyobjs = new FPolyObj[po_NumPolyobjs];
polyIndex = 0; // index polyobj number
// Find the startSpot points, and spawn each polyobj
for (polyspawn = polyspawns, prev = &polyspawns; polyspawn;)
{
// 9301 (3001) = no crush, 9302 (3002) = crushing, 9303 = hurting touch
if (polyspawn->type == PO_SPAWN_TYPE ||
polyspawn->type == PO_SPAWNCRUSH_TYPE ||
polyspawn->type == PO_SPAWNHURT_TYPE)
{
// Polyobj StartSpot Pt.
polyobjs[polyIndex].StartSpot.x = polyspawn->x;
polyobjs[polyIndex].StartSpot.y = polyspawn->y;
SpawnPolyobj(polyIndex, polyspawn->angle, polyspawn->type);
polyIndex++;
*prev = polyspawn->next;
delete polyspawn;
polyspawn = *prev;
}
else
{
prev = &polyspawn->next;
polyspawn = polyspawn->next;
}
}
for (polyspawn = polyspawns; polyspawn;)
{
polyspawns_t *next = polyspawn->next;
if (polyspawn->type == PO_ANCHOR_TYPE)
{
// Polyobj Anchor Pt.
TranslateToStartSpot (polyspawn->angle, polyspawn->x, polyspawn->y);
}
delete polyspawn;
polyspawn = next;
}
polyspawns = NULL;
// check for a startspot without an anchor point
for (polyIndex = 0; polyIndex < po_NumPolyobjs; polyIndex++)
{
if (polyobjs[polyIndex].OriginalPts.Size() == 0)
{
I_Error ("PO_Init: StartSpot located without an Anchor point: %d\n",
polyobjs[polyIndex].tag);
}
}
InitBlockMap();
// [RH] Don't need the seg lists anymore
KillSideLists ();
for(int i=0;i<numnodes;i++)
{
node_t *no = &nodes[i];
double fdx = (double)no->dx;
double fdy = (double)no->dy;
no->len = (float)sqrt(fdx * fdx + fdy * fdy);
}
}
//==========================================================================
//
// PO_Busy
//
//==========================================================================
bool PO_Busy (int polyobj)
{
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
FPolyObj *poly;
- 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
poly = PO_GetPolyobj (polyobj);
return (poly != NULL && poly->specialdata != NULL);
}
//==========================================================================
//
//
//
//==========================================================================
void FPolyObj::ClearSubsectorLinks()
{
while (subsectorlinks != NULL)
{
assert(subsectorlinks->state == 1337);
FPolyNode *next = subsectorlinks->snext;
if (subsectorlinks->pnext != NULL)
{
assert(subsectorlinks->pnext->state == 1337);
subsectorlinks->pnext->pprev = subsectorlinks->pprev;
}
if (subsectorlinks->pprev != NULL)
{
assert(subsectorlinks->pprev->state == 1337);
subsectorlinks->pprev->pnext = subsectorlinks->pnext;
}
else
{
subsectorlinks->subsector->polys = subsectorlinks->pnext;
}
if (subsectorlinks->subsector->BSP != NULL)
{
subsectorlinks->subsector->BSP->bDirty = true;
}
subsectorlinks->state = -1;
delete subsectorlinks;
subsectorlinks = next;
}
subsectorlinks = NULL;
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
void FPolyObj::ClearAllSubsectorLinks()
{
for (int i = 0; i < po_NumPolyobjs; i++)
{
polyobjs[i].ClearSubsectorLinks();
}
ReleaseAllPolyNodes();
}
//==========================================================================
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
//
// GetIntersection
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
//
// adapted from P_InterceptVector
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
//
//==========================================================================
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
static bool GetIntersection(FPolySeg *seg, node_t *bsp, FPolyVertex *v)
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
{
double frac;
double num;
double den;
double v2x = (double)seg->v1.x;
double v2y = (double)seg->v1.y;
double v2dx = (double)(seg->v2.x - seg->v1.x);
double v2dy = (double)(seg->v2.y - seg->v1.y);
double v1x = (double)bsp->x;
double v1y = (double)bsp->y;
double v1dx = (double)bsp->dx;
double v1dy = (double)bsp->dy;
den = v1dy*v2dx - v1dx*v2dy;
if (den == 0)
return false; // parallel
num = (v1x - v2x)*v1dy + (v2y - v1y)*v1dx;
frac = num / den;
if (frac < 0. || frac > 1.) return false;
v->x = xs_RoundToInt(v2x + frac * v2dx);
v->y = xs_RoundToInt(v2y + frac * v2dy);
return true;
}
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
//==========================================================================
//
// PartitionDistance
//
// Determine the distance of a vertex to a node's partition line.
//
//==========================================================================
static double PartitionDistance(FPolyVertex *vt, node_t *node)
{
return fabs(double(-node->dy) * (vt->x - node->x) + double(node->dx) * (vt->y - node->y)) / node->len;
}
//==========================================================================
//
// AddToBBox
//
//==========================================================================
static void AddToBBox(fixed_t child[4], fixed_t parent[4])
{
if (child[BOXTOP] > parent[BOXTOP])
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
{
parent[BOXTOP] = child[BOXTOP];
}
if (child[BOXBOTTOM] < parent[BOXBOTTOM])
{
parent[BOXBOTTOM] = child[BOXBOTTOM];
}
if (child[BOXLEFT] < parent[BOXLEFT])
{
parent[BOXLEFT] = child[BOXLEFT];
}
if (child[BOXRIGHT] > parent[BOXRIGHT])
{
parent[BOXRIGHT] = child[BOXRIGHT];
}
}
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
//==========================================================================
//
// AddToBBox
//
//==========================================================================
static void AddToBBox(FPolyVertex *v, fixed_t bbox[4])
{
if (v->x < bbox[BOXLEFT])
{
bbox[BOXLEFT] = v->x;
}
if (v->x > bbox[BOXRIGHT])
{
bbox[BOXRIGHT] = v->x;
}
if (v->y < bbox[BOXBOTTOM])
{
bbox[BOXBOTTOM] = v->y;
}
if (v->y > bbox[BOXTOP])
{
bbox[BOXTOP] = v->y;
}
}
//==========================================================================
//
// SplitPoly
//
//==========================================================================
static void SplitPoly(FPolyNode *pnode, void *node, fixed_t bbox[4])
{
static TArray<FPolySeg> lists[2];
static const double POLY_EPSILON = 0.3125;
if (!((size_t)node & 1)) // Keep going until found a subsector
{
node_t *bsp = (node_t *)node;
int centerside = R_PointOnSide(pnode->poly->CenterSpot.x, pnode->poly->CenterSpot.y, bsp);
lists[0].Clear();
lists[1].Clear();
for(unsigned i=0;i<pnode->segs.Size(); i++)
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
{
FPolySeg *seg = &pnode->segs[i];
// Parts of the following code were taken from Eternity and are
// being used with permission.
// get distance of vertices from partition line
// If the distance is too small, we may decide to
// change our idea of sidedness.
double dist_v1 = PartitionDistance(&seg->v1, bsp);
double dist_v2 = PartitionDistance(&seg->v2, bsp);
// If the distances are less than epsilon, consider the points as being
// on the same side as the polyobj origin. Why? People like to build
// polyobject doors flush with their door tracks. This breaks using the
// usual assumptions.
// Addition to Eternity code: We must also check any seg with only one
// vertex inside the epsilon threshold. If not, these lines will get split but
// adjoining ones with both vertices inside the threshold won't thus messing up
// the order in which they get drawn.
if(dist_v1 <= POLY_EPSILON)
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
{
if (dist_v2 <= POLY_EPSILON)
{
lists[centerside].Push(*seg);
}
else
{
int side = R_PointOnSide(seg->v2.x, seg->v2.y, bsp);
lists[side].Push(*seg);
}
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
}
else if (dist_v2 <= POLY_EPSILON)
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
{
int side = R_PointOnSide(seg->v1.x, seg->v1.y, bsp);
lists[side].Push(*seg);
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
}
else
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
{
int side1 = R_PointOnSide(seg->v1.x, seg->v1.y, bsp);
int side2 = R_PointOnSide(seg->v2.x, seg->v2.y, bsp);
if(side1 != side2)
{
// if the partition line crosses this seg, we must split it.
FPolyVertex vert;
if (GetIntersection(seg, bsp, &vert))
{
lists[0].Push(*seg);
lists[1].Push(*seg);
lists[side1].Last().v2 = vert;
lists[side2].Last().v1 = vert;
}
else
{
// should never happen
lists[side1].Push(*seg);
}
}
else
{
// both points on the same side.
lists[side1].Push(*seg);
}
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
}
}
if (lists[1].Size() == 0)
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
{
SplitPoly(pnode, bsp->children[0], bsp->bbox[0]);
AddToBBox(bsp->bbox[0], bbox);
}
else if (lists[0].Size() == 0)
{
SplitPoly(pnode, bsp->children[1], bsp->bbox[1]);
AddToBBox(bsp->bbox[1], bbox);
}
else
{
// create the new node
FPolyNode *newnode = NewPolyNode();
newnode->poly = pnode->poly;
newnode->segs = lists[1];
// set segs for original node
pnode->segs = lists[0];
// recurse back side
SplitPoly(newnode, bsp->children[1], bsp->bbox[1]);
// recurse front side
SplitPoly(pnode, bsp->children[0], bsp->bbox[0]);
AddToBBox(bsp->bbox[0], bbox);
AddToBBox(bsp->bbox[1], bbox);
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
}
}
else
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
{
// we reached a subsector so we can link the node with this subsector
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
// Link node to subsector
pnode->pnext = sub->polys;
if (pnode->pnext != NULL)
{
assert(pnode->pnext->state == 1337);
pnode->pnext->pprev = pnode;
}
pnode->pprev = NULL;
sub->polys = pnode;
// link node to polyobject
pnode->snext = pnode->poly->subsectorlinks;
pnode->poly->subsectorlinks = pnode;
pnode->subsector = sub;
// calculate bounding box for this polynode
assert(pnode->segs.Size() != 0);
fixed_t subbbox[4] = { FIXED_MIN, FIXED_MAX, FIXED_MAX, FIXED_MIN };
for (unsigned i = 0; i < pnode->segs.Size(); ++i)
{
AddToBBox(&pnode->segs[i].v1, subbbox);
AddToBBox(&pnode->segs[i].v2, subbbox);
}
// Potentially expand the parent node's bounding box to contain these bits of polyobject.
AddToBBox(subbbox, bbox);
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
}
}
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
//==========================================================================
//
//
//
//==========================================================================
void FPolyObj::CreateSubsectorLinks()
{
FPolyNode *node = NewPolyNode();
// Even though we don't care about it, we need to initialize this
// bounding box to something so that Valgrind won't complain about it
// when SplitPoly modifies it.
fixed_t dummybbox[4] = { 0 };
node->poly = this;
node->segs.Resize(Sidedefs.Size());
for(unsigned i=0; i<Sidedefs.Size(); i++)
{
FPolySeg *seg = &node->segs[i];
side_t *side = Sidedefs[i];
seg->v1 = side->V1();
seg->v2 = side->V2();
seg->wall = side;
}
if (!(i_compatflags & COMPATF_POLYOBJ))
{
SplitPoly(node, nodes + numnodes - 1, dummybbox);
}
else
{
subsector_t *sub = CenterSubsector;
// Link node to subsector
node->pnext = sub->polys;
if (node->pnext != NULL)
{
assert(node->pnext->state == 1337);
node->pnext->pprev = node;
}
node->pprev = NULL;
sub->polys = node;
// link node to polyobject
node->snext = node->poly->subsectorlinks;
node->poly->subsectorlinks = node;
node->subsector = sub;
}
}
//==========================================================================
//
//
//
//==========================================================================
void PO_LinkToSubsectors()
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
{
for (int i = 0; i < po_NumPolyobjs; i++)
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 (polyobjs[i].subsectorlinks == NULL)
{
polyobjs[i].CreateSubsectorLinks();
}
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
}
}
//==========================================================================
//
// NewPolyNode
//
//==========================================================================
static FPolyNode *NewPolyNode()
{
FPolyNode *node;
if (FreePolyNodes != NULL)
{
node = FreePolyNodes;
FreePolyNodes = node->pnext;
}
else
{
node = new FPolyNode;
}
node->state = 1337;
node->poly = NULL;
node->pnext = NULL;
node->pprev = NULL;
node->subsector = NULL;
node->snext = NULL;
return node;
}
//==========================================================================
//
// FreePolyNode
//
//==========================================================================
void FreePolyNode(FPolyNode *node)
{
node->segs.Clear();
node->pnext = FreePolyNodes;
FreePolyNodes = node;
}
//==========================================================================
//
// ReleaseAllPolyNodes
//
//==========================================================================
void ReleaseAllPolyNodes()
{
FPolyNode *node, *next;
for (node = FreePolyNodes; node != NULL; node = next)
{
next = node->pnext;
delete node;
}
}