2008-01-27 11:25:03 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright(C) 2000 Simon Howard
|
2008-02-24 23:36:07 +00:00
|
|
|
// Copyright(C) 2005-2008 Christoph Oelckers
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Functions
|
|
|
|
//
|
|
|
|
// functions are stored as variables(see variable.c), the
|
|
|
|
// value being a pointer to a 'handler' function for the
|
|
|
|
// function. Arguments are stored in an argc/argv-style list
|
|
|
|
//
|
|
|
|
// this module contains all the handler functions for the
|
|
|
|
// basic FraggleScript Functions.
|
|
|
|
//
|
|
|
|
// By Simon Howard
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2008-02-24 23:36:07 +00:00
|
|
|
//
|
|
|
|
// FraggleScript is from SMMU which is under the GPL. Technically,
|
|
|
|
// therefore, combining the FraggleScript code with the non-free
|
|
|
|
// ZDoom code is a violation of the GPL.
|
|
|
|
//
|
|
|
|
// As this may be a problem for you, I hereby grant an exception to my
|
|
|
|
// copyright on the SMMU source (including FraggleScript). You may use
|
|
|
|
// any code from SMMU in GZDoom, provided that:
|
|
|
|
//
|
|
|
|
// * For any binary release of the port, the source code is also made
|
|
|
|
// available.
|
|
|
|
// * The copyright notice is kept on any file containing my code.
|
|
|
|
//
|
|
|
|
//
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "t_script.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "p_lnspec.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "c_console.h"
|
|
|
|
#include "c_dispatch.h"
|
|
|
|
#include "d_player.h"
|
|
|
|
#include "a_doomglobal.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "gi.h"
|
2008-02-23 21:12:27 +00:00
|
|
|
#include "zstring.h"
|
Update to ZDoom r1146 (warning: massive changes ahead!)
- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist.
- Changed the state structure so that the Tics value doesn't need to be hacked
into misc1 with SF_BIGTIC anymore.
- Changed sprite processing so that sprite names are converted to indices
during parsing so that an additional postprocessing step is no longer needed.
- Fixed: Sprite names in DECORATE were case sensitive.
- Exported AActor's defaults to DECORATE and removed all code for the
internal property parser which is no longer needed.
- Converted the Heresiarch to DECORATE.
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
processors.
- Converted the last of Hexen's inventory items to DECORATE so that I could
export AInventory.
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with
DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
number.
- Added Gez's Freedoom detection patch.
- SBARINFO update:
* Added: The ability to have drawkeybar auto detect spacing.
* Added: Offset parameter to drawkeybar to allow two key bars with
different keys.
* Added: Multi-row/column keybar parameters. Spacing can also be auto.
These defualt to left to right/top to bottom but can be switched.
* Added: Drawshadow flag to drawnumber. This will draw a solid color and
translucent number under the normal number.
* Added: hexenarmor to drawimage. This takes a parameter for a hexen
armor type and will fade the image like the hexen status bar.
* Added: centerbottom offset to draw(switchable)image.
* Added: translucent flag to drawinventorybar.
* Fixed: Accidentally removed flag from DrawTexture that allowed negative
coordinates to work with fullscreenoffsets. Hopefully this is the last
major bug in the fullscreenoffsets system.
- Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of
registers AMD64 provides, this routine still needs to be written as self-
modifying code for maximum performance. The additional registers do allow
for further optimization over the x86 version by allowing all four pixels
to be in flight at the same time. The end result is that AMD64 ASM is about
2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM.
(For further comparison, AMD64 C and x86 C are practically the same for
this function.) Should I port any more assembly to AMD64, mvlineasm4 is the
most likely candidate, but it's not used enough at this point to bother.
Also, this may or may not work with Linux at the moment, since it doesn't
have the eh_handler metadata. Win64 is easier, since I just need to
structure the function prologue and epilogue properly and use some
assembler directives/macros to automatically generate the metadata. And
that brings up another point: You need YASM to assemble the AMD64 code,
because NASM doesn't support the Win64 metadata directives.
- Replaced the ActorInfo definitions of several internal classes with DECORATE definitions
- Converted teleport fog and destinations to DECORATE.
- AActor::PreExplode is gone now that the last item that was using it has been converted.
- Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE.
- Exported Point pushers, CustomSprite and AmbientSound to DECORATE.
- Changed increased lightning damage for Centaurs into a damage factor.
- Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage
types instead to keep dependencies on specific actor types out of the main engine code.
- Added Korax DECORATE conversion by Gez and a few others by Karate Chris.
- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon
pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.
- Added an SSE version of DoBlending. This is strictly C intrinsics.
VC++ still throws around unneccessary register moves. GCC seems to be
pretty close to optimal, requiring only about 2 cycles/color. They're
both faster than my hand-written MMX routine, so I don't need to feel
bad about not hand-optimizing this for x64 builds.
- Removed an extra instruction from DoBlending_MMX, transposed two
instructions, and unrolled it once, shaving off about 80 cycles from the
time required to blend 256 palette entries. Why? Because I tried writing
a C version of the routine using compiler intrinsics and was appalled by
all the extra movq's VC++ added to the code. GCC was better, but still
generated extra instructions. I only wanted a C version because I can't
use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit
of a pain. (It's a pain because Linux and Windows have different calling
conventions, and you need to maintain extra metadata for functions.) So,
the assembly version stays and the C version stays out.
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.
I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that
this feature can also be used by other actors.
- Converted Strife's Stalker to DECORATE.
- Converted ArtiTeleport to DECORATE.
- Removed the NoBlockingSet method from AActor because everything using it has been
converted to DECORATE using DropItem instead.
- Changed: Macil doesn't need the StrifeHumanoid's special death states so he might
as well inherit directly from AActor.
- Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved
the burning hand states to StrifePlayer where they really belong.
- Added Gez's dropammofactor submission with some necessary changes. Also merged
redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup.
- Restricted native action function definitions to zdoom.pk3.
- Fixed. The Firedemon was missing a game filter.
- Added: disablegrin, disableouch, disablepain, and disablerampage flags to
drawmugshot.
- Fixed: LowerHealthCap did not work properly.
- Fixed: Various bugs I noticed in the fullscreenoffsets code.
- Removed all the pixel doubling r_detail modes, since the one platform they
were intended to assist (486) actually sees very little benefit from them.
- Rewrote CheckMMX in C and renamed it to CheckCPU.
- Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache
only for AMD processors, so we must not use it on other architectures, or
we end up overwriting the L1 cache line size with 0 or some other number
we don't actually understand.
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.
- Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER
so that it can hopefully be generalized to be usable elsewhere later.
- Added Gez's submission for converting the Minotaur to DECORATE.
- Fixed a few minor DECORATE bugs.
- Changed coordinate storage for EntityBoss so that it works properly even
when the pod is not used to spawn it.
- Converted Strife's Spectres and Entity to DECORATE.
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
system to be relative to the top left corner of the screen. This is useful
for full screen status bars.
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
to determine the spacing. Let me know if this breaks any released mods.
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
would be shown.
- Fixed: If a static inventory bar was used the user still had to press invuse
in order to get rid of the "overlay".
- Fixed: forcescaled would not work if the height of the bar was 0.
- Added: keyslot to drawswitchableimage.
- Fixed: The transition effects for the log and keys popups were switched.
- Converted Strife's Crusader, Inquisitor and spectral missiles to
DECORATE.
- Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to
DECORATE.
- Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris.
- Added a check to Zipdir that excludes files with a .orig extension. These
can be left behind by patch.exe and create problems.
- fixed: Unmorphing from chicken caused a crash when reading non-existent
meta-data strings.
- Converted the ScriptedMarines to DECORATE.
- Fixed: DLightTransfer and DWallLightTransfer were declared as actors.
- Converted the PhoenixRod and associated classes to DECORATE to make
the Heretic conversion complete.
- Converted the Minotaur's projectiles to DECORATE so that I can get
rid of the AT_SPEED_SET code.
- Converted Heretic's Blaster and SkullRod to DECORATE.
- Converted the mace and all related actors to DECORATE and generalized
the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
for replacement actors.
- Added more DECORATE conversions by Karate Chris.
- Cleaned up the new bridge code and exported all related actors to
DECORATE so that the exported code pointers can be used.
- Separated Heretic's and Hexen's invulnerability items for stability
reasons.
- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play()
instead of requiring a separate SetPosition() call to do it.
- Added Gez's submission for custom bridge things.
- Fixed: ASpecialSpot must check the array's size before dividing by it.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
|
|
|
#include "i_system.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "doomstat.h"
|
|
|
|
#include "g_level.h"
|
|
|
|
#include "v_palette.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
#include "gl/gl_data.h"
|
|
|
|
|
|
|
|
static FRandom pr_script("FScript");
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
|
2008-02-21 22:28:42 +00:00
|
|
|
#define AngleToFixed(x) ((((double) x) / ((double) ANG45/45)) * FRACUNIT)
|
|
|
|
#define FixedToAngle(x) ((((double) x) / FRACUNIT) * ANG45/45)
|
2008-02-23 21:12:27 +00:00
|
|
|
#define FIXED_TO_FLOAT(f) ((f)/(float)FRACUNIT)
|
|
|
|
#define CenterSpot(sec) (vertex_t*)&(sec)->soundorg[0]
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// Disables Legacy-incompatible bug fixes.
|
2008-06-28 13:29:59 +00:00
|
|
|
//CVAR(Bool, fs_forcecompatible, false, CVAR_ARCHIVE|CVAR_SERVERINFO)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
// functions. FParser::SF_ means Script Function not, well.. heh, me
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
/////////// actually running a function /////////////
|
|
|
|
|
|
|
|
//==========================================================================
|
2008-02-23 21:12:27 +00:00
|
|
|
//
|
|
|
|
// The Doom actors in their original order
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static const char * const ActorNames_init[]=
|
|
|
|
{
|
|
|
|
"DoomPlayer",
|
|
|
|
"ZombieMan",
|
|
|
|
"ShotgunGuy",
|
|
|
|
"Archvile",
|
|
|
|
"ArchvileFire",
|
|
|
|
"Revenant",
|
|
|
|
"RevenantTracer",
|
|
|
|
"RevenantTracerSmoke",
|
|
|
|
"Fatso",
|
|
|
|
"FatShot",
|
|
|
|
"ChaingunGuy",
|
|
|
|
"DoomImp",
|
|
|
|
"Demon",
|
|
|
|
"Spectre",
|
|
|
|
"Cacodemon",
|
|
|
|
"BaronOfHell",
|
|
|
|
"BaronBall",
|
|
|
|
"HellKnight",
|
|
|
|
"LostSoul",
|
|
|
|
"SpiderMastermind",
|
|
|
|
"Arachnotron",
|
|
|
|
"Cyberdemon",
|
|
|
|
"PainElemental",
|
|
|
|
"WolfensteinSS",
|
|
|
|
"CommanderKeen",
|
|
|
|
"BossBrain",
|
|
|
|
"BossEye",
|
|
|
|
"BossTarget",
|
|
|
|
"SpawnShot",
|
|
|
|
"SpawnFire",
|
|
|
|
"ExplosiveBarrel",
|
|
|
|
"DoomImpBall",
|
|
|
|
"CacodemonBall",
|
|
|
|
"Rocket",
|
|
|
|
"PlasmaBall",
|
|
|
|
"BFGBall",
|
|
|
|
"ArachnotronPlasma",
|
|
|
|
"BulletPuff",
|
|
|
|
"Blood",
|
|
|
|
"TeleportFog",
|
|
|
|
"ItemFog",
|
|
|
|
"TeleportDest",
|
|
|
|
"BFGExtra",
|
|
|
|
"GreenArmor",
|
|
|
|
"BlueArmor",
|
|
|
|
"HealthBonus",
|
|
|
|
"ArmorBonus",
|
|
|
|
"BlueCard",
|
|
|
|
"RedCard",
|
|
|
|
"YellowCard",
|
|
|
|
"YellowSkull",
|
|
|
|
"RedSkull",
|
|
|
|
"BlueSkull",
|
|
|
|
"Stimpack",
|
|
|
|
"Medikit",
|
|
|
|
"Soulsphere",
|
|
|
|
"InvulnerabilitySphere",
|
|
|
|
"Berserk",
|
|
|
|
"BlurSphere",
|
|
|
|
"RadSuit",
|
|
|
|
"Allmap",
|
|
|
|
"Infrared",
|
|
|
|
"Megasphere",
|
|
|
|
"Clip",
|
|
|
|
"ClipBox",
|
|
|
|
"RocketAmmo",
|
|
|
|
"RocketBox",
|
|
|
|
"Cell",
|
|
|
|
"CellBox",
|
|
|
|
"Shell",
|
|
|
|
"ShellBox",
|
|
|
|
"Backpack",
|
|
|
|
"BFG9000",
|
|
|
|
"Chaingun",
|
|
|
|
"Chainsaw",
|
|
|
|
"RocketLauncher",
|
|
|
|
"PlasmaRifle",
|
|
|
|
"Shotgun",
|
|
|
|
"SuperShotgun",
|
|
|
|
"TechLamp",
|
|
|
|
"TechLamp2",
|
|
|
|
"Column",
|
|
|
|
"TallGreenColumn",
|
|
|
|
"ShortGreenColumn",
|
|
|
|
"TallRedColumn",
|
|
|
|
"ShortRedColumn",
|
|
|
|
"SkullColumn",
|
|
|
|
"HeartColumn",
|
|
|
|
"EvilEye",
|
|
|
|
"FloatingSkull",
|
|
|
|
"TorchTree",
|
|
|
|
"BlueTorch",
|
|
|
|
"GreenTorch",
|
|
|
|
"RedTorch",
|
|
|
|
"ShortBlueTorch",
|
|
|
|
"ShortGreenTorch",
|
|
|
|
"ShortRedTorch",
|
|
|
|
"Slalagtite",
|
|
|
|
"TechPillar",
|
|
|
|
"CandleStick",
|
|
|
|
"Candelabra",
|
|
|
|
"BloodyTwitch",
|
|
|
|
"Meat2",
|
|
|
|
"Meat3",
|
|
|
|
"Meat4",
|
|
|
|
"Meat5",
|
|
|
|
"NonsolidMeat2",
|
|
|
|
"NonsolidMeat4",
|
|
|
|
"NonsolidMeat3",
|
|
|
|
"NonsolidMeat5",
|
|
|
|
"NonsolidTwitch",
|
|
|
|
"DeadCacodemon",
|
|
|
|
"DeadMarine",
|
|
|
|
"DeadZombieMan",
|
|
|
|
"DeadDemon",
|
|
|
|
"DeadLostSoul",
|
|
|
|
"DeadDoomImp",
|
|
|
|
"DeadShotgunGuy",
|
|
|
|
"GibbedMarine",
|
|
|
|
"GibbedMarineExtra",
|
|
|
|
"HeadsOnAStick",
|
|
|
|
"Gibs",
|
|
|
|
"HeadOnAStick",
|
|
|
|
"HeadCandles",
|
|
|
|
"DeadStick",
|
|
|
|
"LiveStick",
|
|
|
|
"BigTree",
|
|
|
|
"BurningBarrel",
|
|
|
|
"HangNoGuts",
|
|
|
|
"HangBNoBrain",
|
|
|
|
"HangTLookingDown",
|
|
|
|
"HangTSkull",
|
|
|
|
"HangTLookingUp",
|
|
|
|
"HangTNoBrain",
|
|
|
|
"ColonGibs",
|
|
|
|
"SmallBloodPool",
|
|
|
|
"BrainStem",
|
|
|
|
"PointPusher",
|
|
|
|
"PointPuller",
|
|
|
|
};
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
static const PClass * ActorTypes[countof(ActorNames_init)];
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Some functions that take care of the major differences between the class
|
|
|
|
// based actor system from ZDoom and Doom's index based one
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Gets an actor class
|
|
|
|
// Input can be either a class name, an actor variable or a Doom index
|
|
|
|
// Doom index is only supported for the original things up to MBF
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
const PClass * T_GetMobjType(svalue_t arg)
|
|
|
|
{
|
|
|
|
const PClass * PClass=NULL;
|
|
|
|
|
|
|
|
if (arg.type==svt_string)
|
|
|
|
{
|
|
|
|
PClass=PClass::FindClass(arg.string);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
// invalid object to spawn
|
|
|
|
if(!PClass) script_error("unknown object type: %s\n", arg.string.GetChars());
|
|
|
|
}
|
|
|
|
else if (arg.type==svt_mobj)
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
AActor * mo = actorvalue(arg);
|
2008-02-23 21:12:27 +00:00
|
|
|
if (mo) PClass = mo->GetClass();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int objtype = intvalue(arg);
|
2008-02-25 08:44:31 +00:00
|
|
|
if (objtype>=0 && objtype<int(countof(ActorTypes))) PClass=ActorTypes[objtype];
|
2008-02-23 21:12:27 +00:00
|
|
|
else PClass=NULL;
|
|
|
|
|
|
|
|
// invalid object to spawn
|
|
|
|
if(!PClass) script_error("unknown object type: %i\n", objtype);
|
|
|
|
}
|
|
|
|
return PClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Gets a player index
|
|
|
|
// Input can be either an actor variable or an index value
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-23 21:12:27 +00:00
|
|
|
static int T_GetPlayerNum(const svalue_t &arg)
|
|
|
|
{
|
|
|
|
int playernum;
|
|
|
|
if(arg.type == svt_mobj)
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if(!actorvalue(arg) || !arg.value.mobj->player)
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
// I prefer this not to make an error.
|
|
|
|
// This way a player function used for a non-player
|
|
|
|
// object will just do nothing
|
|
|
|
//script_error("mobj not a player!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
playernum = arg.value.mobj->player - players;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
playernum = intvalue(arg);
|
|
|
|
|
|
|
|
if(playernum < 0 || playernum > MAXPLAYERS)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if(!playeringame[playernum]) // no error, just return -1
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return playernum;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-23 21:12:27 +00:00
|
|
|
// Finds a sector from a tag. This has been extended to allow looking for
|
|
|
|
// sectors directly by passing a negative value
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-23 21:12:27 +00:00
|
|
|
int T_FindSectorFromTag(int tagnum,int startsector)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-23 21:12:27 +00:00
|
|
|
if (tagnum<=0)
|
|
|
|
{
|
|
|
|
if (startsector<0)
|
|
|
|
{
|
|
|
|
if (tagnum==-32768) return 0;
|
|
|
|
if (-tagnum<numsectors) return -tagnum;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return P_FindSectorFromTag(tagnum,startsector);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
|
2008-02-21 22:28:42 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-23 21:12:27 +00:00
|
|
|
// Get an ammo type
|
|
|
|
// Input can be either a class name or a Doom index
|
|
|
|
// Doom index is only supported for the 4 original ammo types
|
2008-02-21 22:28:42 +00:00
|
|
|
//
|
2008-02-23 21:12:27 +00:00
|
|
|
//==========================================================================
|
|
|
|
static const PClass * T_GetAmmo(const svalue_t &t)
|
|
|
|
{
|
|
|
|
const char * p;
|
|
|
|
|
|
|
|
if (t.type==svt_string)
|
|
|
|
{
|
|
|
|
p=stringvalue(t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// backwards compatibility with Legacy.
|
|
|
|
// allow only Doom's standard types here!
|
|
|
|
static const char * DefAmmo[]={"Clip","Shell","Cell","RocketAmmo"};
|
|
|
|
int ammonum = intvalue(t);
|
|
|
|
if(ammonum < 0 || ammonum >= 4)
|
|
|
|
{
|
|
|
|
script_error("ammo number out of range: %i", ammonum);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
p=DefAmmo[ammonum];
|
|
|
|
}
|
|
|
|
const PClass * am=PClass::FindClass(p);
|
|
|
|
if (!am->IsDescendantOf(RUNTIME_CLASS(AAmmo)))
|
|
|
|
{
|
|
|
|
script_error("unknown ammo type : %s", p);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return am;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Finds a sound in the sound table and adds a new entry if it isn't defined
|
|
|
|
// It's too bad that this is necessary but FS doesn't know about this kind
|
|
|
|
// of sound management.
|
2008-02-21 22:28:42 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-06-15 17:17:31 +00:00
|
|
|
static FSoundID T_FindSound(const char * name)
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
char buffer[40];
|
2008-06-15 17:17:31 +00:00
|
|
|
FSoundID so=S_FindSound(name);
|
2008-02-23 21:12:27 +00:00
|
|
|
|
|
|
|
if (so>0) return so;
|
|
|
|
|
|
|
|
// Now it gets dirty!
|
|
|
|
|
|
|
|
if (gameinfo.gametype & GAME_DoomStrife)
|
|
|
|
{
|
2008-07-23 21:54:02 +00:00
|
|
|
mysnprintf(buffer, countof(buffer), "DS%.35s", name);
|
2008-02-23 21:12:27 +00:00
|
|
|
if (Wads.CheckNumForName(buffer, ns_sounds)<0) strcpy(buffer, name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy(buffer, name);
|
2008-07-23 19:29:18 +00:00
|
|
|
if (Wads.CheckNumForName(buffer, ns_sounds)<0) mysnprintf(buffer, countof(buffer), "DS%.35s", name);
|
2008-02-23 21:12:27 +00:00
|
|
|
}
|
2008-06-15 17:17:31 +00:00
|
|
|
|
|
|
|
int id = S_AddSound(name, buffer);
|
2008-02-23 21:12:27 +00:00
|
|
|
S_HashSounds();
|
2008-06-28 13:29:59 +00:00
|
|
|
return FSoundID(id);
|
2008-02-23 21:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Creates a string out of a print argument list. This version does not
|
|
|
|
// have any length restrictions like the original FS versions had.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
FString FParser::GetFormatString(int startarg)
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
FString fmt="";
|
|
|
|
for(int i=startarg; i<t_argc; i++) fmt += stringvalue(t_argv[i]);
|
|
|
|
return fmt;
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
bool FParser::CheckArgs(int cnt)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (t_argc<cnt)
|
|
|
|
{
|
2008-02-23 23:13:02 +00:00
|
|
|
script_error("Insufficient parameters for '%s'\n", t_func.GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2008-02-23 21:12:27 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//FUNCTIONS
|
|
|
|
|
|
|
|
// the actual handler functions for the
|
|
|
|
// functions themselves
|
|
|
|
|
|
|
|
// arguments are evaluated and passed to the
|
|
|
|
// handler functions using 't_argc' and 't_argv'
|
|
|
|
// in a similar way to the way C does with command
|
|
|
|
// line options.
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
// values can be returned from the functions using
|
|
|
|
// the variable 't_return'
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// prints some text to the console and the notify buffer
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Print(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
Printf(PRINT_HIGH, "%s\n", GetFormatString(0).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// return a random number from 0 to 255
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Rnd(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = pr_script();
|
|
|
|
}
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// looping section. using the rover, find the highest level
|
2008-02-24 23:36:07 +00:00
|
|
|
// loop we are currently in and return the DFsSection for it.
|
2008-02-23 21:12:27 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
DFsSection *FParser::looping_section()
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
DFsSection *best = NULL; // highest level loop we're in
|
2008-02-23 21:12:27 +00:00
|
|
|
// that has been found so far
|
|
|
|
int n;
|
|
|
|
|
|
|
|
// check thru all the hashchains
|
2008-02-24 23:36:07 +00:00
|
|
|
SDWORD rover_index = Script->MakeIndex(Rover);
|
2008-02-23 21:12:27 +00:00
|
|
|
|
|
|
|
for(n=0; n<SECTIONSLOTS; n++)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
DFsSection *current = Script->sections[n];
|
2008-02-23 21:12:27 +00:00
|
|
|
|
|
|
|
// check all the sections in this hashchain
|
|
|
|
while(current)
|
|
|
|
{
|
|
|
|
// a loop?
|
|
|
|
|
|
|
|
if(current->type == st_loop)
|
|
|
|
// check to see if it's a loop that we're inside
|
2008-02-24 23:36:07 +00:00
|
|
|
if(rover_index >= current->start_index && rover_index <= current->end_index)
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
// a higher nesting level than the best one so far?
|
2008-02-24 23:36:07 +00:00
|
|
|
if(!best || (current->start_index > best->start_index))
|
2008-02-23 21:12:27 +00:00
|
|
|
best = current; // save it
|
|
|
|
}
|
|
|
|
current = current->next;
|
|
|
|
}
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-23 21:12:27 +00:00
|
|
|
|
|
|
|
return best; // return the best one found
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// "continue;" in FraggleScript is a function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Continue(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
DFsSection *section;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if(!(section = looping_section()) ) // no loop found
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-01-27 11:25:03 +00:00
|
|
|
script_error("continue() not in loop\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
Rover = Script->SectionEnd(section); // jump to the closing brace
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Break(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
DFsSection *section;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if(!(section = looping_section()) )
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-01-27 11:25:03 +00:00
|
|
|
script_error("break() not in loop\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
Rover = Script->SectionEnd(section) + 1; // jump out of the loop
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Goto(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// check argument is a labelptr
|
|
|
|
|
|
|
|
if(t_argv[0].type != svt_label)
|
|
|
|
{
|
|
|
|
script_error("goto argument not a label\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// go there then if everythings fine
|
2008-02-24 23:36:07 +00:00
|
|
|
Rover = Script->LabelValue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Return(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
throw CFsTerminator();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Include(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
char tempstr[12];
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argv[0].type == svt_string)
|
2008-01-27 15:34:47 +00:00
|
|
|
{
|
2008-02-23 21:12:27 +00:00
|
|
|
strncpy(tempstr, t_argv[0].string, 8);
|
2008-01-27 15:34:47 +00:00
|
|
|
tempstr[8]=0;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-07-23 19:29:18 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i", (int)t_argv[0].value.i);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
Script->ParseInclude(tempstr);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Input(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
Printf(PRINT_BOLD,"input() function not available in doom\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Beep(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
S_Sound(CHAN_AUTO, "misc/chat", 1.0f, ATTN_IDLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Clock(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = (gametic*100)/TICRATE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************** doom stuff ****************/
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ExitLevel(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
G_ExitLevel(0, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Tip(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (t_argc>0 && Script->trigger &&
|
|
|
|
Script->trigger->CheckLocalView(consoleplayer))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
C_MidPrint(GetFormatString(0).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_TimedTip
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Implements: void timedtip(int clocks, ...)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
EXTERN_CVAR(Float, con_midtime)
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_TimedTip(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
float saved = con_midtime;
|
|
|
|
con_midtime = intvalue(t_argv[0])/100.0f;
|
2008-02-24 23:36:07 +00:00
|
|
|
C_MidPrint(GetFormatString(1).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
con_midtime=saved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// tip to a particular player
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerTip(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int plnum = T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (plnum!=-1 && players[plnum].mo->CheckLocalView(consoleplayer))
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
C_MidPrint(GetFormatString(1).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// message player
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Message(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (t_argc>0 && Script->trigger &&
|
|
|
|
Script->trigger->CheckLocalView(consoleplayer))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
Printf(PRINT_HIGH, "%s\n", GetFormatString(0).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// message to a particular player
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerMsg(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int plnum = T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (plnum!=-1 && players[plnum].mo->CheckLocalView(consoleplayer))
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
Printf(PRINT_HIGH, "%s\n", GetFormatString(1).GetChars());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerInGame(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int plnum = T_GetPlayerNum(t_argv[0]);
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
if (plnum!=-1)
|
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = playeringame[plnum];
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerName(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int plnum;
|
|
|
|
|
|
|
|
if(!t_argc)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-01-27 11:25:03 +00:00
|
|
|
player_t *pl=NULL;
|
2008-02-24 23:36:07 +00:00
|
|
|
if (Script->trigger) pl = Script->trigger->player;
|
2008-01-27 11:25:03 +00:00
|
|
|
if(pl) plnum = pl - players;
|
|
|
|
else plnum=-1;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
|
|
|
plnum = T_GetPlayerNum(t_argv[0]);
|
|
|
|
|
|
|
|
if(plnum !=-1)
|
|
|
|
{
|
|
|
|
t_return.type = svt_string;
|
2008-02-23 21:12:27 +00:00
|
|
|
t_return.string = players[plnum].userinfo.netname;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
script_error("script not started by player\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// object being controlled by player
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerObj(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int plnum;
|
|
|
|
|
|
|
|
if(!t_argc)
|
|
|
|
{
|
|
|
|
player_t *pl=NULL;
|
2008-02-24 23:36:07 +00:00
|
|
|
if (Script->trigger) pl = Script->trigger->player;
|
2008-01-27 11:25:03 +00:00
|
|
|
if(pl) plnum = pl - players;
|
|
|
|
else plnum=-1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
plnum = T_GetPlayerNum(t_argv[0]);
|
|
|
|
|
|
|
|
if(plnum !=-1)
|
|
|
|
{
|
|
|
|
t_return.type = svt_mobj;
|
|
|
|
t_return.value.mobj = players[plnum].mo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
script_error("script not started by player\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Player(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
|
|
|
|
if(mo && mo->player) // haleyjd: added mo->player
|
|
|
|
{
|
|
|
|
t_return.value.i = (int)(mo->player - players);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t_return.value.i = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_Spawn
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Implements: mobj spawn(int type, int x, int y, [int angle], [int z], [bool zrel])
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Spawn(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int x, y, z;
|
|
|
|
const PClass *PClass;
|
|
|
|
angle_t angle = 0;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (!(PClass=T_GetMobjType(t_argv[0]))) return;
|
|
|
|
|
|
|
|
x = fixedvalue(t_argv[1]);
|
|
|
|
y = fixedvalue(t_argv[2]);
|
|
|
|
|
|
|
|
if(t_argc >= 5)
|
|
|
|
{
|
|
|
|
z = fixedvalue(t_argv[4]);
|
|
|
|
// [Graf Zahl] added option of spawning with a relative z coordinate
|
|
|
|
if(t_argc > 5)
|
|
|
|
{
|
|
|
|
if (intvalue(t_argv[5])) z+=P_PointInSector(x, y)->floorplane.ZatPoint(x,y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Legacy compatibility is more important than correctness.
|
|
|
|
z = ONFLOORZ;// (GetDefaultByType(PClass)->flags & MF_SPAWNCEILING) ? ONCEILINGZ : ONFLOORZ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(t_argc >= 4)
|
|
|
|
{
|
|
|
|
angle = intvalue(t_argv[3]) * (SQWORD)ANG45 / 45;
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_mobj;
|
|
|
|
t_return.value.mobj = Spawn(PClass, x, y, z, ALLOW_REPLACE);
|
|
|
|
|
|
|
|
if (t_return.value.mobj)
|
|
|
|
{
|
|
|
|
t_return.value.mobj->angle = angle;
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
if (!DFraggleThinker::ActiveThinker->nocheckposition)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (!P_TestMobjLocation(t_return.value.mobj))
|
|
|
|
{
|
|
|
|
if (t_return.value.mobj->flags&MF_COUNTKILL) level.total_monsters--;
|
|
|
|
if (t_return.value.mobj->flags&MF_COUNTITEM) level.total_items--;
|
|
|
|
t_return.value.mobj->Destroy();
|
|
|
|
t_return.value.mobj = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_RemoveObj(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
AActor * mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(mo) // nullptr check
|
|
|
|
{
|
|
|
|
if (mo->flags&MF_COUNTKILL && mo->health>0) level.total_monsters--;
|
|
|
|
if (mo->flags&MF_COUNTITEM) level.total_items--;
|
|
|
|
mo->Destroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_KillObj(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
2008-01-27 11:25:03 +00:00
|
|
|
AActor *mo;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger; // default to trigger object
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
if(mo)
|
|
|
|
{
|
|
|
|
// ensure the thing can be killed
|
|
|
|
mo->flags|=MF_SHOOTABLE;
|
|
|
|
mo->flags2&=~(MF2_INVULNERABLE|MF2_DORMANT);
|
|
|
|
// [GrafZahl] This called P_KillMobj directly
|
|
|
|
// which is a very bad thing to do!
|
|
|
|
P_DamageMobj(mo, NULL, NULL, mo->health, NAME_Massacre);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjX(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_fixed; // haleyjd: SoM's fixed-point fix
|
|
|
|
t_return.value.f = mo ? mo->x : 0; // null ptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjY(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_fixed; // haleyjd
|
|
|
|
t_return.value.f = mo ? mo->y : 0; // null ptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjZ(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_fixed; // haleyjd
|
|
|
|
t_return.value.f = mo ? mo->z : 0; // null ptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjAngle(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_fixed; // haleyjd: fixed-point -- SoM again :)
|
|
|
|
t_return.value.f = mo ? (fixed_t)AngleToFixed(mo->angle) : 0; // null ptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// teleport: object, sector_tag
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Teleport(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tag;
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc == 1) // 1 argument: sector tag
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = Script->trigger; // default to trigger
|
2008-01-27 11:25:03 +00:00
|
|
|
tag = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else // 2 or more
|
|
|
|
{ // teleport a given object
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
tag = intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mo)
|
|
|
|
EV_Teleport(0, tag, NULL, 0, mo, true, true, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SilentTeleport(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tag;
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc == 1) // 1 argument: sector tag
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = Script->trigger; // default to trigger
|
2008-01-27 11:25:03 +00:00
|
|
|
tag = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else // 2 or more
|
|
|
|
{ // teleport a given object
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
tag = intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mo)
|
|
|
|
EV_Teleport(0, tag, NULL, 0, mo, false, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_DamageObj(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
int damageamount;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc == 1) // 1 argument: damage trigger by amount
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = Script->trigger; // default to trigger
|
2008-01-27 11:25:03 +00:00
|
|
|
damageamount = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else // 2 or more
|
|
|
|
{ // damage a given object
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
damageamount = intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mo)
|
2008-02-24 23:36:07 +00:00
|
|
|
P_DamageMobj(mo, NULL, Script->trigger, damageamount, NAME_None);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// the tag number of the sector the thing is in
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjSector(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// use trigger object if not specified
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = mo ? mo->Sector->tag : 0; // nullptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// the health number of an object
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjHealth(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// use trigger object if not specified
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = mo ? mo->health : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjFlag(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
int flagnum;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc == 1) // use trigger, 1st is flag
|
|
|
|
{
|
|
|
|
// use trigger:
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = Script->trigger;
|
2008-01-27 11:25:03 +00:00
|
|
|
flagnum = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else if(t_argc == 2) // specified object
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
flagnum = intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
else // >= 3 : SET flags
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
flagnum = intvalue(t_argv[1]);
|
|
|
|
|
|
|
|
if(mo && flagnum<26) // nullptr check
|
|
|
|
{
|
|
|
|
// remove old bit
|
|
|
|
mo->flags &= ~(1 << flagnum);
|
|
|
|
|
|
|
|
// make the new flag
|
|
|
|
mo->flags |= (!!intvalue(t_argv[2])) << flagnum;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
t_return.type = svt_int;
|
|
|
|
if (mo && flagnum<26)
|
|
|
|
{
|
|
|
|
t_return.value.i = !!(mo->flags & (1 << flagnum));
|
|
|
|
}
|
|
|
|
else t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// apply momentum to a thing
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PushThing(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
AActor * mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(!mo) return;
|
|
|
|
|
|
|
|
angle_t angle = (angle_t)FixedToAngle(fixedvalue(t_argv[1]));
|
|
|
|
fixed_t force = fixedvalue(t_argv[2]);
|
|
|
|
|
|
|
|
P_ThrustMobj(mo, angle, force);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_ReactionTime -- useful for freezing things
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ReactionTime(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
AActor *mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo) mo->reactiontime = (intvalue(t_argv[1]) * TICRATE) / 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = mo ? mo->reactiontime : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_MobjTarget -- sets a thing's target field
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// Sets a mobj's Target! >:)
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjTarget(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
AActor* target;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
target = actorvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(mo && target && mo->SeeState) // haleyjd: added target check -- no NULL allowed
|
|
|
|
{
|
|
|
|
mo->target=target;
|
|
|
|
mo->SetState(mo->SeeState);
|
|
|
|
mo->flags|=MF_JUSTHIT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_mobj;
|
|
|
|
t_return.value.mobj = mo ? mo->target : NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_MobjMomx, MobjMomy, MobjMomz -- momentum functions
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjMomx(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo)
|
|
|
|
mo->momx = fixedvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = mo ? mo->momx : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjMomy(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo)
|
|
|
|
mo->momy = fixedvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = mo ? mo->momy : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjMomz(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo)
|
|
|
|
mo->momz = fixedvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = mo ? mo->momz : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
/****************** Trig *********************/
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PointToAngle(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(4))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t x1 = fixedvalue(t_argv[0]);
|
|
|
|
fixed_t y1 = fixedvalue(t_argv[1]);
|
|
|
|
fixed_t x2 = fixedvalue(t_argv[2]);
|
|
|
|
fixed_t y2 = fixedvalue(t_argv[3]);
|
|
|
|
|
|
|
|
angle_t angle = R_PointToAngle2(x1, y1, x2, y2);
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = (fixed_t)AngleToFixed(angle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PointToDist(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(4))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Doing this in floating point is actually faster with modern computers!
|
|
|
|
float x = floatvalue(t_argv[2]) - floatvalue(t_argv[0]);
|
|
|
|
float y = floatvalue(t_argv[3]) - floatvalue(t_argv[1]);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = (fixed_t)(sqrtf(x*x+y*y)*65536.f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// setcamera(obj, [angle], [height], [pitch])
|
|
|
|
//
|
|
|
|
// [GrafZahl] This is a complete rewrite.
|
|
|
|
// Although both Eternity and Legacy implement this function
|
|
|
|
// they are mutually incompatible with each other and with ZDoom...
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetCamera(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
angle_t angle;
|
|
|
|
player_t * player;
|
|
|
|
AActor * newcamera;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
player=Script->trigger->player;
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!player) player=&players[0];
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
newcamera = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(!newcamera)
|
|
|
|
{
|
|
|
|
script_error("invalid location object for camera\n");
|
|
|
|
return; // nullptr check
|
|
|
|
}
|
|
|
|
|
|
|
|
angle = t_argc < 2 ? newcamera->angle : (fixed_t)FixedToAngle(fixedvalue(t_argv[1]));
|
|
|
|
|
|
|
|
newcamera->special1=newcamera->angle;
|
|
|
|
newcamera->special2=newcamera->z;
|
|
|
|
newcamera->z = t_argc < 3 ? (newcamera->z + (41 << FRACBITS)) : (intvalue(t_argv[2]) << FRACBITS);
|
|
|
|
newcamera->angle = angle;
|
|
|
|
if(t_argc < 4) newcamera->pitch = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fixed_t pitch = fixedvalue(t_argv[3]);
|
|
|
|
if(pitch < -50*FRACUNIT) pitch = -50*FRACUNIT;
|
|
|
|
if(pitch > 50*FRACUNIT) pitch = 50*FRACUNIT;
|
|
|
|
newcamera->pitch=(angle_t)((pitch/65536.0f)*(ANGLE_45/45.0f)*(20.0f/32.0f));
|
|
|
|
}
|
|
|
|
player->camera=newcamera;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ClearCamera(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
player_t * player;
|
2008-02-24 23:36:07 +00:00
|
|
|
player=Script->trigger->player;
|
2008-01-27 11:25:03 +00:00
|
|
|
if (!player) player=&players[0];
|
|
|
|
|
|
|
|
AActor * cam=player->camera;
|
|
|
|
if (cam)
|
|
|
|
{
|
|
|
|
player->camera=player->mo;
|
|
|
|
cam->angle=cam->special1;
|
|
|
|
cam->z=cam->special2;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********** sounds ******************/
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// start sound from thing
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_StartSound(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (mo)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound(mo, CHAN_BODY, T_FindSound(stringvalue(t_argv[1])), 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// start sound from sector
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_StartSectorSound(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sector_t *sector;
|
|
|
|
int tagnum;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
int i=-1;
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
sector = §ors[i];
|
2008-07-04 16:54:29 +00:00
|
|
|
S_Sound(sector, CHAN_BODY, T_FindSound(stringvalue(t_argv[1])), 1.0f, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/************* Sector functions ***************/
|
|
|
|
|
|
|
|
//DMover::EResult P_MoveFloor (sector_t * m_Sector, fixed_t speed, fixed_t dest, int crush, int direction, int flags=0);
|
|
|
|
//DMover::EResult P_MoveCeiling (sector_t * m_Sector, fixed_t speed, fixed_t dest, int crush, int direction, int flags=0);
|
|
|
|
|
|
|
|
class DFloorChanger : public DFloor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DFloorChanger(sector_t * sec)
|
|
|
|
: DFloor(sec) {}
|
|
|
|
|
|
|
|
bool Move(fixed_t speed, fixed_t dest, int crush, int direction)
|
|
|
|
{
|
2008-03-20 10:39:44 +00:00
|
|
|
bool res = DMover::crushed != MoveFloor(speed, dest, crush, direction, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
Destroy();
|
|
|
|
m_Sector->floordata=NULL;
|
2008-06-08 09:24:55 +00:00
|
|
|
StopInterpolation();
|
2008-01-27 11:25:03 +00:00
|
|
|
m_Sector=NULL;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// floor height of sector
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_FloorHeight(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tagnum;
|
|
|
|
int secnum;
|
|
|
|
fixed_t dest;
|
|
|
|
int returnval = 1; // haleyjd: SoM's fixes
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
if(t_argc > 1) // > 1: set floor height
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int crush = (t_argc >= 3) ? intvalue(t_argv[2]) : false;
|
|
|
|
|
|
|
|
i = -1;
|
|
|
|
dest = fixedvalue(t_argv[1]);
|
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
if (sectors[i].floordata) continue; // don't move floors that are active!
|
|
|
|
|
|
|
|
DFloorChanger * f = new DFloorChanger(§ors[i]);
|
|
|
|
if (!f->Move(
|
|
|
|
abs(dest - sectors[i].CenterFloor()),
|
|
|
|
sectors[i].floorplane.PointToDist (CenterSpot(§ors[i]), dest),
|
|
|
|
crush? 10:-1,
|
|
|
|
(dest > sectors[i].CenterFloor()) ? 1 : -1))
|
|
|
|
{
|
|
|
|
returnval = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
if(secnum < 0)
|
|
|
|
{
|
|
|
|
script_error("sector not found with tagnum %i\n", tagnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
returnval = sectors[secnum].CenterFloor() >> FRACBITS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// return floor height
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = returnval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
class DMoveFloor : public DFloor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DMoveFloor(sector_t * sec,int moveheight,int _m_Direction,int crush,int movespeed)
|
|
|
|
: DFloor(sec)
|
|
|
|
{
|
|
|
|
m_Type = floorRaiseByValue;
|
|
|
|
m_Crush = crush;
|
|
|
|
m_Speed=movespeed;
|
|
|
|
m_Direction = _m_Direction;
|
|
|
|
m_FloorDestDist = moveheight;
|
|
|
|
StartFloorSound();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MoveFloor(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int secnum = -1;
|
|
|
|
sector_t *sec;
|
|
|
|
int tagnum, platspeed = 1, destheight, crush;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
destheight = intvalue(t_argv[1]) * FRACUNIT;
|
|
|
|
platspeed = t_argc > 2 ? fixedvalue(t_argv[2]) : FRACUNIT;
|
|
|
|
crush = (t_argc > 3 ? intvalue(t_argv[3]) : -1);
|
|
|
|
|
|
|
|
// move all sectors with tag
|
|
|
|
|
|
|
|
while ((secnum = T_FindSectorFromTag(tagnum, secnum)) >= 0)
|
|
|
|
{
|
|
|
|
sec = §ors[secnum];
|
|
|
|
// Don't start a second thinker on the same floor
|
|
|
|
if (sec->floordata) continue;
|
|
|
|
|
|
|
|
new DMoveFloor(sec,sec->floorplane.PointToDist(CenterSpot(sec),destheight),
|
|
|
|
destheight < sec->CenterFloor() ? -1:1,crush,platspeed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
class DCeilingChanger : public DCeiling
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DCeilingChanger(sector_t * sec)
|
|
|
|
: DCeiling(sec) {}
|
|
|
|
|
|
|
|
bool Move(fixed_t speed, fixed_t dest, int crush, int direction)
|
|
|
|
{
|
2008-03-20 10:39:44 +00:00
|
|
|
bool res = DMover::crushed != MoveCeiling(speed, dest, crush, direction, false);
|
2008-01-27 11:25:03 +00:00
|
|
|
Destroy();
|
|
|
|
m_Sector->ceilingdata=NULL;
|
2008-06-08 09:24:55 +00:00
|
|
|
StopInterpolation ();
|
2008-01-27 11:25:03 +00:00
|
|
|
m_Sector=NULL;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// ceiling height of sector
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_CeilingHeight(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t dest;
|
|
|
|
int secnum;
|
|
|
|
int tagnum;
|
|
|
|
int returnval = 1;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
if(t_argc > 1) // > 1: set ceilheight
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int crush = (t_argc >= 3) ? intvalue(t_argv[2]) : false;
|
|
|
|
|
|
|
|
i = -1;
|
|
|
|
dest = fixedvalue(t_argv[1]);
|
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
if (sectors[i].ceilingdata) continue; // don't move ceilings that are active!
|
|
|
|
|
|
|
|
DCeilingChanger * c = new DCeilingChanger(§ors[i]);
|
|
|
|
if (!c->Move(
|
|
|
|
abs(dest - sectors[i].CenterCeiling()),
|
|
|
|
sectors[i].ceilingplane.PointToDist (CenterSpot(§ors[i]), dest),
|
|
|
|
crush? 10:-1,
|
|
|
|
(dest > sectors[i].CenterCeiling()) ? 1 : -1))
|
|
|
|
{
|
|
|
|
returnval = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
if(secnum < 0)
|
|
|
|
{
|
|
|
|
script_error("sector not found with tagnum %i\n", tagnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
returnval = sectors[secnum].CenterCeiling() >> FRACBITS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// return ceiling height
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = returnval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
class DMoveCeiling : public DCeiling
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
DMoveCeiling(sector_t * sec,int tag,fixed_t destheight,fixed_t speed,int silent,int crush)
|
|
|
|
: DCeiling(sec)
|
|
|
|
{
|
|
|
|
m_Crush = crush;
|
|
|
|
m_Speed2 = m_Speed = m_Speed1 = speed;
|
|
|
|
m_Silent = silent;
|
|
|
|
m_Type = DCeiling::ceilLowerByValue; // doesn't really matter as long as it's no special value
|
|
|
|
m_Tag=tag;
|
|
|
|
vertex_t * spot=CenterSpot(sec);
|
|
|
|
m_TopHeight=m_BottomHeight=sec->ceilingplane.PointToDist(spot,destheight);
|
2008-08-22 07:36:50 +00:00
|
|
|
m_Direction=destheight>sec->GetPlaneTexZ(sector_t::ceiling)? 1:-1;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Do not interpolate instant movement ceilings.
|
|
|
|
fixed_t movedist = abs(sec->ceilingplane.d - m_BottomHeight);
|
|
|
|
if (m_Speed >= movedist)
|
|
|
|
{
|
2008-06-08 09:24:55 +00:00
|
|
|
StopInterpolation ();
|
2008-01-27 11:25:03 +00:00
|
|
|
m_Silent=2;
|
|
|
|
}
|
|
|
|
PlayCeilingSound();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MoveCeiling(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int secnum = -1;
|
|
|
|
sector_t *sec;
|
|
|
|
int tagnum, platspeed = 1, destheight;
|
|
|
|
int crush;
|
|
|
|
int silent;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
destheight = intvalue(t_argv[1]) * FRACUNIT;
|
|
|
|
platspeed = /*FLOORSPEED **/ (t_argc > 2 ? fixedvalue(t_argv[2]) : FRACUNIT);
|
|
|
|
crush=t_argc>3 ? intvalue(t_argv[3]):-1;
|
|
|
|
silent=t_argc>4 ? intvalue(t_argv[4]):1;
|
|
|
|
|
|
|
|
// move all sectors with tag
|
|
|
|
while ((secnum = T_FindSectorFromTag(tagnum, secnum)) >= 0)
|
|
|
|
{
|
|
|
|
sec = §ors[secnum];
|
|
|
|
|
|
|
|
// Don't start a second thinker on the same floor
|
|
|
|
if (sec->ceilingdata) continue;
|
|
|
|
new DMoveCeiling(sec, tagnum, destheight, platspeed, silent, crush);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_LightLevel(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sector_t *sector;
|
|
|
|
int secnum;
|
|
|
|
int tagnum;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// argv is sector tag
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sector = §ors[secnum];
|
|
|
|
|
|
|
|
if(t_argc > 1) // > 1: set light level
|
|
|
|
{
|
|
|
|
int i = -1;
|
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
sectors[i].lightlevel = (short)intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// return lightlevel
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = sector->lightlevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// Simple light fade - locks lightingdata. For FParser::SF_FadeLight
|
2008-02-23 21:12:27 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
class DLightLevel : public DLighting
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DLightLevel, DLighting)
|
|
|
|
|
|
|
|
unsigned char destlevel;
|
|
|
|
unsigned char speed;
|
|
|
|
|
|
|
|
DLightLevel() {}
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DLightLevel(sector_t * s,int destlevel,int speed);
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
void Tick ();
|
|
|
|
void Destroy() { Super::Destroy(); m_Sector->lightingdata=NULL; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_CLASS (DLightLevel)
|
|
|
|
|
|
|
|
void DLightLevel::Serialize (FArchive &arc)
|
|
|
|
{
|
|
|
|
Super::Serialize (arc);
|
|
|
|
arc << destlevel << speed;
|
|
|
|
if (arc.IsLoading()) m_Sector->lightingdata=this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
// sf 13/10/99:
|
|
|
|
//
|
|
|
|
// T_LightFade()
|
|
|
|
//
|
|
|
|
// Just fade the light level in a sector to a new level
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void DLightLevel::Tick()
|
|
|
|
{
|
|
|
|
Super::Tick();
|
|
|
|
if(m_Sector->lightlevel < destlevel)
|
|
|
|
{
|
|
|
|
// increase the lightlevel
|
|
|
|
if(m_Sector->lightlevel + speed >= destlevel)
|
|
|
|
{
|
|
|
|
// stop changing light level
|
|
|
|
m_Sector->lightlevel = destlevel; // set to dest lightlevel
|
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Sector->lightlevel = m_Sector->lightlevel+speed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// decrease lightlevel
|
2008-02-23 21:12:27 +00:00
|
|
|
if(m_Sector->lightlevel - speed <= destlevel)
|
|
|
|
{
|
|
|
|
// stop changing light level
|
|
|
|
m_Sector->lightlevel = destlevel; // set to dest lightlevel
|
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Sector->lightlevel = m_Sector->lightlevel-speed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
DLightLevel::DLightLevel(sector_t * s,int _destlevel,int _speed) : DLighting(s)
|
|
|
|
{
|
|
|
|
destlevel=_destlevel;
|
|
|
|
speed=_speed;
|
|
|
|
s->lightingdata=this;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
// sf 13/10/99:
|
|
|
|
//
|
|
|
|
// P_FadeLight()
|
|
|
|
//
|
|
|
|
// Fade all the lights in sectors with a particular tag to a new value
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_FadeLight(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int sectag, destlevel, speed = 1;
|
|
|
|
int i;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
sectag = intvalue(t_argv[0]);
|
|
|
|
destlevel = intvalue(t_argv[1]);
|
|
|
|
speed = t_argc>2 ? intvalue(t_argv[2]) : 1;
|
|
|
|
|
|
|
|
for (i = -1; (i = P_FindSectorFromTag(sectag,i)) >= 0;)
|
|
|
|
{
|
|
|
|
if (!sectors[i].lightingdata) new DLightLevel(§ors[i],destlevel,speed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_FloorTexture(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tagnum, secnum;
|
|
|
|
sector_t *sector;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// argv is sector tag
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
|
|
|
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
|
|
|
|
|
|
|
sector = §ors[secnum];
|
|
|
|
|
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
int i = -1;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
sectors[i].SetTexture(sector_t::floor, picnum);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_string;
|
2008-08-22 07:36:50 +00:00
|
|
|
FTexture * tex = TexMan[sector->GetTexture(sector_t::floor)];
|
2008-02-23 21:12:27 +00:00
|
|
|
t_return.string = tex? tex->Name : "";
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SectorColormap(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// This doesn't work properly and it never will.
|
|
|
|
// Whatever was done here originally, it is incompatible
|
|
|
|
// with Boom and ZDoom and doesn't work properly in Legacy either.
|
|
|
|
|
|
|
|
// Making it no-op is probably the best thing one can do in this case.
|
|
|
|
|
|
|
|
/*
|
|
|
|
int tagnum, secnum;
|
|
|
|
sector_t *sector;
|
|
|
|
int c=2;
|
|
|
|
int i = -1;
|
|
|
|
|
|
|
|
if(t_argc<2)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{ script_error("insufficient arguments to function\n"); return; }
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// argv is sector tag
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
sector = §ors[secnum];
|
|
|
|
|
|
|
|
if (t_argv[1].type==svt_string)
|
|
|
|
{
|
|
|
|
DWORD cm = R_ColormapNumForName(t_argv[1].value.s);
|
|
|
|
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
sectors[i].midmap=cm;
|
|
|
|
sectors[i].heightsec=§ors[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_CeilingTexture(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tagnum, secnum;
|
|
|
|
sector_t *sector;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// argv is sector tag
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
|
|
|
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
|
|
|
|
|
|
|
sector = §ors[secnum];
|
|
|
|
|
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
int i = -1;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
sectors[i].SetTexture(sector_t::ceiling, picnum);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_string;
|
2008-08-22 07:36:50 +00:00
|
|
|
FTexture * tex = TexMan[sector->GetTexture(sector_t::ceiling)];
|
2008-02-23 21:12:27 +00:00
|
|
|
t_return.string = tex? tex->Name : "";
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ChangeHubLevel(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
I_Error("FS hub system permanently disabled\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
// for start map: start new game on a particular skill
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_StartSkill(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
I_Error("startskill is not supported by this implementation!\n");
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Doors
|
|
|
|
//
|
2008-02-23 21:12:27 +00:00
|
|
|
// opendoor(sectag, [delay], [speed])
|
2008-03-12 15:21:17 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_OpenDoor(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int speed, wait_time;
|
|
|
|
int sectag;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// got sector tag
|
|
|
|
sectag = intvalue(t_argv[0]);
|
|
|
|
if (sectag==0) return; // tag 0 not allowed
|
|
|
|
|
|
|
|
// door wait time
|
|
|
|
if(t_argc > 1) wait_time = (intvalue(t_argv[1]) * TICRATE) / 100;
|
|
|
|
else wait_time = 0; // 0= stay open
|
|
|
|
|
|
|
|
// door speed
|
|
|
|
if(t_argc > 2) speed = intvalue(t_argv[2]);
|
|
|
|
else speed = 1; // 1= normal speed
|
|
|
|
|
|
|
|
EV_DoDoor(wait_time? DDoor::doorRaise:DDoor::doorOpen,NULL,NULL,sectag,2*FRACUNIT*clamp(speed,1,127),wait_time,0,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_CloseDoor(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int speed;
|
|
|
|
int sectag;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// got sector tag
|
|
|
|
sectag = intvalue(t_argv[0]);
|
|
|
|
if (sectag==0) return; // tag 0 not allowed
|
|
|
|
|
|
|
|
// door speed
|
|
|
|
if(t_argc > 1) speed = intvalue(t_argv[1]);
|
|
|
|
else speed = 1; // 1= normal speed
|
|
|
|
|
|
|
|
EV_DoDoor(DDoor::doorClose,NULL,NULL,sectag,2*FRACUNIT*clamp(speed,1,127),0,0,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// run console cmd
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_RunCommand(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
FS_EmulateCmd(GetFormatString(0).LockBuffer());
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
// any linedef type
|
|
|
|
extern void P_TranslateLineDef (line_t *ld, maplinedef_t *mld);
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_LineTrigger()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
line_t line;
|
|
|
|
maplinedef_t mld;
|
|
|
|
mld.special=intvalue(t_argv[0]);
|
|
|
|
mld.tag=t_argc > 1 ? intvalue(t_argv[1]) : 0;
|
|
|
|
P_TranslateLineDef(&line, &mld);
|
2008-02-24 23:36:07 +00:00
|
|
|
LineSpecials[line.special](NULL, Script->trigger, false,
|
2008-01-27 11:25:03 +00:00
|
|
|
line.args[0],line.args[1],line.args[2],line.args[3],line.args[4]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-23 21:12:27 +00:00
|
|
|
bool FS_ChangeMusic(const char * string)
|
|
|
|
{
|
|
|
|
char buffer[40];
|
|
|
|
|
|
|
|
if (Wads.CheckNumForName(string, ns_music)<0 || !S_ChangeMusic(string,true))
|
|
|
|
{
|
|
|
|
// Retry with O_ prepended to the music name, then with D_
|
2008-07-23 21:54:02 +00:00
|
|
|
mysnprintf(buffer, countof(buffer), "O_%s", string);
|
2008-02-23 21:12:27 +00:00
|
|
|
if (Wads.CheckNumForName(buffer, ns_music)<0 || !S_ChangeMusic(buffer,true))
|
|
|
|
{
|
2008-07-23 19:29:18 +00:00
|
|
|
mysnprintf(buffer, countof(buffer), "D_%s", string);
|
2008-02-23 21:12:27 +00:00
|
|
|
if (Wads.CheckNumForName(buffer, ns_music)<0)
|
|
|
|
{
|
|
|
|
S_ChangeMusic(NULL, 0);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else S_ChangeMusic(buffer,true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ChangeMusic(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
FS_ChangeMusic(stringvalue(t_argv[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FParser::SF_SetLineBlocking()
|
|
|
|
//
|
|
|
|
// Sets a line blocking or unblocking
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetLineBlocking(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
static unsigned short blocks[]={0,ML_BLOCKING,ML_BLOCKEVERYTHING};
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
int blocking=intvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (blocking>=0 && blocking<=2)
|
|
|
|
{
|
|
|
|
blocking=blocks[blocking];
|
2008-05-17 08:47:26 +00:00
|
|
|
int tag=intvalue(t_argv[0]);
|
|
|
|
for (int i = -1; (i = P_FindLineFromID(tag, i)) >= 0;)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
lines[i].flags = (lines[i].flags & ~(ML_BLOCKING|ML_BLOCKEVERYTHING)) | blocking;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// similar, but monster blocking
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetLineMonsterBlocking(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
int blocking = intvalue(t_argv[1]) ? ML_BLOCKMONSTERS : 0;
|
|
|
|
int tag=intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
for (int i = -1; (i = P_FindLineFromID(tag, i)) >= 0;)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
lines[i].flags = (lines[i].flags & ~ML_BLOCKMONSTERS) | blocking;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//FParser::SF_SetLineTexture
|
|
|
|
//
|
|
|
|
// #2 in a not-so-long line of ACS-inspired functions
|
|
|
|
// This one is *much* needed, IMO
|
|
|
|
//
|
|
|
|
// Eternity: setlinetexture(tag, side, position, texture)
|
|
|
|
// Legacy: setlinetexture(tag, texture, side, sections)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetLineTexture(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tag;
|
|
|
|
int side;
|
|
|
|
int position;
|
|
|
|
const char *texture;
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID texturenum;
|
2008-05-17 08:47:26 +00:00
|
|
|
int i;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(4))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tag = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// the eternity version
|
|
|
|
if (t_argv[3].type==svt_string)
|
|
|
|
{
|
|
|
|
side = intvalue(t_argv[1]);
|
|
|
|
if(side < 0 || side > 1)
|
|
|
|
{
|
|
|
|
script_error("invalid side number for texture change\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
position = intvalue(t_argv[2]);
|
|
|
|
if(position < 1 || position > 3)
|
|
|
|
{
|
|
|
|
script_error("invalid position for texture change\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
position=3-position;
|
|
|
|
|
|
|
|
texture = stringvalue(t_argv[3]);
|
|
|
|
texturenum = TexMan.GetTexture(texture, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
|
|
|
|
|
2008-05-17 08:47:26 +00:00
|
|
|
for (i = -1; (i = P_FindLineFromID(tag, i)) >= 0;)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// bad sidedef, Hexen just SEGV'd here!
|
2008-05-17 08:47:26 +00:00
|
|
|
if(lines[i].sidenum[side] != NO_SIDE)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-05-17 08:47:26 +00:00
|
|
|
side_t * sided = &sides[lines[i].sidenum[side]];
|
2008-03-21 21:15:56 +00:00
|
|
|
if (position >=0 && position <=2)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-03-21 21:15:56 +00:00
|
|
|
sided->SetTexture(position, texturenum);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // and an improved legacy version
|
|
|
|
{
|
2008-06-28 13:29:59 +00:00
|
|
|
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
|
2008-01-27 11:25:03 +00:00
|
|
|
side = !!intvalue(t_argv[2]);
|
|
|
|
int sections = intvalue(t_argv[3]);
|
|
|
|
|
|
|
|
// set all sectors with tag
|
2008-05-17 08:47:26 +00:00
|
|
|
for (i = -1; (i = P_FindLineFromID(tag, i)) >= 0;)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(lines[i].sidenum[side]!=NO_SIDE)
|
|
|
|
{
|
|
|
|
side_t * sided=&sides[lines[i].sidenum[side]];
|
|
|
|
|
2008-03-21 21:15:56 +00:00
|
|
|
if(sections & 1) sided->SetTexture(side_t::top, picnum);
|
|
|
|
if(sections & 2) sided->SetTexture(side_t::mid, picnum);
|
|
|
|
if(sections & 4) sided->SetTexture(side_t::bottom, picnum);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// SoM: Max, Min, Abs math functions.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Max(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t n1, n2;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
n1 = fixedvalue(t_argv[0]);
|
|
|
|
n2 = fixedvalue(t_argv[1]);
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = (n1 > n2) ? n1 : n2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Min(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t n1, n2;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
n1 = fixedvalue(t_argv[0]);
|
|
|
|
n2 = fixedvalue(t_argv[1]);
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = (n1 < n2) ? n1 : n2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Abs(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t n1;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
n1 = fixedvalue(t_argv[0]);
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = (n1 < 0) ? -n1 : n1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FParser::SF_Gameskill, FParser::SF_Gamemode
|
|
|
|
//
|
|
|
|
// Access functions are more elegant for these than variables,
|
|
|
|
// especially for the game mode, which doesn't exist as a numeric
|
|
|
|
// variable already.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Gameskill(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = G_SkillProperty(SKILLP_ACSReturn) + 1; // +1 for the user skill value
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Gamemode(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
if(!multiplayer)
|
|
|
|
{
|
|
|
|
t_return.value.i = 0; // single-player
|
|
|
|
}
|
|
|
|
else if(!deathmatch)
|
|
|
|
{
|
|
|
|
t_return.value.i = 1; // cooperative
|
|
|
|
}
|
|
|
|
else
|
|
|
|
t_return.value.i = 2; // deathmatch
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FParser::SF_IsPlayerObj()
|
|
|
|
//
|
|
|
|
// A function suggested by SoM to help the script coder prevent
|
|
|
|
// exceptions related to calling player functions on non-player
|
|
|
|
// objects.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_IsPlayerObj(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
2008-01-27 11:25:03 +00:00
|
|
|
AActor *mo;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if(t_argc)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = (mo && mo->player) ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// Inventory stuff - mostly new to GZDoom
|
|
|
|
//
|
|
|
|
// all the original functions are still supported but they have not
|
|
|
|
// been expanded from their original and are limited as a result
|
|
|
|
//
|
2008-02-23 21:12:27 +00:00
|
|
|
// Since FraggleScript is rather hard coded to the original inventory
|
2008-05-17 08:47:26 +00:00
|
|
|
// handling of Doom this is quite messy.
|
2008-02-23 21:12:27 +00:00
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// DoGiveInv
|
|
|
|
//
|
|
|
|
// Gives an item to a single actor.
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
static void FS_GiveInventory (AActor *actor, const char * type, int amount)
|
|
|
|
{
|
|
|
|
if (amount <= 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (strcmp (type, "Armor") == 0)
|
|
|
|
{
|
|
|
|
type = "BasicArmorPickup";
|
|
|
|
}
|
|
|
|
const PClass * info = PClass::FindClass (type);
|
|
|
|
if (info == NULL || !info->IsDescendantOf (RUNTIME_CLASS(AInventory)))
|
|
|
|
{
|
|
|
|
Printf ("Unknown inventory item: %s\n", type);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
AWeapon *savedPendingWeap = actor->player != NULL? actor->player->PendingWeapon : NULL;
|
|
|
|
bool hadweap = actor->player != NULL ? actor->player->ReadyWeapon != NULL : true;
|
|
|
|
|
|
|
|
AInventory *item = static_cast<AInventory *>(Spawn (info, 0,0,0, NO_REPLACE));
|
|
|
|
|
|
|
|
// This shouldn't count for the item statistics!
|
|
|
|
if (item->flags&MF_COUNTITEM)
|
|
|
|
{
|
|
|
|
level.total_items--;
|
|
|
|
item->flags&=~MF_COUNTITEM;
|
|
|
|
}
|
|
|
|
if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup)) ||
|
|
|
|
info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus)))
|
|
|
|
{
|
|
|
|
static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->Amount = amount;
|
|
|
|
}
|
Update to ZDoom r1222
- Moved IF_ALWAYSPICKUP and GiveQuest into CallTryPickup so that they are
automatically used by all inventory classes.
- The previous change made it necessary to replace all TryPickup calls with
another function that just calls TryPickup.
- Fixed: AInventory::TryPickup can change the toucher so this must be reported
to subclasses calling the super function. Changed TryPickup to pass the
toucher pointer by reference.
- Prefixed all names of CQ decorations with Chex after seeing some conflicts
with PWADs.
- Removed Chex Quest actors that were just unaltered duplicates of Doom's.
- Added detection for Chex Quest 3 IWAD.
- Cleaned up M_QuitGame because the code was almost incomprehensible and I
wanted to add CQ3's new quit messages.
- Added Chex Quest obituaries and a few other messages from CQ3.
- Fixed: drawbar improperly clipped images when not in the top left quadrant.
- Fixed: Crouching no longer worked due to a bug introduced by the
player input code.
- Added GetPlayerInput() for examining a player's inputs from ACS. Most
buttons are now passed across the network, and there are four new user
buttons specifically for use with this command. Also defined +zoom
and +reload for future implementation.
- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound,
and when they were fully assembled, they did not play the sound across the
entire level.
- Antialiasing of lines is now controlled solely by the vid_hwaalines cvar,
ignoring what the driver reports, since ATI is apparently just as bad as
NVidia.
- Added a check for D3DLINECAPS_ANTIALIAS, but this is complicated by the
fact that NVidia's don't report it, even though they support it. If there
are any cards that no longer have antialised lines on the automap, please
let me know.
- Added vid_hwaalines cvar to force antialiased lines off for the
Direct3D renderer, in case it doesn't really support them.
- Fixed: The new rolloff values being stored in FSoundChan need to be serialized
for savegames.
- Since loading of the sound lump is now done in S_LoadSound I added an IsNull
method to the SoundRenderer class so that this function doesn't need to
load the sound for the NullSoundRenderer.
- Took some more non-FMOD related code out of fmodsound.cpp, including the
code that checks for raw and Doom sounds. This means that sfxinfo_t is no
longer needed in the SoundRenderer class so I took out all references to it.
- Fixed: FMODSoundRenderer::StartSound3D must set the static variable pointing
to the rolloff information back to NULL when starting the sound fails.
- Fixed: Rolloff information was taken from the sfxinfo that contained the
actual sound data, not the one that was used for starting the sound.
- Fixed: Chex Quest's Super Bootspork was missing the pickup message.
- Added missing Strife automap colors for items and non-monsters.
- Fixed: GetMSLength didn't resolve random and player sounds.
- Moved sound aliasing code out of fmodsound.cpp into S_LoadSound.
- Fixed: The tagged version of TranslucentLine took the information for additive
translucency from the tagged linedef, not the control linedef.
- Added check for additive translucency to TRANMAP checking.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@175 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-14 07:03:28 +00:00
|
|
|
if (!item->CallTryPickup (actor))
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
item->Destroy ();
|
|
|
|
}
|
|
|
|
// If the item was a weapon, don't bring it up automatically
|
|
|
|
// unless the player was not already using a weapon.
|
|
|
|
if (savedPendingWeap != NULL && hadweap)
|
|
|
|
{
|
|
|
|
actor->player->PendingWeapon = savedPendingWeap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// DoTakeInv
|
|
|
|
//
|
|
|
|
// Takes an item from a single actor.
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
static void FS_TakeInventory (AActor *actor, const char * type, int amount)
|
|
|
|
{
|
|
|
|
if (strcmp (type, "Armor") == 0)
|
|
|
|
{
|
|
|
|
type = "BasicArmor";
|
|
|
|
}
|
|
|
|
if (amount <= 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const PClass * info = PClass::FindClass (type);
|
|
|
|
if (info == NULL)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
AInventory *item = actor->FindInventory (info);
|
|
|
|
if (item != NULL)
|
|
|
|
{
|
|
|
|
item->Amount -= amount;
|
|
|
|
if (item->Amount <= 0)
|
|
|
|
{
|
|
|
|
// If it's not ammo, destroy it. Ammo needs to stick around, even
|
|
|
|
// when it's zero for the benefit of the weapons that use it and
|
|
|
|
// to maintain the maximum ammo amounts a backpack might have given.
|
|
|
|
if (item->GetClass()->ParentClass != RUNTIME_CLASS(AAmmo))
|
|
|
|
{
|
|
|
|
item->Destroy ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->Amount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// CheckInventory
|
|
|
|
//
|
|
|
|
// Returns how much of a particular item an actor has.
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
static int FS_CheckInventory (AActor *activator, const char *type)
|
|
|
|
{
|
|
|
|
if (activator == NULL)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (strcmp (type, "Armor") == 0)
|
|
|
|
{
|
|
|
|
type = "BasicArmor";
|
|
|
|
}
|
|
|
|
else if (strcmp (type, "Health") == 0)
|
|
|
|
{
|
|
|
|
return activator->health;
|
|
|
|
}
|
|
|
|
|
|
|
|
const PClass *info = PClass::FindClass (type);
|
|
|
|
AInventory *item = activator->FindInventory (info);
|
|
|
|
return item ? item->Amount : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// This function is just kept for backwards compatibility
|
|
|
|
// and intentionally limited to thr standard keys!
|
|
|
|
// Use Give/Take/CheckInventory instead!
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerKeys(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
static const char * const DoomKeys[]={"BlueCard", "YellowCard", "RedCard", "BlueSkull", "YellowSkull", "RedSkull"};
|
|
|
|
int playernum, keynum, givetake;
|
|
|
|
const char * keyname;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
|
|
|
|
keynum = intvalue(t_argv[1]);
|
|
|
|
if(keynum < 0 || keynum >= 6)
|
|
|
|
{
|
|
|
|
script_error("key number out of range: %i\n", keynum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
keyname=DoomKeys[keynum];
|
|
|
|
|
|
|
|
if(t_argc == 2)
|
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = FS_CheckInventory(players[playernum].mo, keyname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
givetake = intvalue(t_argv[2]);
|
|
|
|
if(givetake) FS_GiveInventory(players[playernum].mo, keyname, 1);
|
|
|
|
else FS_TakeInventory(players[playernum].mo, keyname, 1);
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// This function is just kept for backwards compatibility and intentionally limited!
|
|
|
|
// Use Give/Take/CheckInventory instead!
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerAmmo(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum, amount;
|
|
|
|
const PClass * ammotype;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
|
|
|
|
ammotype=T_GetAmmo(t_argv[1]);
|
|
|
|
if (!ammotype) return;
|
|
|
|
|
|
|
|
if(t_argc >= 3)
|
|
|
|
{
|
|
|
|
AInventory * iammo = players[playernum].mo->FindInventory(ammotype);
|
|
|
|
amount = intvalue(t_argv[2]);
|
|
|
|
if(amount < 0) amount = 0;
|
|
|
|
if (iammo) iammo->Amount = amount;
|
|
|
|
else players[playernum].mo->GiveAmmo(ammotype, amount);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
AInventory * iammo = players[playernum].mo->FindInventory(ammotype);
|
|
|
|
if (iammo) t_return.value.i = iammo->Amount;
|
|
|
|
else t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MaxPlayerAmmo()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum, amount;
|
|
|
|
const PClass * ammotype;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
|
|
|
|
ammotype=T_GetAmmo(t_argv[1]);
|
|
|
|
if (!ammotype) return;
|
|
|
|
|
|
|
|
if(t_argc == 2)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else if(t_argc >= 3)
|
|
|
|
{
|
|
|
|
AAmmo * iammo = (AAmmo*)players[playernum].mo->FindInventory(ammotype);
|
|
|
|
amount = intvalue(t_argv[2]);
|
|
|
|
if(amount < 0) amount = 0;
|
|
|
|
if (!iammo)
|
|
|
|
{
|
|
|
|
iammo = static_cast<AAmmo *>(Spawn (ammotype, 0, 0, 0, NO_REPLACE));
|
|
|
|
iammo->Amount = 0;
|
|
|
|
iammo->AttachToOwner (players[playernum].mo);
|
|
|
|
}
|
|
|
|
iammo->MaxAmount = amount;
|
|
|
|
|
|
|
|
|
|
|
|
for (AInventory *item = players[playernum].mo->Inventory; item != NULL; item = item->Inventory)
|
|
|
|
{
|
|
|
|
if (item->IsKindOf(RUNTIME_CLASS(ABackpackItem)))
|
|
|
|
{
|
|
|
|
if (t_argc>=4) amount = intvalue(t_argv[3]);
|
|
|
|
else amount*=2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iammo->BackpackMaxAmount=amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
AInventory * iammo = players[playernum].mo->FindInventory(ammotype);
|
|
|
|
if (iammo) t_return.value.i = iammo->MaxAmount;
|
|
|
|
else t_return.value.i = ((AAmmo*)GetDefaultByType(ammotype))->MaxAmount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// This function is just kept for backwards compatibility and
|
|
|
|
// intentionally limited to the standard weapons!
|
|
|
|
// Use Give/Take/CheckInventory instead!
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerWeapon()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
static const char * const WeaponNames[]={
|
|
|
|
"Fist", "Pistol", "Shotgun", "Chaingun", "RocketLauncher",
|
|
|
|
"PlasmaRifle", "BFG9000", "Chainsaw", "SuperShotgun" };
|
|
|
|
|
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
int playernum;
|
|
|
|
int weaponnum;
|
|
|
|
int newweapon;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
weaponnum = intvalue(t_argv[1]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
if (weaponnum<0 || weaponnum>9)
|
|
|
|
{
|
|
|
|
script_error("weaponnum out of range! %s\n", weaponnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const PClass * ti = PClass::FindClass(WeaponNames[weaponnum]);
|
|
|
|
if (!ti)
|
|
|
|
{
|
|
|
|
script_error("incompatibility in playerweapon\n", weaponnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (t_argc == 2)
|
|
|
|
{
|
|
|
|
AActor * wp = players[playernum].mo->FindInventory(ti);
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = wp!=NULL;;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AActor * wp = players[playernum].mo->FindInventory(ti);
|
|
|
|
|
|
|
|
newweapon = !!intvalue(t_argv[2]);
|
|
|
|
if (!newweapon)
|
|
|
|
{
|
|
|
|
if (wp)
|
|
|
|
{
|
|
|
|
wp->Destroy();
|
|
|
|
// If the weapon is active pick a replacement. Legacy didn't do this!
|
|
|
|
if (players[playernum].PendingWeapon==wp) players[playernum].PendingWeapon=WP_NOCHANGE;
|
|
|
|
if (players[playernum].ReadyWeapon==wp)
|
|
|
|
{
|
|
|
|
players[playernum].ReadyWeapon=NULL;
|
|
|
|
players[playernum].mo->PickNewWeapon(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!wp)
|
|
|
|
{
|
|
|
|
AWeapon * pw=players[playernum].PendingWeapon;
|
|
|
|
players[playernum].mo->GiveInventoryType(ti);
|
|
|
|
players[playernum].PendingWeapon=pw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = !!newweapon;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// This function is just kept for backwards compatibility and
|
|
|
|
// intentionally limited to the standard weapons!
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerSelectedWeapon()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum;
|
|
|
|
int weaponnum;
|
|
|
|
|
|
|
|
|
|
|
|
static const char * const WeaponNames[]={
|
|
|
|
"Fist", "Pistol", "Shotgun", "Chaingun", "RocketLauncher",
|
|
|
|
"PlasmaRifle", "BFG9000", "Chainsaw", "SuperShotgun" };
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
|
|
|
|
if(t_argc == 2)
|
|
|
|
{
|
|
|
|
weaponnum = intvalue(t_argv[1]);
|
|
|
|
|
|
|
|
if (weaponnum<0 || weaponnum>=9)
|
|
|
|
{
|
|
|
|
script_error("weaponnum out of range! %s\n", weaponnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const PClass * ti = PClass::FindClass(WeaponNames[weaponnum]);
|
|
|
|
if (!ti)
|
|
|
|
{
|
|
|
|
script_error("incompatibility in playerweapon\n", weaponnum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
players[playernum].PendingWeapon = (AWeapon*)players[playernum].mo->FindInventory(ti);
|
|
|
|
|
|
|
|
}
|
|
|
|
t_return.type = svt_int;
|
|
|
|
for(int i=0;i<9;i++)
|
|
|
|
{
|
|
|
|
if (players[playernum].ReadyWeapon->GetClass ()->TypeName == FName(WeaponNames[i]))
|
|
|
|
{
|
|
|
|
t_return.value.i=i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-05-17 08:47:26 +00:00
|
|
|
// new for GZDoom: named inventory handling
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_GiveInventory(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum, count;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
|
|
|
|
if(t_argc == 2) count=1;
|
|
|
|
else count=intvalue(t_argv[2]);
|
|
|
|
FS_GiveInventory(players[playernum].mo, stringvalue(t_argv[1]), count);
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-05-17 08:47:26 +00:00
|
|
|
// new for GZDoom: named inventory handling
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_TakeInventory(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum, count;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1) return;
|
|
|
|
|
|
|
|
if(t_argc == 2) count=32767;
|
|
|
|
else count=intvalue(t_argv[2]);
|
|
|
|
FS_TakeInventory(players[playernum].mo, stringvalue(t_argv[1]), count);
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-05-17 08:47:26 +00:00
|
|
|
// new for GZDoom: named inventory handling
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_CheckInventory(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum==-1)
|
|
|
|
{
|
|
|
|
t_return.value.i = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = FS_CheckInventory(players[playernum].mo, stringvalue(t_argv[1]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetWeapon()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum=T_GetPlayerNum(t_argv[0]);
|
|
|
|
if (playernum!=-1)
|
|
|
|
{
|
|
|
|
AInventory *item = players[playernum].mo->FindInventory (PClass::FindClass (stringvalue(t_argv[1])));
|
|
|
|
|
|
|
|
if (item == NULL || !item->IsKindOf (RUNTIME_CLASS(AWeapon)))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else if (players[playernum].ReadyWeapon == item)
|
|
|
|
{
|
|
|
|
// The weapon is already selected, so setweapon succeeds by default,
|
|
|
|
// but make sure the player isn't switching away from it.
|
|
|
|
players[playernum].PendingWeapon = WP_NOCHANGE;
|
|
|
|
t_return.value.i = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AWeapon *weap = static_cast<AWeapon *> (item);
|
|
|
|
|
|
|
|
if (weap->CheckAmmo (AWeapon::EitherFire, false))
|
|
|
|
{
|
|
|
|
// There's enough ammo, so switch to it.
|
|
|
|
t_return.value.i = 1;
|
|
|
|
players[playernum].PendingWeapon = weap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// movecamera(camera, targetobj, targetheight, movespeed, targetangle, anglespeed)
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MoveCamera(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t x, y, z;
|
|
|
|
fixed_t xdist, ydist, zdist, xydist, movespeed;
|
|
|
|
fixed_t xstep, ystep, zstep, targetheight;
|
|
|
|
angle_t anglespeed, anglestep, angledist, targetangle,
|
|
|
|
mobjangle, bigangle, smallangle;
|
|
|
|
|
|
|
|
// I have to use floats for the math where angles are divided
|
|
|
|
// by fixed values.
|
|
|
|
double fangledist, fanglestep, fmovestep;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
int angledir;
|
2008-01-27 11:25:03 +00:00
|
|
|
AActor* target;
|
|
|
|
int moved;
|
|
|
|
int quad1, quad2;
|
|
|
|
AActor * cam;
|
|
|
|
|
|
|
|
angledir = moved = 0;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(6))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
cam = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
target = actorvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(!cam || !target)
|
|
|
|
{
|
|
|
|
script_error("invalid target for camera\n"); return;
|
|
|
|
}
|
|
|
|
|
|
|
|
targetheight = fixedvalue(t_argv[2]);
|
|
|
|
movespeed = fixedvalue(t_argv[3]);
|
|
|
|
targetangle = (angle_t)FixedToAngle(fixedvalue(t_argv[4]));
|
|
|
|
anglespeed = (angle_t)FixedToAngle(fixedvalue(t_argv[5]));
|
|
|
|
|
|
|
|
// figure out how big one step will be
|
|
|
|
xdist = target->x - cam->x;
|
|
|
|
ydist = target->y - cam->y;
|
|
|
|
zdist = targetheight - cam->z;
|
|
|
|
|
|
|
|
// Angle checking...
|
|
|
|
// 90
|
|
|
|
// Q1|Q0
|
|
|
|
//180--+--0
|
|
|
|
// Q2|Q3
|
|
|
|
// 270
|
|
|
|
quad1 = targetangle / ANG90;
|
|
|
|
quad2 = cam->angle / ANG90;
|
|
|
|
bigangle = targetangle > cam->angle ? targetangle : cam->angle;
|
|
|
|
smallangle = targetangle < cam->angle ? targetangle : cam->angle;
|
|
|
|
if((quad1 > quad2 && quad1 - 1 == quad2) || (quad2 > quad1 && quad2 - 1 == quad1) ||
|
|
|
|
quad1 == quad2)
|
|
|
|
{
|
|
|
|
angledist = bigangle - smallangle;
|
|
|
|
angledir = targetangle > cam->angle ? 1 : -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
angle_t diff180 = (bigangle + ANG180) - (smallangle + ANG180);
|
|
|
|
|
|
|
|
if(quad2 == 3 && quad1 == 0)
|
|
|
|
{
|
|
|
|
angledist = diff180;
|
|
|
|
angledir = 1;
|
|
|
|
}
|
|
|
|
else if(quad1 == 3 && quad2 == 0)
|
|
|
|
{
|
|
|
|
angledist = diff180;
|
|
|
|
angledir = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
angledist = bigangle - smallangle;
|
|
|
|
if(angledist > ANG180)
|
|
|
|
{
|
|
|
|
angledist = diff180;
|
|
|
|
angledir = targetangle > cam->angle ? -1 : 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
angledir = targetangle > cam->angle ? 1 : -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// set step variables based on distance and speed
|
|
|
|
mobjangle = R_PointToAngle2(cam->x, cam->y, target->x, target->y);
|
|
|
|
xydist = R_PointToDist2(target->x - cam->x, target->y - cam->y);
|
|
|
|
|
|
|
|
xstep = FixedMul(finecosine[mobjangle >> ANGLETOFINESHIFT], movespeed);
|
|
|
|
ystep = FixedMul(finesine[mobjangle >> ANGLETOFINESHIFT], movespeed);
|
|
|
|
|
|
|
|
if(xydist && movespeed)
|
|
|
|
zstep = FixedDiv(zdist, FixedDiv(xydist, movespeed));
|
|
|
|
else
|
|
|
|
zstep = zdist > 0 ? movespeed : -movespeed;
|
|
|
|
|
|
|
|
if(xydist && movespeed && !anglespeed)
|
|
|
|
{
|
|
|
|
fangledist = ((double)angledist / (ANG45/45));
|
|
|
|
fmovestep = ((double)FixedDiv(xydist, movespeed) / FRACUNIT);
|
|
|
|
if(fmovestep)
|
|
|
|
fanglestep = fangledist / fmovestep;
|
|
|
|
else
|
|
|
|
fanglestep = 360;
|
|
|
|
|
|
|
|
anglestep =(angle_t) (fanglestep * (ANG45/45));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
anglestep = anglespeed;
|
|
|
|
|
|
|
|
if(abs(xstep) >= (abs(xdist) - 1))
|
|
|
|
x = target->x;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = cam->x + xstep;
|
|
|
|
moved = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(abs(ystep) >= (abs(ydist) - 1))
|
|
|
|
y = target->y;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
y = cam->y + ystep;
|
|
|
|
moved = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(abs(zstep) >= (abs(zdist) - 1))
|
|
|
|
z = targetheight;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
z = cam->z + zstep;
|
|
|
|
moved = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(anglestep >= angledist)
|
|
|
|
cam->angle = targetangle;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(angledir == 1)
|
|
|
|
{
|
|
|
|
cam->angle += anglestep;
|
|
|
|
moved = 1;
|
|
|
|
}
|
|
|
|
else if(angledir == -1)
|
|
|
|
{
|
|
|
|
cam->angle -= anglestep;
|
|
|
|
moved = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cam->radius=8;
|
|
|
|
cam->height=8;
|
|
|
|
if ((x != cam->x || y != cam->y) && !P_TryMove(cam, x, y, true))
|
|
|
|
{
|
|
|
|
Printf("Illegal camera move to (%f, %f)\n", x/65536.f, y/65536.f);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cam->z = z;
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = moved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_ObjAwaken
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Implements: void objawaken([mobj mo])
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjAwaken(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if(mo)
|
|
|
|
{
|
|
|
|
mo->Activate(Script->trigger);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_AmbientSound
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Implements: void ambientsound(string name)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_AmbientSound(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound(CHAN_AUTO, T_FindSound(stringvalue(t_argv[0])), 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
// FParser::SF_ExitSecret
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Implements: void exitsecret()
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ExitSecret(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-28 10:40:46 +00:00
|
|
|
G_SecretExitLevel(0);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
// Type forcing functions -- useful with arrays et al
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjValue(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_mobj;
|
2008-02-24 23:36:07 +00:00
|
|
|
t_return.value.mobj = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_StringValue(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_string;
|
2008-02-25 08:44:31 +00:00
|
|
|
if (t_argv[0].type == svt_string)
|
|
|
|
{
|
|
|
|
t_return.string = t_argv[0].string;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t_return.string = stringvalue(t_argv[0]);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_IntValue(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_FixedValue(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = fixedvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Starting here are functions present in Legacy but not Eternity.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SpawnExplosion()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
fixed_t x, y, z;
|
|
|
|
AActor* spawn;
|
|
|
|
const PClass * PClass;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (!(PClass=T_GetMobjType(t_argv[0]))) return;
|
|
|
|
|
|
|
|
x = fixedvalue(t_argv[1]);
|
|
|
|
y = fixedvalue(t_argv[2]);
|
|
|
|
if(t_argc > 3)
|
|
|
|
z = fixedvalue(t_argv[3]);
|
|
|
|
else
|
|
|
|
z = P_PointInSector(x, y)->floorplane.ZatPoint(x,y);
|
|
|
|
|
|
|
|
spawn = Spawn (PClass, x, y, z, ALLOW_REPLACE);
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i=0;
|
|
|
|
if (spawn)
|
|
|
|
{
|
|
|
|
if (spawn->flags&MF_COUNTKILL) level.total_monsters--;
|
|
|
|
if (spawn->flags&MF_COUNTITEM) level.total_items--;
|
|
|
|
spawn->flags&=~(MF_COUNTKILL|MF_COUNTITEM);
|
|
|
|
t_return.value.i = spawn->SetState(spawn->FindState(NAME_Death));
|
2008-06-15 17:17:31 +00:00
|
|
|
if(spawn->DeathSound) S_Sound (spawn, CHAN_BODY, spawn->DeathSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_RadiusAttack()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *spot;
|
|
|
|
AActor *source;
|
|
|
|
int damage;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
spot = actorvalue(t_argv[0]);
|
|
|
|
source = actorvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
damage = intvalue(t_argv[2]);
|
|
|
|
|
|
|
|
if (spot && source)
|
|
|
|
{
|
|
|
|
P_RadiusAttack(spot, source, damage, damage, NAME_None, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetObjPosition()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mobj;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mobj = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (!mobj) return;
|
|
|
|
|
|
|
|
mobj->UnlinkFromWorld();
|
|
|
|
|
|
|
|
mobj->x = intvalue(t_argv[1]) << FRACBITS;
|
|
|
|
if(t_argc >= 3) mobj->y = intvalue(t_argv[2]) << FRACBITS;
|
|
|
|
if(t_argc == 4) mobj->z = intvalue(t_argv[3]) << FRACBITS;
|
|
|
|
|
|
|
|
mobj->LinkToWorld();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_TestLocation()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (mo)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.f = !!P_TestMobjLocation(mo);
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_HealObj() //no pain sound
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if(t_argc < 2)
|
|
|
|
{
|
|
|
|
mo->health = mo->GetDefault()->health;
|
|
|
|
if(mo->player) mo->player->health = mo->health;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (t_argc == 2)
|
|
|
|
{
|
|
|
|
mo->health += intvalue(t_argv[1]);
|
|
|
|
if(mo->player) mo->player->health = mo->health;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
script_error("invalid number of arguments for objheal");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjDead()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// use trigger object if not specified
|
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
t_return.type = svt_int;
|
|
|
|
if(mo && (mo->health <= 0 || mo->flags&MF_CORPSE))
|
|
|
|
t_return.value.i = 1;
|
|
|
|
else
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SpawnMissile()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *mobj;
|
|
|
|
AActor *target;
|
2008-01-27 11:25:03 +00:00
|
|
|
const PClass * PClass;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (!(PClass=T_GetMobjType(t_argv[2]))) return;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
mobj = actorvalue(t_argv[0]);
|
|
|
|
target = actorvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if (mobj && target) P_SpawnMissile(mobj, target, PClass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//checks to see if a Map Thing Number exists; used to avoid script errors
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MapThingNumExist()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
int intval;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
intval = intvalue(t_argv[0]);
|
|
|
|
|
2008-03-12 15:21:17 +00:00
|
|
|
if (intval < 0 || intval >= int(SpawnedThings.Size()) || !SpawnedThings[intval])
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MapThings()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
t_return.type = svt_int;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
t_return.value.i = SpawnedThings.Size();
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjState()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int state;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *mo = NULL;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc == 1)
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = Script->trigger;
|
2008-01-27 11:25:03 +00:00
|
|
|
state = intvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(t_argc == 2)
|
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
state = intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mo)
|
|
|
|
{
|
|
|
|
static ENamedName statenames[]= {
|
|
|
|
NAME_Spawn, NAME_See, NAME_Missile, NAME_Melee,
|
|
|
|
NAME_Pain, NAME_Death, NAME_Raise, NAME_XDeath, NAME_Crash };
|
|
|
|
|
|
|
|
if (state <1 || state > 9)
|
|
|
|
{
|
|
|
|
script_error("objstate: invalid state");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = mo->SetState(mo->FindState(statenames[state]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-05-17 08:47:26 +00:00
|
|
|
// only here for Legacy maps. The implementation of this function
|
|
|
|
// is completely useless.
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_LineFlag()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
line_t* line;
|
|
|
|
int linenum;
|
|
|
|
int flagnum;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
linenum = intvalue(t_argv[0]);
|
|
|
|
if(linenum < 0 || linenum > numlines)
|
|
|
|
{
|
|
|
|
script_error("LineFlag: Invalid line number.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
line = lines + linenum;
|
|
|
|
|
|
|
|
flagnum = intvalue(t_argv[1]);
|
|
|
|
if(flagnum < 0 || (flagnum > 8 && flagnum!=15))
|
|
|
|
{
|
|
|
|
script_error("LineFlag: Invalid flag number.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(t_argc > 2)
|
|
|
|
{
|
|
|
|
line->flags &= ~(1 << flagnum);
|
|
|
|
if(intvalue(t_argv[2]))
|
|
|
|
line->flags |= (1 << flagnum);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = line->flags & (1 << flagnum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayerAddFrag()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int playernum1;
|
|
|
|
int playernum2;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (t_argc == 1)
|
|
|
|
{
|
|
|
|
playernum1 = T_GetPlayerNum(t_argv[0]);
|
|
|
|
|
|
|
|
players[playernum1].fragcount++;
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.f = players[playernum1].fragcount;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
playernum1 = T_GetPlayerNum(t_argv[0]);
|
|
|
|
playernum2 = T_GetPlayerNum(t_argv[1]);
|
|
|
|
|
|
|
|
players[playernum1].frags[playernum2]++;
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.f = players[playernum1].frags[playernum2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SkinColor()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Ignoring it for now.
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_PlayDemo()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Ignoring it for now.
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_CheckCVar()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// can't be done so return 0.
|
|
|
|
}
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Resurrect()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
FState * state = mo->FindState(NAME_Raise);
|
|
|
|
if (!state) //Don't resurrect things that can't be resurrected
|
|
|
|
return;
|
|
|
|
|
|
|
|
mo->SetState(state);
|
|
|
|
mo->height = mo->GetDefault()->height;
|
|
|
|
mo->radius = mo->GetDefault()->radius;
|
|
|
|
mo->flags = mo->GetDefault()->flags;
|
|
|
|
mo->flags2 = mo->GetDefault()->flags2;
|
2008-05-17 08:47:26 +00:00
|
|
|
mo->flags3 = mo->GetDefault()->flags3;
|
|
|
|
mo->flags4 = mo->GetDefault()->flags4;
|
|
|
|
mo->flags5 = mo->GetDefault()->flags5;
|
2008-01-27 11:25:03 +00:00
|
|
|
mo->health = mo->GetDefault()->health;
|
|
|
|
mo->target = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_LineAttack()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
int damage, angle, slope;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
damage = intvalue(t_argv[2]);
|
|
|
|
|
|
|
|
angle = (intvalue(t_argv[1]) * (ANG45 / 45));
|
|
|
|
slope = P_AimLineAttack(mo, angle, MISSILERANGE);
|
|
|
|
|
|
|
|
P_LineAttack(mo, angle, MISSILERANGE, slope, damage, NAME_None, NAME_BulletPuff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// This is a lousy hack. It only works for the standard actors
|
|
|
|
// and it is quite inefficient.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ObjType()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// use trigger object if not specified
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
AActor *mo;
|
|
|
|
if(t_argc)
|
|
|
|
{
|
|
|
|
mo = actorvalue(t_argv[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo = Script->trigger;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-25 08:44:31 +00:00
|
|
|
for(unsigned int i=0;i<countof(ActorTypes);i++) if (mo->GetClass() == ActorTypes[i])
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = i;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// some new math functions
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
inline fixed_t double2fixed(double t)
|
|
|
|
{
|
|
|
|
return (fixed_t)(t*65536.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Sin()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(sin(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ASin()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(asin(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Cos()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(cos(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ACos()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(acos(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Tan()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(tan(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ATan()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(atan(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Exp()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(exp(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Log()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(log(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Sqrt()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(sqrt(floatvalue(t_argv[0])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Floor()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = fixedvalue(t_argv[0]) & 0xffFF0000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Pow()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = double2fixed(pow(floatvalue(t_argv[0]), floatvalue(t_argv[1])));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// HUD pics (not operational yet!)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
|
2008-06-28 13:29:59 +00:00
|
|
|
int HU_GetFSPic(FTextureID lumpnum, int xpos, int ypos);
|
2008-01-27 11:25:03 +00:00
|
|
|
int HU_DeleteFSPic(unsigned int handle);
|
2008-06-28 13:29:59 +00:00
|
|
|
int HU_ModifyFSPic(unsigned int handle, FTextureID lumpnum, int xpos, int ypos);
|
2008-01-27 11:25:03 +00:00
|
|
|
int HU_FSDisplay(unsigned int handle, bool newval);
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_NewHUPic()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(3))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = HU_GetFSPic(
|
|
|
|
TexMan.GetTexture(stringvalue(t_argv[0]), FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny),
|
|
|
|
intvalue(t_argv[1]), intvalue(t_argv[2]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_DeleteHUPic()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (HU_DeleteFSPic(intvalue(t_argv[0])) == -1)
|
|
|
|
script_error("deletehupic: Invalid sfpic handle: %i\n", intvalue(t_argv[0]));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ModifyHUPic()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (t_argc != 4)
|
|
|
|
{
|
|
|
|
script_error("modifyhupic: invalid number of arguments\n");
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (HU_ModifyFSPic(intvalue(t_argv[0]),
|
2008-01-27 11:25:03 +00:00
|
|
|
TexMan.GetTexture(stringvalue(t_argv[0]), FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny),
|
|
|
|
intvalue(t_argv[2]), intvalue(t_argv[3])) == -1)
|
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
script_error("modifyhypic: invalid sfpic handle %i\n", intvalue(t_argv[0]));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
return;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetHUPicDisplay()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (t_argc != 2)
|
|
|
|
{
|
|
|
|
script_error("sethupicdisplay: invalud number of arguments\n");
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
if (HU_FSDisplay(intvalue(t_argv[0]), intvalue(t_argv[1]) > 0 ? 1 : 0) == -1)
|
|
|
|
script_error("sethupicdisplay: invalid pic handle %i\n", intvalue(t_argv[0]));
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Yet to be made operational.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetCorona(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argc != 3)
|
|
|
|
{
|
|
|
|
script_error("incorrect arguments to function\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
int num = t_argv[0].value.i; // which corona we want to modify
|
|
|
|
int what = t_argv[1].value.i; // what we want to modify (type, color, offset,...)
|
|
|
|
int ival = t_argv[2].value.i; // the value of what we modify
|
|
|
|
double fval = ((double) t_argv[2].value.f / FRACUNIT);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
/*
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
switch (what)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
lspr[num].type = ival;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
lspr[num].light_xoffset = fval;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
lspr[num].light_yoffset = fval;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (t_argv[2].type == svt_string)
|
|
|
|
lspr[num].corona_color = String2Hex(t_argv[2].value.s);
|
|
|
|
else
|
|
|
|
memcpy(&lspr[num].corona_color, &ival, sizeof(int));
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
lspr[num].corona_radius = fval;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (t_argv[2].type == svt_string)
|
|
|
|
lspr[num].dynamic_color = String2Hex(t_argv[2].value.s);
|
|
|
|
else
|
|
|
|
memcpy(&lspr[num].dynamic_color, &ival, sizeof(int));
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
lspr[num].dynamic_radius = fval;
|
|
|
|
lspr[num].dynamic_sqrradius = sqrt(lspr[num].dynamic_radius);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
CONS_Printf("Error in setcorona\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*/
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// no use for this!
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Call a Hexen line special
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_Ls()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int args[5]={0,0,0,0,0};
|
|
|
|
int spc;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
spc=intvalue(t_argv[0]);
|
|
|
|
for(int i=0;i<5;i++)
|
|
|
|
{
|
|
|
|
if (t_argc>=i+2) args[i]=intvalue(t_argv[i+1]);
|
|
|
|
}
|
|
|
|
if (spc>=0 && spc<256)
|
2008-02-24 23:36:07 +00:00
|
|
|
LineSpecials[spc](NULL,Script->trigger,false, args[0],args[1],args[2],args[3],args[4]);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Gets the levelnum
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_LevelNum()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.f = level.levelnum;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjRadius(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo)
|
|
|
|
mo->radius = fixedvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = mo ? mo->radius : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_MobjHeight(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor* mo;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
mo = actorvalue(t_argv[0]);
|
2008-01-27 11:25:03 +00:00
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
if(mo)
|
|
|
|
mo->height = fixedvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_fixed;
|
|
|
|
t_return.value.f = mo ? mo->height : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ThingCount(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
const PClass *pClass;
|
|
|
|
AActor * mo;
|
|
|
|
int count=0;
|
|
|
|
bool replacemented = false;
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-25 08:44:31 +00:00
|
|
|
pClass=T_GetMobjType(t_argv[0]);
|
|
|
|
if (!pClass) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
// If we want to count map items we must consider actor replacement
|
|
|
|
pClass = pClass->ActorInfo->GetReplacement()->Class;
|
|
|
|
|
|
|
|
again:
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
|
|
|
|
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
|
|
|
{
|
2008-02-25 08:44:31 +00:00
|
|
|
while ((mo=it.Next()))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (mo->IsA(pClass))
|
|
|
|
{
|
|
|
|
if (!mo->IsKindOf (RUNTIME_CLASS(AInventory)) ||
|
|
|
|
static_cast<AInventory *>(mo)->Owner == NULL)
|
|
|
|
{
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
while ((mo=it.Next()))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (mo->IsA(pClass) && mo->health>0) count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!replacemented)
|
|
|
|
{
|
|
|
|
// Again, with decorate replacements
|
|
|
|
replacemented = true;
|
|
|
|
PClass *newkind = pClass->ActorInfo->GetReplacement()->Class;
|
|
|
|
if (newkind != pClass)
|
|
|
|
{
|
|
|
|
pClass = newkind;
|
|
|
|
goto again;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Sets a sector color
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetColor(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tagnum, secnum;
|
|
|
|
int c=2;
|
|
|
|
int i = -1;
|
|
|
|
PalEntry color=0;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(t_argc >1 && t_argc<4)
|
|
|
|
{
|
|
|
|
color=intvalue(t_argv[1]);
|
|
|
|
}
|
|
|
|
else if (t_argc>=4)
|
|
|
|
{
|
|
|
|
color.r=intvalue(t_argv[1]);
|
|
|
|
color.g=intvalue(t_argv[2]);
|
|
|
|
color.b=intvalue(t_argv[3]);
|
|
|
|
color.a=0;
|
|
|
|
}
|
|
|
|
else return;
|
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
sectors[i].ColorMap = GetSpecialLights (color, sectors[i].ColorMap->Fade, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Spawns a projectile at a map spot
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SpawnShot2(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
AActor *source = NULL;
|
|
|
|
const PClass * PClass;
|
|
|
|
int z=0;
|
|
|
|
|
|
|
|
// t_argv[0] = type to spawn
|
|
|
|
// t_argv[1] = source mobj, optional, -1 to default
|
|
|
|
// shoots at source's angle
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if(t_argv[1].type == svt_int && t_argv[1].value.i < 0)
|
2008-02-24 23:36:07 +00:00
|
|
|
source = Script->trigger;
|
2008-01-27 11:25:03 +00:00
|
|
|
else
|
2008-02-24 23:36:07 +00:00
|
|
|
source = actorvalue(t_argv[1]);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
if (t_argc>2) z=fixedvalue(t_argv[2]);
|
|
|
|
|
|
|
|
if(!source) return;
|
|
|
|
|
|
|
|
if (!(PClass=T_GetMobjType(t_argv[0]))) return;
|
|
|
|
|
|
|
|
t_return.type = svt_mobj;
|
|
|
|
|
|
|
|
AActor *mo = Spawn (PClass, source->x, source->y, source->z+z, ALLOW_REPLACE);
|
|
|
|
if (mo)
|
|
|
|
{
|
2008-06-15 17:17:31 +00:00
|
|
|
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_NORM);
|
2008-01-27 11:25:03 +00:00
|
|
|
mo->target = source;
|
|
|
|
P_ThrustMobj(mo, mo->angle = source->angle, mo->Speed);
|
|
|
|
if (!P_CheckMissileSpawn(mo)) mo = NULL;
|
|
|
|
}
|
|
|
|
t_return.value.mobj = mo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_KillInSector()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
TThinkerIterator<AActor> it;
|
|
|
|
AActor * mo;
|
|
|
|
int tag=intvalue(t_argv[0]);
|
|
|
|
|
2008-02-25 08:44:31 +00:00
|
|
|
while ((mo=it.Next()))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if (mo->flags3&MF3_ISMONSTER && mo->Sector->tag==tag) P_DamageMobj(mo, NULL, NULL, 1000000, NAME_Massacre);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Sets a sector's type
|
|
|
|
// (Sure, this is not particularly useful. But having it made it possible
|
|
|
|
// to fix a few annoying bugs in some old maps ;) )
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SectorType(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
int tagnum, secnum;
|
|
|
|
sector_t *sector;
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(1))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
tagnum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
// argv is sector tag
|
|
|
|
secnum = T_FindSectorFromTag(tagnum, -1);
|
|
|
|
|
|
|
|
if(secnum < 0)
|
|
|
|
{ script_error("sector not found with tagnum %i\n", tagnum); return;}
|
|
|
|
|
|
|
|
sector = §ors[secnum];
|
|
|
|
|
|
|
|
if(t_argc > 1)
|
|
|
|
{
|
|
|
|
int i = -1;
|
|
|
|
int spec = intvalue(t_argv[1]);
|
|
|
|
|
|
|
|
// set all sectors with tag
|
|
|
|
while ((i = T_FindSectorFromTag(tagnum, i)) >= 0)
|
|
|
|
{
|
|
|
|
sectors[i].special = spec;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = sector->special;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Sets a new line trigger type (Doom format!)
|
|
|
|
// (Sure, this is not particularly useful. But having it made it possible
|
|
|
|
// to fix a few annoying bugs in some old maps ;) )
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_SetLineTrigger()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-06-02 17:20:22 +00:00
|
|
|
int i,id,spec,tag(0);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
id=intvalue(t_argv[0]);
|
|
|
|
spec=intvalue(t_argv[1]);
|
|
|
|
if (t_argc>2) tag=intvalue(t_argv[2]);
|
|
|
|
for (i = -1; (i = P_FindLineFromID (id, i)) >= 0; )
|
|
|
|
{
|
|
|
|
if (t_argc==2) tag=lines[i].id;
|
|
|
|
maplinedef_t mld;
|
|
|
|
mld.special=spec;
|
|
|
|
mld.tag=tag;
|
|
|
|
mld.flags=0;
|
|
|
|
int f = lines[i].flags;
|
|
|
|
P_TranslateLineDef(&lines[i], &mld);
|
|
|
|
lines[i].id=tag;
|
2008-05-17 08:47:26 +00:00
|
|
|
lines[i].flags = (lines[i].flags & (ML_MONSTERSCANACTIVATE|ML_REPEAT_SPECIAL|ML_SPAC_MASK|ML_FIRSTSIDEONLY)) |
|
|
|
|
(f & ~(ML_MONSTERSCANACTIVATE|ML_REPEAT_SPECIAL|ML_SPAC_MASK|ML_FIRSTSIDEONLY));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// new for GZDoom: Changes a sector's tag
|
|
|
|
// (I only need this because MAP02 in RTC-3057 has some issues with the GL
|
|
|
|
// renderer that I can't fix without the scripts. But loading a FS on top on
|
|
|
|
// ACS still works so I can hack around it with this.)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
void FParser::SF_ChangeTag()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if (CheckArgs(2))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
for (int secnum = -1; (secnum = P_FindSectorFromTag (t_argv[0].value.i, secnum)) >= 0; )
|
|
|
|
{
|
|
|
|
sectors[secnum].tag=t_argv[1].value.i;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Recreate the hash tables
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=numsectors; --i>=0; ) sectors[i].firsttag = -1;
|
|
|
|
for (i=numsectors; --i>=0; )
|
|
|
|
{
|
|
|
|
int j = (unsigned) sectors[i].tag % (unsigned) numsectors;
|
|
|
|
sectors[i].nexttag = sectors[j].firsttag;
|
|
|
|
sectors[j].firsttag = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_WallGlow()
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// Development garbage!
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
2008-03-12 15:21:17 +00:00
|
|
|
//
|
2008-02-24 23:36:07 +00:00
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
DRunningScript *FParser::SaveCurrentScript()
|
|
|
|
{
|
|
|
|
DFraggleThinker *th = DFraggleThinker::ActiveThinker;
|
|
|
|
if (th)
|
|
|
|
{
|
2008-06-09 19:45:13 +00:00
|
|
|
DRunningScript *runscr = new DRunningScript(Script->trigger, Script, Script->MakeIndex(Rover));
|
2008-03-13 10:21:13 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
// hook into chain at start
|
2008-03-13 10:21:13 +00:00
|
|
|
th->AddRunningScript(runscr);
|
2008-02-24 23:36:07 +00:00
|
|
|
return runscr;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// script function
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_Wait()
|
|
|
|
{
|
|
|
|
DRunningScript *runscr;
|
|
|
|
|
|
|
|
if(t_argc != 1)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
script_error("incorrect arguments to function\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
runscr = SaveCurrentScript();
|
|
|
|
|
|
|
|
runscr->wait_type = wt_delay;
|
|
|
|
|
|
|
|
runscr->wait_data = (intvalue(t_argv[0]) * TICRATE) / 100;
|
|
|
|
throw CFsTerminator();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// wait for sector with particular tag to stop moving
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_TagWait()
|
|
|
|
{
|
|
|
|
DRunningScript *runscr;
|
|
|
|
|
|
|
|
if(t_argc != 1)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
script_error("incorrect arguments to function\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
runscr = SaveCurrentScript();
|
|
|
|
|
|
|
|
runscr->wait_type = wt_tagwait;
|
|
|
|
runscr->wait_data = intvalue(t_argv[0]);
|
|
|
|
throw CFsTerminator();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// wait for a script to finish
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_ScriptWait()
|
|
|
|
{
|
|
|
|
DRunningScript *runscr;
|
|
|
|
|
|
|
|
if(t_argc != 1)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
script_error("insufficient arguments to function\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
runscr = SaveCurrentScript();
|
|
|
|
|
|
|
|
runscr->wait_type = wt_scriptwait;
|
|
|
|
runscr->wait_data = intvalue(t_argv[0]);
|
|
|
|
throw CFsTerminator();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// haleyjd 05/23/01: wait for a script to start (zdoom-inspired)
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_ScriptWaitPre()
|
|
|
|
{
|
|
|
|
DRunningScript *runscr;
|
|
|
|
|
|
|
|
if(t_argc != 1)
|
|
|
|
{
|
|
|
|
script_error("insufficient arguments to function\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
runscr = SaveCurrentScript();
|
|
|
|
runscr->wait_type = wt_scriptwaitpre;
|
|
|
|
runscr->wait_data = intvalue(t_argv[0]);
|
|
|
|
throw CFsTerminator();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// start a new script
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_StartScript()
|
|
|
|
{
|
|
|
|
if(t_argc != 1)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
script_error("incorrect arguments to function\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
2008-03-13 10:21:13 +00:00
|
|
|
int snum = intvalue(t_argv[0]);
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
if(snum < 0 || snum >= MAXSCRIPTS)
|
|
|
|
{
|
|
|
|
script_error("script number %d out of range\n",snum);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
DFraggleThinker *th = DFraggleThinker::ActiveThinker;
|
|
|
|
if (th)
|
|
|
|
{
|
|
|
|
|
2008-03-13 10:21:13 +00:00
|
|
|
DFsScript *script = th->LevelScript->children[snum];
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
if(!script)
|
|
|
|
{
|
|
|
|
script_error("script %i not defined\n", snum);
|
|
|
|
}
|
|
|
|
|
2008-06-09 19:45:13 +00:00
|
|
|
DRunningScript *runscr = new DRunningScript(Script->trigger, script, 0);
|
2008-02-24 23:36:07 +00:00
|
|
|
// hook into chain at start
|
2008-03-13 10:21:13 +00:00
|
|
|
th->AddRunningScript(runscr);
|
2008-02-24 23:36:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// checks if a script is running
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FParser::SF_ScriptRunning()
|
|
|
|
{
|
|
|
|
DRunningScript *current;
|
|
|
|
int snum = 0;
|
|
|
|
|
|
|
|
if(t_argc < 1)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
script_error("not enough arguments to function\n");
|
|
|
|
return;
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
snum = intvalue(t_argv[0]);
|
|
|
|
|
|
|
|
for(current = DFraggleThinker::ActiveThinker->RunningScripts->next; current; current=current->next)
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
{
|
2008-02-24 23:36:07 +00:00
|
|
|
if(current->script->scriptnum == snum)
|
|
|
|
{
|
|
|
|
// script found so return
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 1;
|
|
|
|
return;
|
|
|
|
}
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
}
|
2008-02-24 23:36:07 +00:00
|
|
|
|
|
|
|
// script not found
|
|
|
|
t_return.type = svt_int;
|
|
|
|
t_return.value.i = 0;
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-23 23:13:02 +00:00
|
|
|
//==========================================================================
|
2008-01-27 11:25:03 +00:00
|
|
|
//
|
|
|
|
// Init Functions
|
|
|
|
//
|
2008-02-23 23:13:02 +00:00
|
|
|
//==========================================================================
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
static int zoom=1; // Dummy - no longer needed!
|
|
|
|
|
2008-06-02 17:20:22 +00:00
|
|
|
inline void new_function(const char *name, void (FParser::*handler)() )
|
2008-02-23 23:13:02 +00:00
|
|
|
{
|
2008-03-01 09:53:54 +00:00
|
|
|
global_script->NewVariable (name, svt_function)->value.handler = handler;
|
2008-02-23 23:13:02 +00:00
|
|
|
}
|
|
|
|
|
2008-02-23 21:12:27 +00:00
|
|
|
void init_functions(void)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2008-02-25 08:44:31 +00:00
|
|
|
for(unsigned i=0;i<countof(ActorNames_init);i++)
|
2008-02-23 21:12:27 +00:00
|
|
|
{
|
|
|
|
ActorTypes[i]=PClass::FindClass(ActorNames_init[i]);
|
|
|
|
}
|
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
// add all the functions
|
2008-03-01 09:53:54 +00:00
|
|
|
global_script->NewVariable("consoleplayer", svt_pInt)->value.pI = &consoleplayer;
|
|
|
|
global_script->NewVariable("displayplayer", svt_pInt)->value.pI = &consoleplayer;
|
|
|
|
global_script->NewVariable("zoom", svt_pInt)->value.pI = &zoom;
|
|
|
|
global_script->NewVariable("fov", svt_pInt)->value.pI = &zoom;
|
|
|
|
global_script->NewVariable("trigger", svt_pMobj)->value.pMobj = &trigger_obj;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// important C-emulating stuff
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("break", &FParser::SF_Break);
|
|
|
|
new_function("continue", &FParser::SF_Continue);
|
|
|
|
new_function("return", &FParser::SF_Return);
|
|
|
|
new_function("goto", &FParser::SF_Goto);
|
|
|
|
new_function("include", &FParser::SF_Include);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// standard FraggleScript functions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("print", &FParser::SF_Print);
|
|
|
|
new_function("rnd", &FParser::SF_Rnd); // Legacy uses a normal rand() call for this which is extremely dangerous.
|
|
|
|
new_function("prnd", &FParser::SF_Rnd); // I am mapping rnd and prnd to the same named RNG which should eliminate any problem
|
|
|
|
new_function("input", &FParser::SF_Input);
|
|
|
|
new_function("beep", &FParser::SF_Beep);
|
|
|
|
new_function("clock", &FParser::SF_Clock);
|
|
|
|
new_function("wait", &FParser::SF_Wait);
|
|
|
|
new_function("tagwait", &FParser::SF_TagWait);
|
|
|
|
new_function("scriptwait", &FParser::SF_ScriptWait);
|
|
|
|
new_function("startscript", &FParser::SF_StartScript);
|
|
|
|
new_function("scriptrunning", &FParser::SF_ScriptRunning);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// doom stuff
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("startskill", &FParser::SF_StartSkill);
|
|
|
|
new_function("exitlevel", &FParser::SF_ExitLevel);
|
|
|
|
new_function("tip", &FParser::SF_Tip);
|
|
|
|
new_function("timedtip", &FParser::SF_TimedTip);
|
|
|
|
new_function("message", &FParser::SF_Message);
|
|
|
|
new_function("gameskill", &FParser::SF_Gameskill);
|
|
|
|
new_function("gamemode", &FParser::SF_Gamemode);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// player stuff
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("playermsg", &FParser::SF_PlayerMsg);
|
|
|
|
new_function("playertip", &FParser::SF_PlayerTip);
|
|
|
|
new_function("playeringame", &FParser::SF_PlayerInGame);
|
|
|
|
new_function("playername", &FParser::SF_PlayerName);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("playeraddfrag", &FParser::SF_PlayerAddFrag);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("playerobj", &FParser::SF_PlayerObj);
|
|
|
|
new_function("isplayerobj", &FParser::SF_IsPlayerObj);
|
|
|
|
new_function("isobjplayer", &FParser::SF_IsPlayerObj);
|
|
|
|
new_function("skincolor", &FParser::SF_SkinColor);
|
|
|
|
new_function("playerkeys", &FParser::SF_PlayerKeys);
|
|
|
|
new_function("playerammo", &FParser::SF_PlayerAmmo);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("maxplayerammo", &FParser::SF_MaxPlayerAmmo);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("playerweapon", &FParser::SF_PlayerWeapon);
|
|
|
|
new_function("playerselwep", &FParser::SF_PlayerSelectedWeapon);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// mobj stuff
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("spawn", &FParser::SF_Spawn);
|
|
|
|
new_function("spawnexplosion", &FParser::SF_SpawnExplosion);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("radiusattack", &FParser::SF_RadiusAttack);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("kill", &FParser::SF_KillObj);
|
|
|
|
new_function("removeobj", &FParser::SF_RemoveObj);
|
|
|
|
new_function("objx", &FParser::SF_ObjX);
|
|
|
|
new_function("objy", &FParser::SF_ObjY);
|
|
|
|
new_function("objz", &FParser::SF_ObjZ);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("testlocation", &FParser::SF_TestLocation);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("teleport", &FParser::SF_Teleport);
|
|
|
|
new_function("silentteleport", &FParser::SF_SilentTeleport);
|
|
|
|
new_function("damageobj", &FParser::SF_DamageObj);
|
|
|
|
new_function("healobj", &FParser::SF_HealObj);
|
|
|
|
new_function("player", &FParser::SF_Player);
|
|
|
|
new_function("objsector", &FParser::SF_ObjSector);
|
|
|
|
new_function("objflag", &FParser::SF_ObjFlag);
|
|
|
|
new_function("pushobj", &FParser::SF_PushThing);
|
|
|
|
new_function("pushthing", &FParser::SF_PushThing);
|
|
|
|
new_function("objangle", &FParser::SF_ObjAngle);
|
|
|
|
new_function("objhealth", &FParser::SF_ObjHealth);
|
|
|
|
new_function("objdead", &FParser::SF_ObjDead);
|
|
|
|
new_function("reactiontime", &FParser::SF_ReactionTime);
|
|
|
|
new_function("objreactiontime", &FParser::SF_ReactionTime);
|
|
|
|
new_function("objtarget", &FParser::SF_MobjTarget);
|
|
|
|
new_function("objmomx", &FParser::SF_MobjMomx);
|
|
|
|
new_function("objmomy", &FParser::SF_MobjMomy);
|
|
|
|
new_function("objmomz", &FParser::SF_MobjMomz);
|
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("spawnmissile", &FParser::SF_SpawnMissile);
|
|
|
|
new_function("mapthings", &FParser::SF_MapThings);
|
|
|
|
new_function("objtype", &FParser::SF_ObjType);
|
|
|
|
new_function("mapthingnumexist", &FParser::SF_MapThingNumExist);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("objstate", &FParser::SF_ObjState);
|
|
|
|
new_function("resurrect", &FParser::SF_Resurrect);
|
|
|
|
new_function("lineattack", &FParser::SF_LineAttack);
|
|
|
|
new_function("setobjposition", &FParser::SF_SetObjPosition);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// sector stuff
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("floorheight", &FParser::SF_FloorHeight);
|
|
|
|
new_function("floortext", &FParser::SF_FloorTexture);
|
|
|
|
new_function("floortexture", &FParser::SF_FloorTexture); // haleyjd: alias
|
|
|
|
new_function("movefloor", &FParser::SF_MoveFloor);
|
|
|
|
new_function("ceilheight", &FParser::SF_CeilingHeight);
|
|
|
|
new_function("ceilingheight", &FParser::SF_CeilingHeight); // haleyjd: alias
|
|
|
|
new_function("moveceil", &FParser::SF_MoveCeiling);
|
|
|
|
new_function("moveceiling", &FParser::SF_MoveCeiling); // haleyjd: aliases
|
|
|
|
new_function("ceilingtexture", &FParser::SF_CeilingTexture);
|
|
|
|
new_function("ceiltext", &FParser::SF_CeilingTexture); // haleyjd: wrong
|
|
|
|
new_function("lightlevel", &FParser::SF_LightLevel); // handler - was
|
|
|
|
new_function("fadelight", &FParser::SF_FadeLight); // &FParser::SF_FloorTexture!
|
|
|
|
new_function("colormap", &FParser::SF_SectorColormap);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// cameras!
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("setcamera", &FParser::SF_SetCamera);
|
|
|
|
new_function("clearcamera", &FParser::SF_ClearCamera);
|
|
|
|
new_function("movecamera", &FParser::SF_MoveCamera);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// trig functions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("pointtoangle", &FParser::SF_PointToAngle);
|
|
|
|
new_function("pointtodist", &FParser::SF_PointToDist);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// sound functions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("startsound", &FParser::SF_StartSound);
|
|
|
|
new_function("startsectorsound", &FParser::SF_StartSectorSound);
|
|
|
|
new_function("ambientsound", &FParser::SF_AmbientSound);
|
|
|
|
new_function("startambiantsound", &FParser::SF_AmbientSound); // Legacy's incorrectly spelled name!
|
|
|
|
new_function("changemusic", &FParser::SF_ChangeMusic);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// hubs!
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("changehublevel", &FParser::SF_ChangeHubLevel);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// doors
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("opendoor", &FParser::SF_OpenDoor);
|
|
|
|
new_function("closedoor", &FParser::SF_CloseDoor);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
// HU Graphics
|
|
|
|
new_function("newhupic", &FParser::SF_NewHUPic);
|
|
|
|
new_function("createpic", &FParser::SF_NewHUPic);
|
|
|
|
new_function("deletehupic", &FParser::SF_DeleteHUPic);
|
|
|
|
new_function("modifyhupic", &FParser::SF_ModifyHUPic);
|
|
|
|
new_function("modifypic", &FParser::SF_ModifyHUPic);
|
|
|
|
new_function("sethupicdisplay", &FParser::SF_SetHUPicDisplay);
|
|
|
|
new_function("setpicvisible", &FParser::SF_SetHUPicDisplay);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("playdemo", &FParser::SF_PlayDemo);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("runcommand", &FParser::SF_RunCommand);
|
- Update to ZDoom r858:
- Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
hang while waiting for input from the pipe, since Timidity hadn't been
started yet. I tried using a select call in the FillStream() method, but it
always seems to return the pipe as having nothing available. Unfortunately,
the game still falls all over itself if Timidity isn't available. Instead
of execvp failing nicely, X errors kill the game. I don't know why it's
doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
and set the snd_midipatchset cvar to point to it. It's faster and also
sounds a whole lot better than the crappy freepats Ubuntu wants to install
with Timidity++ (thank goodness I have the official patches from a real
GUS so I don't need to use them).
- GCC fixes.
- Fixed: After starting new music the music volume has to be reset so that
the song's relative volume takes effect.
- Removed the arbitrary 1024 bytes limit when the file being played is a MIDI
file. I had a D_DM2TTL that's only 990 bytes.
- Restructured I_RegisterSong so that $mididevice works again and also supports
selecting FMOD.
- Added Jim' Linux fix.
- Added MartinHowe's fix for mugshot display in status bars.
- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
default device. By default, it uses exactly the same DLS instruments as the
Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
you want to use, set the snd_midipatchset cvar to specify where it should
load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
An overloaded version wraps around it to continue to supply file-writing
support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
than a time in ms, this is now the length in samples of the DSP buffer.
Also added the snd_buffercount cvar to offer complete control over the
call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
below about 44kHz, you will need to set snd_buffersize to avoid long
latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
WASAPI doesn't work with more than two speakers and PCM-Float output at the
same time.)
- Fixed: Area sounds only played from the front speakers once you got within
the 2D panning area.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@79 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-27 18:31:46 +00:00
|
|
|
new_function("checkcvar", &FParser::SF_CheckCVar);
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("setlinetexture", &FParser::SF_SetLineTexture);
|
|
|
|
new_function("linetrigger", &FParser::SF_LineTrigger);
|
|
|
|
new_function("lineflag", &FParser::SF_LineFlag);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//Hurdler: new math functions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("max", &FParser::SF_Max);
|
|
|
|
new_function("min", &FParser::SF_Min);
|
|
|
|
new_function("abs", &FParser::SF_Abs);
|
|
|
|
|
|
|
|
new_function("sin", &FParser::SF_Sin);
|
|
|
|
new_function("asin", &FParser::SF_ASin);
|
|
|
|
new_function("cos", &FParser::SF_Cos);
|
|
|
|
new_function("acos", &FParser::SF_ACos);
|
|
|
|
new_function("tan", &FParser::SF_Tan);
|
|
|
|
new_function("atan", &FParser::SF_ATan);
|
|
|
|
new_function("exp", &FParser::SF_Exp);
|
|
|
|
new_function("log", &FParser::SF_Log);
|
|
|
|
new_function("sqrt", &FParser::SF_Sqrt);
|
|
|
|
new_function("floor", &FParser::SF_Floor);
|
|
|
|
new_function("pow", &FParser::SF_Pow);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Eternity extensions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("setlineblocking", &FParser::SF_SetLineBlocking);
|
|
|
|
new_function("setlinetrigger", &FParser::SF_SetLineTrigger);
|
|
|
|
new_function("setlinemnblock", &FParser::SF_SetLineMonsterBlocking);
|
|
|
|
new_function("scriptwaitpre", &FParser::SF_ScriptWaitPre);
|
|
|
|
new_function("exitsecret", &FParser::SF_ExitSecret);
|
|
|
|
new_function("objawaken", &FParser::SF_ObjAwaken);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// forced coercion functions
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("mobjvalue", &FParser::SF_MobjValue);
|
|
|
|
new_function("stringvalue", &FParser::SF_StringValue);
|
|
|
|
new_function("intvalue", &FParser::SF_IntValue);
|
|
|
|
new_function("fixedvalue", &FParser::SF_FixedValue);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// new for GZDoom
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("spawnshot2", &FParser::SF_SpawnShot2);
|
|
|
|
new_function("setcolor", &FParser::SF_SetColor);
|
|
|
|
new_function("sectortype", &FParser::SF_SectorType);
|
|
|
|
new_function("wallglow", &FParser::SF_WallGlow);
|
|
|
|
new_function("objradius", &FParser::SF_MobjRadius);
|
|
|
|
new_function("objheight", &FParser::SF_MobjHeight);
|
|
|
|
new_function("thingcount", &FParser::SF_ThingCount);
|
|
|
|
new_function("killinsector", &FParser::SF_KillInSector);
|
|
|
|
new_function("changetag", &FParser::SF_ChangeTag);
|
|
|
|
new_function("levelnum", &FParser::SF_LevelNum);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// new inventory
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("giveinventory", &FParser::SF_GiveInventory);
|
|
|
|
new_function("takeinventory", &FParser::SF_TakeInventory);
|
|
|
|
new_function("checkinventory", &FParser::SF_CheckInventory);
|
|
|
|
new_function("setweapon", &FParser::SF_SetWeapon);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("ls", &FParser::SF_Ls); // execute Hexen type line special
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// Dummies - shut up warnings
|
2008-02-24 23:36:07 +00:00
|
|
|
new_function("setcorona", &FParser::SF_SetCorona);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|