gzdoom-last-svn/src/p_lnspec.cpp

3209 lines
74 KiB
C++
Raw Normal View History

/*
** p_lnspec.cpp
** Handles line specials
**
**---------------------------------------------------------------------------
** Copyright 1998-2007 Randy Heit
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
** Each function returns true if it caused something to happen
** or false if it could not perform the desired action.
*/
#include "doomstat.h"
#include "p_local.h"
#include "p_lnspec.h"
#include "p_enemy.h"
#include "g_level.h"
#include "v_palette.h"
#include "tables.h"
#include "i_system.h"
#include "a_sharedglobal.h"
#include "a_lightning.h"
#include "statnums.h"
#include "s_sound.h"
#include "templates.h"
#include "a_keys.h"
#include "gi.h"
#include "m_random.h"
#include "p_conversation.h"
#include "a_strifeglobal.h"
#include "r_translate.h"
#include "p_3dmidtex.h"
#include "d_net.h"
#include "d_event.h"
#define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \
int arg0, int arg1, int arg2, int arg3, int arg4)
#define SPEED(a) ((a)*(FRACUNIT/8))
#define TICS(a) (((a)*TICRATE)/35)
#define OCTICS(a) (((a)*TICRATE)/8)
#define BYTEANGLE(a) ((angle_t)((a)<<24))
#define CRUSHTYPE(a) ((a)==1? false : (a)==2? true : gameinfo.gametype == GAME_Hexen)
static FRandom pr_glass ("GlassBreak");
FName MODtoDamageType (int mod)
{
switch (mod)
{
default: return NAME_None; break;
case 9: return NAME_BFGSplash; break;
case 12: return NAME_Drowning; break;
case 13: return NAME_Slime; break;
case 14: return NAME_Fire; break;
case 15: return NAME_Crush; break;
case 16: return NAME_Telefrag; break;
case 17: return NAME_Falling; break;
case 18: return NAME_Suicide; break;
case 20: return NAME_Exit; break;
case 22: return NAME_Melee; break;
case 23: return NAME_Railgun; break;
case 24: return NAME_Ice; break;
case 25: return NAME_Disintegrate; break;
case 26: return NAME_Poison; break;
case 27: return NAME_Electric; break;
case 1000: return NAME_Massacre; break;
}
}
FUNC(LS_NOP)
{
return false;
}
FUNC(LS_Polyobj_RotateLeft)
// Polyobj_RotateLeft (po, speed, angle)
{
return EV_RotatePoly (ln, arg0, arg1, arg2, 1, false);
}
FUNC(LS_Polyobj_RotateRight)
// Polyobj_rotateRight (po, speed, angle)
{
return EV_RotatePoly (ln, arg0, arg1, arg2, -1, false);
}
FUNC(LS_Polyobj_Move)
// Polyobj_Move (po, speed, angle, distance)
{
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT, false);
}
FUNC(LS_Polyobj_MoveTimes8)
// Polyobj_MoveTimes8 (po, speed, angle, distance)
{
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT * 8, false);
}
FUNC(LS_Polyobj_DoorSwing)
// Polyobj_DoorSwing (po, speed, angle, delay)
{
return EV_OpenPolyDoor (ln, arg0, arg1, BYTEANGLE(arg2), arg3, 0, PODOOR_SWING);
}
FUNC(LS_Polyobj_DoorSlide)
// Polyobj_DoorSlide (po, speed, angle, distance, delay)
{
return EV_OpenPolyDoor (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg4, arg3*FRACUNIT, PODOOR_SLIDE);
}
FUNC(LS_Polyobj_OR_RotateLeft)
// Polyobj_OR_RotateLeft (po, speed, angle)
{
return EV_RotatePoly (ln, arg0, arg1, arg2, 1, true);
}
FUNC(LS_Polyobj_OR_RotateRight)
// Polyobj_OR_RotateRight (po, speed, angle)
{
return EV_RotatePoly (ln, arg0, arg1, arg2, -1, true);
}
FUNC(LS_Polyobj_OR_Move)
// Polyobj_OR_Move (po, speed, angle, distance)
{
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT, true);
}
FUNC(LS_Polyobj_OR_MoveTimes8)
// Polyobj_OR_MoveTimes8 (po, speed, angle, distance)
{
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT * 8, true);
}
FUNC(LS_Door_Close)
// Door_Close (tag, speed, lighttag)
{
return EV_DoDoor (DDoor::doorClose, ln, it, arg0, SPEED(arg1), 0, 0, arg2);
}
FUNC(LS_Door_Open)
// Door_Open (tag, speed, lighttag)
{
return EV_DoDoor (DDoor::doorOpen, ln, it, arg0, SPEED(arg1), 0, 0, arg2);
}
FUNC(LS_Door_Raise)
// Door_Raise (tag, speed, delay, lighttag)
{
return EV_DoDoor (DDoor::doorRaise, ln, it, arg0, SPEED(arg1), TICS(arg2), 0, arg3);
}
FUNC(LS_Door_LockedRaise)
// Door_LockedRaise (tag, speed, delay, lock, lighttag)
{
return EV_DoDoor (arg2 ? DDoor::doorRaise : DDoor::doorOpen, ln, it,
arg0, SPEED(arg1), TICS(arg2), arg3, arg4);
}
FUNC(LS_Door_CloseWaitOpen)
// Door_CloseWaitOpen (tag, speed, delay, lighttag)
{
return EV_DoDoor (DDoor::doorCloseWaitOpen, ln, it, arg0, SPEED(arg1), OCTICS(arg2), 0, arg3);
}
FUNC(LS_Door_Animated)
// Door_Animated (tag, speed, delay)
{
return EV_SlidingDoor (ln, it, arg0, arg1, arg2);
}
FUNC(LS_Generic_Door)
// Generic_Door (tag, speed, kind, delay, lock)
{
int tag, lightTag;
DDoor::EVlDoor type;
switch (arg2 & 127)
{
case 0: type = DDoor::doorRaise; break;
case 1: type = DDoor::doorOpen; break;
case 2: type = DDoor::doorCloseWaitOpen; break;
case 3: type = DDoor::doorClose; break;
default: return false;
}
if (arg2 & 128)
{
// New for 2.0.58: Finally support BOOM's local door light effect
tag = 0;
lightTag = arg0;
}
else
{
tag = arg0;
lightTag = 0;
}
return EV_DoDoor (type, ln, it, tag, SPEED(arg1), OCTICS(arg3), arg4, lightTag);
}
FUNC(LS_Floor_LowerByValue)
// Floor_LowerByValue (tag, speed, height)
{
return EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), FRACUNIT*arg2, 0, 0, false);
}
FUNC(LS_Floor_LowerToLowest)
// Floor_LowerToLowest (tag, speed)
{
return EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_LowerToHighest)
// Floor_LowerToHighest (tag, speed, adjust)
{
return EV_DoFloor (DFloor::floorLowerToHighest, ln, arg0, SPEED(arg1), (arg2-128)*FRACUNIT, 0, 0, false);
}
FUNC(LS_Floor_LowerToNearest)
// Floor_LowerToNearest (tag, speed)
{
return EV_DoFloor (DFloor::floorLowerToNearest, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_RaiseByValue)
// Floor_RaiseByValue (tag, speed, height)
{
return EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), FRACUNIT*arg2, 0, 0, false);
}
FUNC(LS_Floor_RaiseToHighest)
// Floor_RaiseToHighest (tag, speed)
{
return EV_DoFloor (DFloor::floorRaiseToHighest, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_RaiseToNearest)
// Floor_RaiseToNearest (tag, speed)
{
return EV_DoFloor (DFloor::floorRaiseToNearest, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_RaiseAndCrush)
// Floor_RaiseAndCrush (tag, speed, crush, crushmode)
{
return EV_DoFloor (DFloor::floorRaiseAndCrush, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3));
}
FUNC(LS_Floor_RaiseByValueTimes8)
// FLoor_RaiseByValueTimes8 (tag, speed, height)
{
return EV_DoFloor (DFloor::floorRaiseByValue, ln, arg0, SPEED(arg1), FRACUNIT*arg2*8, 0, 0, false);
}
FUNC(LS_Floor_LowerByValueTimes8)
// Floor_LowerByValueTimes8 (tag, speed, height)
{
return EV_DoFloor (DFloor::floorLowerByValue, ln, arg0, SPEED(arg1), FRACUNIT*arg2*8, 0, 0, false);
}
FUNC(LS_Floor_CrushStop)
// Floor_CrushStop (tag)
{
return EV_FloorCrushStop (arg0);
}
FUNC(LS_Floor_LowerInstant)
// Floor_LowerInstant (tag, unused, height)
{
return EV_DoFloor (DFloor::floorLowerInstant, ln, arg0, 0, arg2*FRACUNIT*8, 0, 0, false);
}
FUNC(LS_Floor_RaiseInstant)
// Floor_RaiseInstant (tag, unused, height)
{
return EV_DoFloor (DFloor::floorRaiseInstant, ln, arg0, 0, arg2*FRACUNIT*8, 0, 0, false);
}
FUNC(LS_Floor_MoveToValueTimes8)
// Floor_MoveToValueTimes8 (tag, speed, height, negative)
{
return EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2*FRACUNIT*8*(arg3?-1:1), 0, 0, false);
}
FUNC(LS_Floor_MoveToValue)
// Floor_MoveToValue (tag, speed, height, negative)
{
return EV_DoFloor (DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2*FRACUNIT*(arg3?-1:1), 0, 0, false);
}
FUNC(LS_Floor_RaiseToLowestCeiling)
// Floor_RaiseToLowestCeiling (tag, speed)
{
return EV_DoFloor (DFloor::floorRaiseToLowestCeiling, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_RaiseByTexture)
// Floor_RaiseByTexture (tag, speed)
{
return EV_DoFloor (DFloor::floorRaiseByTexture, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Floor_RaiseByValueTxTy)
// Floor_RaiseByValueTxTy (tag, speed, height)
{
return EV_DoFloor (DFloor::floorRaiseAndChange, ln, arg0, SPEED(arg1), arg2*FRACUNIT, 0, 0, false);
}
FUNC(LS_Floor_LowerToLowestTxTy)
// Floor_LowerToLowestTxTy (tag, speed)
{
return EV_DoFloor (DFloor::floorLowerAndChange, ln, arg0, SPEED(arg1), arg2*FRACUNIT, 0, 0, false);
}
FUNC(LS_Floor_Waggle)
// Floor_Waggle (tag, amplitude, frequency, delay, time)
{
return EV_StartWaggle (arg0, arg1, arg2, arg3, arg4, false);
}
FUNC(LS_Ceiling_Waggle)
// Ceiling_Waggle (tag, amplitude, frequency, delay, time)
{
return EV_StartWaggle (arg0, arg1, arg2, arg3, arg4, true);
}
FUNC(LS_Floor_TransferTrigger)
// Floor_TransferTrigger (tag)
{
return EV_DoChange (ln, trigChangeOnly, arg0);
}
FUNC(LS_Floor_TransferNumeric)
// Floor_TransferNumeric (tag)
{
return EV_DoChange (ln, numChangeOnly, arg0);
}
FUNC(LS_Floor_Donut)
// Floor_Donut (pillartag, pillarspeed, slimespeed)
{
return EV_DoDonut (arg0, SPEED(arg1), SPEED(arg2));
}
FUNC(LS_Generic_Floor)
// Generic_Floor (tag, speed, height, target, change/model/direct/crush)
{
DFloor::EFloor type;
if (arg4 & 8)
{
switch (arg3)
{
case 1: type = DFloor::floorRaiseToHighest; break;
case 2: type = DFloor::floorRaiseToLowest; break;
case 3: type = DFloor::floorRaiseToNearest; break;
case 4: type = DFloor::floorRaiseToLowestCeiling; break;
case 5: type = DFloor::floorRaiseToCeiling; break;
case 6: type = DFloor::floorRaiseByTexture; break;
default:type = DFloor::floorRaiseByValue; break;
}
}
else
{
switch (arg3)
{
case 1: type = DFloor::floorLowerToHighest; break;
case 2: type = DFloor::floorLowerToLowest; break;
case 3: type = DFloor::floorLowerToNearest; break;
case 4: type = DFloor::floorLowerToLowestCeiling; break;
case 5: type = DFloor::floorLowerToCeiling; break;
case 6: type = DFloor::floorLowerByTexture; break;
default:type = DFloor::floorLowerByValue; break;
}
}
return EV_DoFloor (type, ln, arg0, SPEED(arg1), arg2*FRACUNIT,
(arg4 & 16) ? 20 : -1, arg4 & 7, false);
}
FUNC(LS_Stairs_BuildDown)
// Stair_BuildDown (tag, speed, height, delay, reset)
{
return EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2 * FRACUNIT, SPEED(arg1), TICS(arg3), arg4, 0, 1);
}
FUNC(LS_Stairs_BuildUp)
// Stairs_BuildUp (tag, speed, height, delay, reset)
{
return EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2 * FRACUNIT, SPEED(arg1), TICS(arg3), arg4, 0, 1);
}
FUNC(LS_Stairs_BuildDownSync)
// Stairs_BuildDownSync (tag, speed, height, reset)
{
return EV_BuildStairs (arg0, DFloor::buildDown, ln,
arg2 * FRACUNIT, SPEED(arg1), 0, arg3, 0, 2);
}
FUNC(LS_Stairs_BuildUpSync)
// Stairs_BuildUpSync (tag, speed, height, reset)
{
return EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2 * FRACUNIT, SPEED(arg1), 0, arg3, 0, 2);
}
FUNC(LS_Stairs_BuildUpDoom)
// Stairs_BuildUpDoom (tag, speed, height, delay, reset)
{
return EV_BuildStairs (arg0, DFloor::buildUp, ln,
arg2 * FRACUNIT, SPEED(arg1), TICS(arg3), arg4, 0, 0);
}
FUNC(LS_Generic_Stairs)
// Generic_Stairs (tag, speed, step, dir/igntxt, reset)
{
DFloor::EStair type = (arg3 & 1) ? DFloor::buildUp : DFloor::buildDown;
bool res = EV_BuildStairs (arg0, type, ln,
arg2 * FRACUNIT, SPEED(arg1), 0, arg4, arg3 & 2, 0);
if (res && ln && (ln->flags & ML_REPEAT_SPECIAL) && ln->special == Generic_Stairs)
// Toggle direction of next activation of repeatable stairs
ln->args[3] ^= 1;
return res;
}
FUNC(LS_Pillar_Build)
// Pillar_Build (tag, speed, height)
{
return EV_DoPillar (DPillar::pillarBuild, arg0, SPEED(arg1), arg2*FRACUNIT, 0, -1, false);
}
FUNC(LS_Pillar_BuildAndCrush)
// Pillar_BuildAndCrush (tag, speed, height, crush, crushtype)
{
return EV_DoPillar (DPillar::pillarBuild, arg0, SPEED(arg1), arg2*FRACUNIT, 0, arg3, CRUSHTYPE(arg4));
}
FUNC(LS_Pillar_Open)
// Pillar_Open (tag, speed, f_height, c_height)
{
return EV_DoPillar (DPillar::pillarOpen, arg0, SPEED(arg1), arg2*FRACUNIT, arg3*FRACUNIT, -1, false);
}
FUNC(LS_Ceiling_LowerByValue)
// Ceiling_LowerByValue (tag, speed, height)
{
return EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2*FRACUNIT, -1, 0, 0, false);
}
FUNC(LS_Ceiling_RaiseByValue)
// Ceiling_RaiseByValue (tag, speed, height)
{
return EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2*FRACUNIT, -1, 0, 0, false);
}
FUNC(LS_Ceiling_LowerByValueTimes8)
// Ceiling_LowerByValueTimes8 (tag, speed, height)
{
return EV_DoCeiling (DCeiling::ceilLowerByValue, ln, arg0, SPEED(arg1), 0, arg2*FRACUNIT*8, -1, 0, 0, false);
}
FUNC(LS_Ceiling_RaiseByValueTimes8)
// Ceiling_RaiseByValueTimes8 (tag, speed, height)
{
return EV_DoCeiling (DCeiling::ceilRaiseByValue, ln, arg0, SPEED(arg1), 0, arg2*FRACUNIT*8, -1, 0, 0, false);
}
FUNC(LS_Ceiling_CrushAndRaise)
// Ceiling_CrushAndRaise (tag, speed, crush, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 0, arg2, 0, 0, CRUSHTYPE(arg3));
}
FUNC(LS_Ceiling_LowerAndCrush)
// Ceiling_LowerAndCrush (tag, speed, crush, crushtype)
{
return EV_DoCeiling (DCeiling::ceilLowerAndCrush, ln, arg0, SPEED(arg1), SPEED(arg1), 0, arg2, 0, 0, CRUSHTYPE(arg3));
}
FUNC(LS_Ceiling_CrushStop)
// Ceiling_CrushStop (tag)
{
return EV_CeilingCrushStop (arg0);
}
FUNC(LS_Ceiling_CrushRaiseAndStay)
// Ceiling_CrushRaiseAndStay (tag, speed, crush, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg1)/2, 0, arg2, 0, 0, CRUSHTYPE(arg3));
}
FUNC(LS_Ceiling_MoveToValueTimes8)
// Ceiling_MoveToValueTimes8 (tag, speed, height, negative)
{
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2*FRACUNIT*8*((arg3) ? -1 : 1), -1, 0, 0, false);
}
FUNC(LS_Ceiling_MoveToValue)
// Ceiling_MoveToValue (tag, speed, height, negative)
{
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2*FRACUNIT*((arg3) ? -1 : 1), -1, 0, 0, false);
}
FUNC(LS_Ceiling_LowerToHighestFloor)
// Ceiling_LowerToHighestFloor (tag, speed)
{
return EV_DoCeiling (DCeiling::ceilLowerToHighestFloor, ln, arg0, SPEED(arg1), 0, 0, -1, 0, 0, false);
}
FUNC(LS_Ceiling_LowerInstant)
// Ceiling_LowerInstant (tag, unused, height)
{
return EV_DoCeiling (DCeiling::ceilLowerInstant, ln, arg0, 0, 0, arg2*FRACUNIT*8, -1, 0, 0, false);
}
FUNC(LS_Ceiling_RaiseInstant)
// Ceiling_RaiseInstant (tag, unused, height)
{
return EV_DoCeiling (DCeiling::ceilRaiseInstant, ln, arg0, 0, 0, arg2*FRACUNIT*8, -1, 0, 0, false);
}
FUNC(LS_Ceiling_CrushRaiseAndStayA)
// Ceiling_CrushRaiseAndStayA (tag, dnspeed, upspeed, damage, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4));
}
FUNC(LS_Ceiling_CrushRaiseAndStaySilA)
// Ceiling_CrushRaiseAndStaySilA (tag, dnspeed, upspeed, damage, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushRaiseAndStay, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4));
}
FUNC(LS_Ceiling_CrushAndRaiseA)
// Ceiling_CrushAndRaiseA (tag, dnspeed, upspeed, damage, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 0, 0, CRUSHTYPE(arg4));
}
FUNC(LS_Ceiling_CrushAndRaiseSilentA)
// Ceiling_CrushAndRaiseSilentA (tag, dnspeed, upspeed, damage, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4));
}
FUNC(LS_Ceiling_RaiseToNearest)
// Ceiling_RaiseToNearest (tag, speed)
{
return EV_DoCeiling (DCeiling::ceilRaiseToNearest, ln, arg0, SPEED(arg1), 0, 0, -1, 0, 0, false);
}
FUNC(LS_Ceiling_LowerToLowest)
// Ceiling_LowerToLowest (tag, speed)
{
return EV_DoCeiling (DCeiling::ceilLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, -1, 0, 0, false);
}
FUNC(LS_Ceiling_LowerToFloor)
// Ceiling_LowerToFloor (tag, speed)
{
return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, 0, -1, 0, 0, false);
}
FUNC(LS_Generic_Ceiling)
// Generic_Ceiling (tag, speed, height, target, change/model/direct/crush)
{
DCeiling::ECeiling type;
if (arg4 & 8) {
switch (arg3) {
case 1: type = DCeiling::ceilRaiseToHighest; break;
case 2: type = DCeiling::ceilRaiseToLowest; break;
case 3: type = DCeiling::ceilRaiseToNearest; break;
case 4: type = DCeiling::ceilRaiseToHighestFloor; break;
case 5: type = DCeiling::ceilRaiseToFloor; break;
case 6: type = DCeiling::ceilRaiseByTexture; break;
default: type = DCeiling::ceilRaiseByValue; break;
}
} else {
switch (arg3) {
case 1: type = DCeiling::ceilLowerToHighest; break;
case 2: type = DCeiling::ceilLowerToLowest; break;
case 3: type = DCeiling::ceilLowerToNearest; break;
case 4: type = DCeiling::ceilLowerToHighestFloor; break;
case 5: type = DCeiling::ceilLowerToFloor; break;
case 6: type = DCeiling::ceilLowerByTexture; break;
default: type = DCeiling::ceilLowerByValue; break;
}
}
return EV_DoCeiling (type, ln, arg0, SPEED(arg1), SPEED(arg1), arg2*FRACUNIT,
(arg4 & 16) ? 20 : -1, 0, arg4 & 7, false);
}
FUNC(LS_Generic_Crusher)
// Generic_Crusher (tag, dnspeed, upspeed, silent, damage)
{
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1),
SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, false);
}
FUNC(LS_Generic_Crusher2)
// Generic_Crusher2 (tag, dnspeed, upspeed, silent, damage)
{
// same as above but uses Hexen's crushing method.
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1),
SPEED(arg2), 0, arg4, arg3 ? 2 : 0, 0, true);
}
FUNC(LS_Plat_PerpetualRaise)
// Plat_PerpetualRaise (tag, speed, delay)
{
return EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), 8, 0);
}
FUNC(LS_Plat_PerpetualRaiseLip)
// Plat_PerpetualRaiseLip (tag, speed, delay, lip)
{
return EV_DoPlat (arg0, ln, DPlat::platPerpetualRaise, 0, SPEED(arg1), TICS(arg2), arg3, 0);
}
FUNC(LS_Plat_Stop)
// Plat_Stop (tag)
{
EV_StopPlat (arg0);
return true;
}
FUNC(LS_Plat_DownWaitUpStay)
// Plat_DownWaitUpStay (tag, speed, delay)
{
return EV_DoPlat (arg0, ln, DPlat::platDownWaitUpStay, 0, SPEED(arg1), TICS(arg2), 8, 0);
}
FUNC(LS_Plat_DownWaitUpStayLip)
// Plat_DownWaitUpStayLip (tag, speed, delay, lip, floor-sound?)
{
return EV_DoPlat (arg0, ln,
arg4 ? DPlat::platDownWaitUpStayStone : DPlat::platDownWaitUpStay,
0, SPEED(arg1), TICS(arg2), arg3, 0);
}
FUNC(LS_Plat_DownByValue)
// Plat_DownByValue (tag, speed, delay, height)
{
return EV_DoPlat (arg0, ln, DPlat::platDownByValue, FRACUNIT*arg3*8, SPEED(arg1), TICS(arg2), 0, 0);
}
FUNC(LS_Plat_UpByValue)
// Plat_UpByValue (tag, speed, delay, height)
{
return EV_DoPlat (arg0, ln, DPlat::platUpByValue, FRACUNIT*arg3*8, SPEED(arg1), TICS(arg2), 0, 0);
}
FUNC(LS_Plat_UpWaitDownStay)
// Plat_UpWaitDownStay (tag, speed, delay)
{
return EV_DoPlat (arg0, ln, DPlat::platUpWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0);
}
FUNC(LS_Plat_UpNearestWaitDownStay)
// Plat_UpNearestWaitDownStay (tag, speed, delay)
{
return EV_DoPlat (arg0, ln, DPlat::platUpNearestWaitDownStay, 0, SPEED(arg1), TICS(arg2), 0, 0);
}
FUNC(LS_Plat_RaiseAndStayTx0)
// Plat_RaiseAndStayTx0 (tag, speed)
{
return EV_DoPlat (arg0, ln, DPlat::platRaiseAndStay, 0, SPEED(arg1), 0, 0, 1);
}
FUNC(LS_Plat_UpByValueStayTx)
// Plat_UpByValueStayTx (tag, speed, height)
{
return EV_DoPlat (arg0, ln, DPlat::platUpByValueStay, FRACUNIT*arg2*8, SPEED(arg1), 0, 0, 2);
}
FUNC(LS_Plat_ToggleCeiling)
// Plat_ToggleCeiling (tag)
{
return EV_DoPlat (arg0, ln, DPlat::platToggle, 0, 0, 0, 0, 0);
}
FUNC(LS_Generic_Lift)
// Generic_Lift (tag, speed, delay, target, height)
{
DPlat::EPlatType type;
switch (arg3)
{
case 1:
type = DPlat::platDownWaitUpStay;
break;
case 2:
type = DPlat::platDownToNearestFloor;
break;
case 3:
type = DPlat::platDownToLowestCeiling;
break;
case 4:
type = DPlat::platPerpetualRaise;
break;
default:
type = DPlat::platUpByValue;
break;
}
return EV_DoPlat (arg0, ln, type, arg4*8*FRACUNIT, SPEED(arg1), OCTICS(arg2), 0, 0);
}
FUNC(LS_Exit_Normal)
// Exit_Normal (position)
{
if (CheckIfExitIsGood (it, FindLevelInfo(G_GetExitMap())))
{
G_ExitLevel (arg0, false);
return true;
}
return false;
}
FUNC(LS_Exit_Secret)
// Exit_Secret (position)
{
if (CheckIfExitIsGood (it, FindLevelInfo(G_GetSecretExitMap())))
{
G_SecretExitLevel (arg0);
return true;
}
return false;
}
FUNC(LS_Teleport_NewMap)
// Teleport_NewMap (map, position, keepFacing?)
{
if (backSide == 0 || gameinfo.gametype == GAME_Strife)
{
level_info_t *info = FindLevelByNum (arg0);
if (info && CheckIfExitIsGood (it, info))
{
G_ChangeLevel(info->mapname, arg1, !!arg2);
return true;
}
}
return false;
}
FUNC(LS_Teleport)
// Teleport (tid, sectortag, bNoSourceFog)
{
return EV_Teleport (arg0, arg1, ln, backSide, it, true, !arg2, false);
}
Update to ZDoom r1073: - Fixed: When Heretic's Mace was replaced by a non-child class A_SpawnMace still treated it as a mace and wrote into some undefined memory. - Fixed: A_BishopMissileWeave didn't initialize special2 for proper movement. - Added a speed parameter to A_SkullAttack. - Fixed: Black as first or only blood color didn't work. - Fixed: Sounds played in wi_stuff.cpp and f_finale.cpp need the CHAN_UI flag. - Fixed: Spawning a player could play the *gasp sound. - Fixed: SBARINFO's health display didn't scale to the proper maximum. - Added const char &operator[] (unsigned int index) to FString class. - Added Skulltag's Teleport_NoStop action special. - Fixed: Strife's EntityBoss didn't copy friendliness information to the sub-entities. - Fixed: Friendly spectral monsters should be able to hurt unfriendly ones and vice versa. - Fixed: In deathmatch specral missiles spawned by players should hurt other players. - Fixed: SpectralLightningBigBall didn't set the proper owner for the lightning projectiles it spawned. - Changed the EntityBoss's attack function to call the equivalent spectre functions instead of duplicating their code. - Gave many of Strife's code pointers that only had a number as name more meaningful names. - Fixed: All spectral attacks must set 'health' first before P_CheckMissileSpawn is called. - Added a compatibility option to play sector sounds from the precalculated center because some maps apparently abuse the behavior to make the sound play somewhere where it can't be heard by the player to fake silent movement. - Fixed: The S_Sound variant taking an actor must check if the actor is not NULL. - Fixed: ACS's ActivatorSound must check if the activator is valid. - Changed stats drawing so that multi-line strings can be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@132 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-19 23:52:06 +00:00
FUNC( LS_Teleport_NoStop )
// Teleport_NoStop (tid, sectortag, bNoSourceFog)
{
return EV_Teleport( arg0, arg1, ln, backSide, it, true, !arg2, false, false );
}
FUNC(LS_Teleport_NoFog)
// Teleport_NoFog (tid, useang, sectortag)
{
return EV_Teleport (arg0, arg2, ln, backSide, it, false, false, !arg1);
}
FUNC(LS_Teleport_ZombieChanger)
// Teleport_ZombieChanger (tid, sectortag)
{
// This is practically useless outside of Strife, but oh well.
if (it != NULL)
{
EV_Teleport (arg0, arg1, ln, backSide, it, false, false, false);
if (it->health >= 0) it->SetState (it->FindState(NAME_Pain));
return true;
}
return false;
}
FUNC(LS_TeleportOther)
// TeleportOther (other_tid, dest_tid, fog?)
{
return EV_TeleportOther (arg0, arg1, arg2?true:false);
}
FUNC(LS_TeleportGroup)
// TeleportGroup (group_tid, source_tid, dest_tid, move_source?, fog?)
{
return EV_TeleportGroup (arg0, it, arg1, arg2, arg3?true:false, arg4?true:false);
}
FUNC(LS_TeleportInSector)
// TeleportInSector (tag, source_tid, dest_tid, bFog, group_tid)
{
return EV_TeleportSector (arg0, arg1, arg2, arg3?true:false, arg4);
}
FUNC(LS_Teleport_EndGame)
// Teleport_EndGame ()
{
if (!backSide && CheckIfExitIsGood (it, NULL))
{
G_SetForEndGame (level.nextmap);
G_ExitLevel (0, false);
return true;
}
return false;
}
FUNC(LS_Teleport_Line)
// Teleport_Line (thisid, destid, reversed)
{
return EV_SilentLineTeleport (ln, backSide, it, arg1, arg2);
}
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit);
FUNC(LS_ThrustThing)
// ThrustThing (angle, force, nolimit, tid)
{
if (arg3 != 0)
{
FActorIterator iterator (arg3);
while ((it = iterator.Next()) != NULL)
{
ThrustThingHelper (it, BYTEANGLE(arg0), arg1, arg2);
}
return true;
}
else if (it)
{
ThrustThingHelper (it, BYTEANGLE(arg0), arg1, arg2);
return true;
}
return false;
}
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit)
{
angle >>= ANGLETOFINESHIFT;
it->momx += force * finecosine[angle];
it->momy += force * finesine[angle];
if (!nolimit)
{
it->momx = clamp<fixed_t> (it->momx, -MAXMOVE, MAXMOVE);
it->momy = clamp<fixed_t> (it->momy, -MAXMOVE, MAXMOVE);
}
}
FUNC(LS_ThrustThingZ) // [BC]
// ThrustThingZ (tid, zthrust, down/up, set)
{
AActor *victim;
fixed_t thrust = arg1*FRACUNIT/4;
// [BC] Up is default
if (arg2)
thrust = -thrust;
if (arg0 != 0)
{
FActorIterator iterator (arg0);
while ( (victim = iterator.Next ()) )
{
if (!arg3)
victim->momz = thrust;
else
victim->momz += thrust;
}
return true;
}
else if (it)
{
if (!arg3)
it->momz = thrust;
else
it->momz += thrust;
return true;
}
return false;
}
FUNC(LS_Thing_SetSpecial) // [BC]
// Thing_SetSpecial (tid, special, arg1, arg2, arg3)
// [RH] Use the SetThingSpecial ACS command instead.
// It can set all args and not just the first three.
{
if (arg0 == 0)
{
if (it != NULL)
{
it->special = arg1;
it->args[0] = arg2;
it->args[1] = arg3;
it->args[2] = arg4;
}
}
else
{
AActor *actor;
FActorIterator iterator (arg0);
while ( (actor = iterator.Next ()) )
{
actor->special = arg1;
actor->args[0] = arg2;
actor->args[1] = arg3;
actor->args[2] = arg4;
}
}
return true;
}
FUNC(LS_Thing_ChangeTID)
// Thing_ChangeTID (oldtid, newtid)
{
if (arg0 == 0)
{
if (it != NULL && !(it->ObjectFlags & OF_EuthanizeMe))
{
it->RemoveFromHash ();
it->tid = arg1;
it->AddToHash ();
}
}
else
{
FActorIterator iterator (arg0);
AActor *actor, *next;
next = iterator.Next ();
while (next != NULL)
{
actor = next;
next = iterator.Next ();
if (!(actor->ObjectFlags & OF_EuthanizeMe))
{
actor->RemoveFromHash ();
actor->tid = arg1;
actor->AddToHash ();
}
}
}
return true;
}
FUNC(LS_DamageThing)
// DamageThing (damage, mod)
{
if (it)
{
if (arg0 < 0)
{ // Negative damages mean healing
if (it->player)
{
P_GiveBody (it, -arg0);
}
else
{
it->health -= arg0;
if (it->GetDefault()->health < it->health)
it->health = it->GetDefault()->health;
}
}
else if (arg0 > 0)
{
P_DamageMobj (it, NULL, NULL, arg0, MODtoDamageType (arg1));
}
else
{ // If zero damage, guarantee a kill
P_DamageMobj (it, NULL, NULL, 1000000, MODtoDamageType (arg1));
}
}
return it ? true : false;
}
FUNC(LS_HealThing)
// HealThing (amount, max)
{
if (it)
{
int max = arg1;
if (max == 0 || it->player == NULL)
{
P_GiveBody(it, arg0);
return true;
}
else if (max == 1)
{
max = deh.MaxSoulsphere;
}
// If health is already above max, do nothing
if (it->health < max)
{
it->health += arg0;
if (it->health > max && max > 0)
{
it->health = max;
}
if (it->player)
{
it->player->health = it->health;
}
}
}
return it ? true : false;
}
FUNC(LS_Thing_Activate)
// Thing_Activate (tid)
{
if (arg0 != 0)
{
AActor *actor;
FActorIterator iterator (arg0);
int count = 0;
actor = iterator.Next ();
while (actor)
{
// Actor might remove itself as part of activation, so get next
// one before activating it.
AActor *temp = iterator.Next ();
actor->Activate (it);
actor = temp;
count++;
}
return count != 0;
}
else if (it != NULL)
{
it->Activate(it);
return true;
}
return false;
}
FUNC(LS_Thing_Deactivate)
// Thing_Deactivate (tid)
{
if (arg0 != 0)
{
AActor *actor;
FActorIterator iterator (arg0);
int count = 0;
actor = iterator.Next ();
while (actor)
{
// Actor might removes itself as part of deactivation, so get next
// one before we activate it.
AActor *temp = iterator.Next ();
actor->Deactivate (it);
actor = temp;
count++;
}
return count != 0;
}
else if (it != NULL)
{
it->Deactivate(it);
return true;
}
return false;
}
FUNC(LS_Thing_Remove)
// Thing_Remove (tid)
{
if (arg0 != 0)
{
FActorIterator iterator (arg0);
AActor *actor;
actor = iterator.Next ();
while (actor)
{
AActor *temp = iterator.Next ();
P_RemoveThing(actor);
actor = temp;
}
}
else if (it != NULL)
{
P_RemoveThing(it);
}
return true;
}
FUNC(LS_Thing_Destroy)
// Thing_Destroy (tid, extreme)
{
if (arg0 == 0)
{
P_Massacre ();
}
else
{
FActorIterator iterator (arg0);
AActor *actor;
actor = iterator.Next ();
while (actor)
{
AActor *temp = iterator.Next ();
if (actor->flags & MF_SHOOTABLE)
P_DamageMobj (actor, NULL, it, arg1 ? 1000000 : actor->health, NAME_None);
actor = temp;
}
}
return true;
}
FUNC(LS_Thing_Damage)
// Thing_Damage (tid, amount, MOD)
{
P_Thing_Damage (arg0, it, arg1, MODtoDamageType (arg2));
return true;
}
FUNC(LS_Thing_Projectile)
// Thing_Projectile (tid, type, angle, speed, vspeed)
{
return P_Thing_Projectile (arg0, it, arg1, NULL, BYTEANGLE(arg2), arg3<<(FRACBITS-3),
arg4<<(FRACBITS-3), 0, NULL, 0, 0, false);
}
FUNC(LS_Thing_ProjectileGravity)
// Thing_ProjectileGravity (tid, type, angle, speed, vspeed)
{
return P_Thing_Projectile (arg0, it, arg1, NULL, BYTEANGLE(arg2), arg3<<(FRACBITS-3),
arg4<<(FRACBITS-3), 0, NULL, 1, 0, false);
}
FUNC(LS_Thing_Hate)
// Thing_Hate (hater, hatee, group/"xray"?)
{
FActorIterator haterIt (arg0);
AActor *hater, *hatee = NULL;
FActorIterator hateeIt (arg1);
bool nothingToHate = false;
if (arg1 != 0)
{
while ((hatee = hateeIt.Next ()))
{
if (hatee->flags & MF_SHOOTABLE && // can't hate nonshootable things
hatee->health > 0 && // can't hate dead things
!(hatee->flags2 & MF2_DORMANT)) // can't target dormant things
{
break;
}
}
if (hatee == NULL)
{ // Nothing to hate
nothingToHate = true;
}
}
if (arg0 == 0)
{
if (it != NULL && it->player != NULL)
{
// Players cannot have their attitudes set
return false;
}
else
{
hater = it;
}
}
else
{
while ((hater = haterIt.Next ()))
{
if (hater->health > 0 && hater->flags & MF_SHOOTABLE)
{
break;
}
}
}
while (hater != NULL)
{
// Can't hate if can't attack.
if (hater->SeeState != NULL)
{
// If hating a group of things, record the TID and NULL
// the target (if its TID doesn't match). A_Look will
// find an appropriate thing to go chase after.
if (arg2 != 0)
{
hater->TIDtoHate = arg1;
hater->LastLookActor = NULL;
// If the TID to hate is 0, then don't forget the target and
// lastenemy fields.
if (arg1 != 0)
{
if (hater->target != NULL && hater->target->tid != arg1)
{
hater->target = NULL;
}
if (hater->lastenemy != NULL && hater->lastenemy->tid != arg1)
{
hater->lastenemy = NULL;
}
}
}
// Hate types for arg2:
//
// 0 - Just hate one specific actor
// 1 - Hate actors with given TID and attack players when shot
// 2 - Same as 1, but will go after enemies without seeing them first
// 3 - Hunt actors with given TID and also players
// 4 - Same as 3, but will go after monsters without seeing them first
// 5 - Hate actors with given TID and ignore player attacks
// 6 - Same as 5, but will go after enemies without seeing them first
// Note here: If you use Thing_Hate (tid, 0, 2), you can make
// a monster go after a player without seeing him first.
if (arg2 == 2 || arg2 == 4 || arg2 == 6)
{
hater->flags3 |= MF3_NOSIGHTCHECK;
}
else
{
hater->flags3 &= ~MF3_NOSIGHTCHECK;
}
if (arg2 == 3 || arg2 == 4)
{
hater->flags3 |= MF3_HUNTPLAYERS;
}
else
{
hater->flags3 &= ~MF3_HUNTPLAYERS;
}
if (arg2 == 5 || arg2 == 6)
{
hater->flags4 |= MF4_NOHATEPLAYERS;
}
else
{
hater->flags4 &= ~MF4_NOHATEPLAYERS;
}
if (arg1 == 0)
{
hatee = it;
}
else if (nothingToHate)
{
hatee = NULL;
}
else if (arg2 != 0)
{
do
{
hatee = hateeIt.Next ();
}
while ( hatee == NULL ||
hatee == hater || // can't hate self
!(hatee->flags & MF_SHOOTABLE) || // can't hate nonshootable things
hatee->health <= 0 || // can't hate dead things
(hatee->flags2 & MF2_DORMANT));
}
if (hatee != NULL && hatee != hater && (arg2 == 0 || (hater->goal != NULL && hater->target != hater->goal)))
{
if (hater->target)
{
hater->lastenemy = hater->target;
}
hater->target = hatee;
if (!(hater->flags2 & MF2_DORMANT))
{
if (hater->health > 0) hater->SetState (hater->SeeState);
}
}
}
if (arg0 != 0)
{
while ((hater = haterIt.Next ()))
{
if (hater->health > 0 && hater->flags & MF_SHOOTABLE)
{
break;
}
}
}
else
{
hater = NULL;
}
}
return true;
}
FUNC(LS_Thing_ProjectileAimed)
// Thing_ProjectileAimed (tid, type, speed, target, newtid)
{
return P_Thing_Projectile (arg0, it, arg1, NULL, 0, arg2<<(FRACBITS-3), 0, arg3, it, 0, arg4, false);
}
FUNC(LS_Thing_ProjectileIntercept)
// Thing_ProjectileIntercept (tid, type, speed, target, newtid)
{
return P_Thing_Projectile (arg0, it, arg1, NULL, 0, arg2<<(FRACBITS-3), 0, arg3, it, 0, arg4, true);
}
// [BC] added newtid for next two
FUNC(LS_Thing_Spawn)
// Thing_Spawn (tid, type, angle, newtid)
{
return P_Thing_Spawn (arg0, it, arg1, BYTEANGLE(arg2), true, arg3);
}
FUNC(LS_Thing_SpawnNoFog)
// Thing_SpawnNoFog (tid, type, angle, newtid)
{
return P_Thing_Spawn (arg0, it, arg1, BYTEANGLE(arg2), false, arg3);
}
FUNC(LS_Thing_SpawnFacing)
// Thing_SpawnFacing (tid, type, nofog, newtid)
{
return P_Thing_Spawn (arg0, it, arg1, ANGLE_MAX, arg2 ? false : true, arg3);
}
static bool DoThingRaise(AActor *thing)
{
if (thing == NULL)
return false; // not valid
if (!(thing->flags & MF_CORPSE) )
return true; // not a corpse
if (thing->tics != -1)
return true; // not lying still yet
FState * RaiseState = thing->FindState(NAME_Raise);
if (RaiseState == NULL)
return true; // monster doesn't have a raise state
AActor *info = thing->GetDefault ();
thing->momx = thing->momy = 0;
// [RH] Check against real height and radius
fixed_t oldheight = thing->height;
fixed_t oldradius = thing->radius;
int oldflags = thing->flags;
thing->flags |= MF_SOLID;
thing->height = info->height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius
if (!P_CheckPosition (thing, thing->x, thing->y))
{
thing->flags = oldflags;
thing->radius = oldradius;
thing->height = oldheight;
return false;
}
S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);
thing->SetState (RaiseState);
thing->flags = info->flags;
thing->flags2 = info->flags2;
thing->flags3 = info->flags3;
thing->flags4 = info->flags4;
thing->health = info->health;
thing->target = NULL;
thing->lastenemy = NULL;
// [RH] If it's a monster, it gets to count as another kill
if (thing->CountsAsKill())
{
level.total_monsters++;
}
return true;
}
FUNC(LS_Thing_Raise)
// Thing_Raise(tid)
{
AActor * target;
bool ok = false;
if (arg0==0)
{
ok = DoThingRaise (it);
}
else
{
TActorIterator<AActor> iterator (arg0);
while ( (target = iterator.Next ()) )
{
ok |= DoThingRaise(target);
}
}
return ok;
}
FUNC(LS_Thing_Stop)
// Thing_Stop(tid)
{
AActor * target;
bool ok = false;
if (arg0==0)
{
if (it != NULL)
{
it->momx = it->momy = it->momz = 0;
if (it->player != NULL) it->player->momx = it->player->momy = 0;
ok = true;
}
}
else
{
TActorIterator<AActor> iterator (arg0);
while ( (target = iterator.Next ()) )
{
target->momx = target->momy = target->momz = 0;
if (target->player != NULL) target->player->momx = target->player->momy = 0;
ok = true;
}
}
return ok;
}
FUNC(LS_Thing_SetGoal)
// Thing_SetGoal (tid, goal, delay, chasegoal)
{
TActorIterator<AActor> selfiterator (arg0);
NActorIterator goaliterator (NAME_PatrolPoint, arg1);
AActor *self;
AActor *goal = goaliterator.Next ();
bool ok = false;
while ( (self = selfiterator.Next ()) )
{
ok = true;
if (self->flags & MF_SHOOTABLE)
{
self->goal = goal;
if (arg3 == 0) self->flags5 &=~ MF5_CHASEGOAL;
else self->flags5 |= MF5_CHASEGOAL;
if (self->target == NULL)
{
self->reactiontime = arg2 * TICRATE;
}
}
}
return ok;
}
FUNC(LS_Thing_Move) // [BC]
// Thing_Move (tid, mapspot, nofog)
{
return P_Thing_Move (arg0, it, arg1, arg2 ? false : true);
}
FUNC(LS_Thing_SetTranslation)
// Thing_SetTranslation (tid, range)
{
TActorIterator<AActor> iterator (arg0);
int range;
AActor *target;
bool ok = false;
if (arg1 == -1 && it != NULL)
{
range = it->Translation;
}
else if (arg1 >= 1 && arg1 < MAX_ACS_TRANSLATIONS)
{
range = TRANSLATION(TRANSLATION_LevelScripted, (arg1-1));
}
else
{
range = 0;
}
if (arg0 == 0)
{
if (it != NULL)
{
ok = true;
it->Translation = range==0? it->GetDefault()->Translation : range;
}
}
else
{
while ( (target = iterator.Next ()) )
{
ok = true;
target->Translation = range==0? target->GetDefault()->Translation : range;
}
}
return ok;
}
FUNC(LS_ACS_Execute)
// ACS_Execute (script, map, s_arg1, s_arg2, s_arg3)
{
level_info_t *info;
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
if (arg1 == 0)
return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, false, false);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else if ((info = FindLevelByNum (arg1)) )
return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, false, false);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else return false;
}
FUNC(LS_ACS_ExecuteAlways)
// ACS_ExecuteAlways (script, map, s_arg1, s_arg2, s_arg3)
{
level_info_t *info;
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
if (arg1 == 0)
return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, true, false);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else if ((info = FindLevelByNum (arg1)) )
return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, true, false);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else return false;
}
FUNC(LS_ACS_LockedExecute)
// ACS_LockedExecute (script, map, s_arg1, s_arg2, lock)
{
if (arg4 && !P_CheckKeys (it, arg4, true))
return false;
else
return LS_ACS_Execute (ln, it, backSide, arg0, arg1, arg2, arg3, 0);
}
FUNC(LS_ACS_LockedExecuteDoor)
// ACS_LockedExecuteDoor (script, map, s_arg1, s_arg2, lock)
{
if (arg4 && !P_CheckKeys (it, arg4, false))
return false;
else
return LS_ACS_Execute (ln, it, backSide, arg0, arg1, arg2, arg3, 0);
}
FUNC(LS_ACS_ExecuteWithResult)
// ACS_ExecuteWithResult (script, s_arg1, s_arg2, s_arg3)
{
// This is like ACS_ExecuteAlways, except the script is always run on
// the current map, and the return value is whatever the script sets
// with SetResultValue.
return P_StartScript (it, ln, arg0, level.mapname, backSide, arg1, arg2, arg3, true, true);
}
FUNC(LS_ACS_Suspend)
// ACS_Suspend (script, map)
{
level_info_t *info;
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
if (arg1 == 0)
P_SuspendScript (arg0, level.mapname);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else if ((info = FindLevelByNum (arg1)) )
P_SuspendScript (arg0, info->mapname);
return true;
}
FUNC(LS_ACS_Terminate)
// ACS_Terminate (script, map)
{
level_info_t *info;
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
if (arg1 == 0)
P_TerminateScript (arg0, level.mapname);
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
else if ((info = FindLevelByNum (arg1)) )
P_TerminateScript (arg0, info->mapname);
return true;
}
FUNC(LS_FloorAndCeiling_LowerByValue)
// FloorAndCeiling_LowerByValue (tag, speed, height)
{
return EV_DoElevator (ln, DElevator::elevateLower, SPEED(arg1), arg2*FRACUNIT, arg0);
}
FUNC(LS_FloorAndCeiling_RaiseByValue)
// FloorAndCeiling_RaiseByValue (tag, speed, height)
{
return EV_DoElevator (ln, DElevator::elevateRaise, SPEED(arg1), arg2*FRACUNIT, arg0);
}
FUNC(LS_FloorAndCeiling_LowerRaise)
// FloorAndCeiling_LowerRaise (tag, fspeed, cspeed)
{
return EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg2), 0, 0, 0, 0, 0, false) |
EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, 0, false);
}
FUNC(LS_Elevator_MoveToFloor)
// Elevator_MoveToFloor (tag, speed)
{
return EV_DoElevator (ln, DElevator::elevateCurrent, SPEED(arg1), 0, arg0);
}
FUNC(LS_Elevator_RaiseToNearest)
// Elevator_RaiseToNearest (tag, speed)
{
return EV_DoElevator (ln, DElevator::elevateUp, SPEED(arg1), 0, arg0);
}
FUNC(LS_Elevator_LowerToNearest)
// Elevator_LowerToNearest (tag, speed)
{
return EV_DoElevator (ln, DElevator::elevateDown, SPEED(arg1), 0, arg0);
}
FUNC(LS_Light_ForceLightning)
- Added more options to Light_ForceLightning: Setting the first arg to 0 will behave as before, setting it to 1 will create exactly one lighting and setting it to 2 will terminate lightning for the current level completely. And it will also work on maps that don't have lightning set in MAPINFO now. - Added: Sector movement that causes deep water to change its height now will trigger associated sector actions and adjust the actor's water level. - Fixed: The serializer for side_t::part never read the texture information from a savegame. - Fixed: side_t::StopInterpolation called setinterpolation instead of stopinterpolation. Also moved the clearinterpolation call in P_SetupLevel after the P_FreeLevelData to make absolutely sure that nothing in there can leave an interpolator behind by accident. - Applied Linux fixes by Jim. SBARINFO update by Blzut3: - Fixed: the playerclass command needed a null pointer check to prevent crashing on respawn. - Fixed: Mug Shot states were not reset on respawn. - Removed keepoffsets flag since apparently it was keeping the offsets by default. The means that the only thing not affected by the offsets was using nullimage as a background. Since I wasn't able to get a result I liked I'm going to say that if you want a black background with high res positioning you will have to create your own bar image. Maybe I'll fix it some other time. - Added: monospacefonts variable which allows for all of the fonts to be monospaced by a specified character (from their fontset of corse). - Made SBarInfo recognize the bar names for the Strife popups but they don't do anything beyond that. The names are: popuplog, popupkeys, and popupstatus. - Started converting the drawing routine to be more flexable towards high resolution status bars. (Only did one call so far.) NOTE: ZDoom's new sound code is not in yet because it's still too broken for serious use. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@69 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-22 14:50:30 +00:00
// Light_ForceLightning (mode)
{
- Added more options to Light_ForceLightning: Setting the first arg to 0 will behave as before, setting it to 1 will create exactly one lighting and setting it to 2 will terminate lightning for the current level completely. And it will also work on maps that don't have lightning set in MAPINFO now. - Added: Sector movement that causes deep water to change its height now will trigger associated sector actions and adjust the actor's water level. - Fixed: The serializer for side_t::part never read the texture information from a savegame. - Fixed: side_t::StopInterpolation called setinterpolation instead of stopinterpolation. Also moved the clearinterpolation call in P_SetupLevel after the P_FreeLevelData to make absolutely sure that nothing in there can leave an interpolator behind by accident. - Applied Linux fixes by Jim. SBARINFO update by Blzut3: - Fixed: the playerclass command needed a null pointer check to prevent crashing on respawn. - Fixed: Mug Shot states were not reset on respawn. - Removed keepoffsets flag since apparently it was keeping the offsets by default. The means that the only thing not affected by the offsets was using nullimage as a background. Since I wasn't able to get a result I liked I'm going to say that if you want a black background with high res positioning you will have to create your own bar image. Maybe I'll fix it some other time. - Added: monospacefonts variable which allows for all of the fonts to be monospaced by a specified character (from their fontset of corse). - Made SBarInfo recognize the bar names for the Strife popups but they don't do anything beyond that. The names are: popuplog, popupkeys, and popupstatus. - Started converting the drawing routine to be more flexable towards high resolution status bars. (Only did one call so far.) NOTE: ZDoom's new sound code is not in yet because it's still too broken for serious use. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@69 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-22 14:50:30 +00:00
P_ForceLightning (arg0);
return true;
}
FUNC(LS_Light_RaiseByValue)
// Light_RaiseByValue (tag, value)
{
EV_LightChange (arg0, arg1);
return true;
}
FUNC(LS_Light_LowerByValue)
// Light_LowerByValue (tag, value)
{
EV_LightChange (arg0, -arg1);
return true;
}
FUNC(LS_Light_ChangeToValue)
// Light_ChangeToValue (tag, value)
{
EV_LightTurnOn (arg0, arg1);
return true;
}
FUNC(LS_Light_Fade)
// Light_Fade (tag, value, tics);
{
EV_StartLightFading (arg0, arg1, TICS(arg2));
return true;
}
FUNC(LS_Light_Glow)
// Light_Glow (tag, upper, lower, tics)
{
EV_StartLightGlowing (arg0, arg1, arg2, TICS(arg3));
return true;
}
FUNC(LS_Light_Flicker)
// Light_Flicker (tag, upper, lower)
{
EV_StartLightFlickering (arg0, arg1, arg2);
return true;
}
FUNC(LS_Light_Strobe)
// Light_Strobe (tag, upper, lower, u-tics, l-tics)
{
EV_StartLightStrobing (arg0, arg1, arg2, TICS(arg3), TICS(arg4));
return true;
}
FUNC(LS_Light_StrobeDoom)
// Light_StrobeDoom (tag, u-tics, l-tics)
{
EV_StartLightStrobing (arg0, TICS(arg1), TICS(arg2));
return true;
}
FUNC(LS_Light_MinNeighbor)
// Light_MinNeighbor (tag)
{
EV_TurnTagLightsOff (arg0);
return true;
}
FUNC(LS_Light_MaxNeighbor)
// Light_MaxNeighbor (tag)
{
EV_LightTurnOn (arg0, -1);
return true;
}
FUNC(LS_Light_Stop)
// Light_Stop (tag)
{
EV_StopLightEffect (arg0);
return true;
}
FUNC(LS_Radius_Quake)
// Radius_Quake (intensity, duration, damrad, tremrad, tid)
{
return P_StartQuake (it, arg4, arg0, arg1, arg2, arg3);
}
FUNC(LS_UsePuzzleItem)
// UsePuzzleItem (item, script)
{
AInventory *item;
if (!it) return false;
// Check player's inventory for puzzle item
for (item = it->Inventory; item != NULL; item = item->Inventory)
{
if (item->IsKindOf (RUNTIME_CLASS(APuzzleItem)))
{
if (static_cast<APuzzleItem*>(item)->PuzzleItemNumber == arg0)
{
if (it->UseInventory (item))
{
return true;
}
break;
}
}
}
// [RH] Say "hmm" if you don't have the puzzle item
S_Sound (it, CHAN_VOICE, "*puzzfail", 1, ATTN_IDLE);
return false;
}
FUNC(LS_Sector_ChangeSound)
// Sector_ChangeSound (tag, sound)
{
int secNum;
bool rtn;
if (!arg0)
return false;
secNum = -1;
rtn = false;
while ((secNum = P_FindSectorFromTag (arg0, secNum)) >= 0)
{
sectors[secNum].seqType = arg1;
rtn = true;
}
return rtn;
}
- Fixed: The hitscan tracer had the current sector point to a temporary variable when 3D floors were involved. Update to ZDoom r965: - Fixed: SPAC_AnyCross didn't work. - Fixed: Pushable doors must also check for SPAC_MPush. - Fixed: P_LoadThings2 did not adjust the byte order for the thingid field. - Changed: HIRESTEX 'define' textures now replace existing textures of type MiscPatch with the same name. - Added UDMF line trigger types MonsterUse and MonsterPush. - Separated skill and class filter bits from FMapThing::flags so that UDMF can define up to 16 of each. Also separated easy/baby and hard/nightmare and changed default MAPINFO definitions. - Fixed: FWadCollection::MergeLumps() did not initialize the flags for any marker lumps it inserted. - Fixed: Need write barriers when modifying SequenceListHead. - Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of GUS patch flags, envelopes, and volume levels, while trying to be closer to TiMidity++ than original TiMidity. - Renamed timidity_config and timidity_voices to midi_config and midi_voices respectively. - Changed: Crosshair drawing uses the current player class's default health instead of 100 to calculate the color for the crosshair. - Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated all user settable flags from MoreFlags into their own Flags variable. - Reduced volume, expression, and panning controllers back to 7 bits. - Added very basic Soundfont support to the internal TiMidity. Things missing: filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or may not be compatible with TiMidity++'s soundfont extensions. - Changed all thing coordinates that were stored as shorts into fixed_t. - Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so that it is easier to add new features in the UDMF map format. - Added some initial code to read UDMF maps. - Added support for quoted strings to the TiMidity config parser. - Split off the slope creation code from p_Setup.cpp into its own file. - Separated the linedef activation types into a bit mask that allows combination of all types on the same linedef. Also added a 'first side only' flag. This is not usable from Hexen or Doom format maps though but in preparation of the UDMF format discussed here: http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/ - Changed linedef's alpha property from a byte to fixed point after seeing that 255 wasn't handled to be fully opaque. - fixed a GCC warning in fmodsound.cpp - Fixed: Warped textures didn't work anymore because the default speed was 0. - Fixed: I had instrument vibrato setting the tremolo_sweep_increment value in the instrument loader, effectively disabling vibrato. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
FUNC(LS_Sector_ChangeFlags)
// Sector_ChangeFlags (tag, set, clear)
{
int secNum;
bool rtn;
if (!arg0)
return false;
secNum = -1;
rtn = false;
while ((secNum = P_FindSectorFromTag (arg0, secNum)) >= 0)
{
sectors[secNum].Flags = (sectors[secNum].Flags | arg1) & ~arg2;
rtn = true;
}
return rtn;
}
struct FThinkerCollection
{
int RefNum;
DThinker *Obj;
};
static TArray<FThinkerCollection> Collection;
void AdjustPusher (int tag, int magnitude, int angle, DPusher::EPusher type)
{
// Find pushers already attached to the sector, and change their parameters.
{
TThinkerIterator<DPusher> iterator;
FThinkerCollection collect;
while ( (collect.Obj = iterator.Next ()) )
{
if ((collect.RefNum = ((DPusher *)collect.Obj)->CheckForSectorMatch (type, tag)) >= 0)
{
((DPusher *)collect.Obj)->ChangeValues (magnitude, angle);
Collection.Push (collect);
}
}
}
size_t numcollected = Collection.Size ();
int secnum = -1;
// Now create pushers for any sectors that don't already have them.
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
{
unsigned int i;
for (i = 0; i < numcollected; i++)
{
if (Collection[i].RefNum == sectors[secnum].tag)
break;
}
if (i == numcollected)
{
new DPusher (type, NULL, magnitude, angle, NULL, secnum);
}
}
Collection.Clear ();
}
FUNC(LS_Sector_SetWind)
// Sector_SetWind (tag, amount, angle)
{
if (ln || arg3)
return false;
AdjustPusher (arg0, arg1, arg2, DPusher::p_wind);
return true;
}
FUNC(LS_Sector_SetCurrent)
// Sector_SetCurrent (tag, amount, angle)
{
if (ln || arg3)
return false;
AdjustPusher (arg0, arg1, arg2, DPusher::p_current);
return true;
}
FUNC(LS_Sector_SetFriction)
// Sector_SetFriction (tag, amount)
{
P_SetSectorFriction (arg0, arg1, true);
return true;
}
FUNC(LS_Sector_SetLink)
// Sector_SetLink (controltag, linktag, floor/ceiling, movetype)
{
if (arg0 != 0) // control tag == 0 is for static initialization and must not be handled here
{
int control = P_FindSectorFromTag(arg0, -1);
if (control != 0)
{
return P_AddSectorLinks(&sectors[control], arg1, arg2, arg3);
}
}
return false;
}
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy, int Where)
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
Where &=7;
if (Where == 0) return;
if ((dx | dy) == 0)
{
// Special case: Remove the scroller, because the deltas are both 0.
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
DScroller *scroller;
while ( (scroller = iterator.Next ()) )
{
int wallnum = scroller->GetWallNum ();
if (wallnum >= 0 && lines[sides[wallnum].linenum].id == id &&
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
lines[sides[wallnum].linenum].sidenum[sidechoice] == (DWORD)wallnum &&
Where == scroller->GetScrollParts())
{
scroller->Destroy ();
}
}
}
else
{
// Find scrollers already attached to the matching walls, and change
// their rates.
{
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
FThinkerCollection collect;
while ( (collect.Obj = iterator.Next ()) )
{
if ((collect.RefNum = ((DScroller *)collect.Obj)->GetWallNum ()) != -1 &&
lines[sides[collect.RefNum].linenum].id == id &&
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
lines[sides[collect.RefNum].linenum].sidenum[sidechoice] == (DWORD)collect.RefNum &&
Where == ((DScroller *)collect.Obj)->GetScrollParts())
{
((DScroller *)collect.Obj)->SetRate (dx, dy);
Collection.Push (collect);
}
}
}
size_t numcollected = Collection.Size ();
int linenum = -1;
// Now create scrollers for any walls that don't already have them.
while ((linenum = P_FindLineFromID (id, linenum)) >= 0)
{
unsigned int i;
for (i = 0; i < numcollected; i++)
{
if ((DWORD)Collection[i].RefNum == lines[linenum].sidenum[sidechoice])
break;
}
if (i == numcollected)
{
if (lines[linenum].sidenum[sidechoice] != NO_SIDE)
{
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
new DScroller (DScroller::sc_side, dx, dy, -1, lines[linenum].sidenum[sidechoice], 0, Where);
}
}
}
Collection.Clear ();
}
}
FUNC(LS_Scroll_Texture_Both)
// Scroll_Texture_Both (id, left, right, up, down)
{
if (arg0 == 0)
return false;
fixed_t dx = (arg1 - arg2) * (FRACUNIT/64);
fixed_t dy = (arg4 - arg3) * (FRACUNIT/64);
int sidechoice;
if (arg0 < 0)
{
sidechoice = 1;
arg0 = -arg0;
}
else
{
sidechoice = 0;
}
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
SetWallScroller (arg0, sidechoice, dx, dy, 7);
return true;
}
FUNC(LS_Scroll_Wall)
// Scroll_Wall (id, x, y, side, flags)
{
if (arg0 == 0)
return false;
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
SetWallScroller (arg0, !!arg3, arg1, arg2, arg4);
return true;
}
static void SetScroller (int tag, DScroller::EScrollType type, fixed_t dx, fixed_t dy)
{
TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
DScroller *scroller;
int i;
// Check if there is already a scroller for this tag
// If at least one sector with this tag is scrolling, then they all are.
// If the deltas are both 0, we don't remove the scroller, because a
// displacement/accelerative scroller might have been set up, and there's
// no way to create one after the level is fully loaded.
i = 0;
while ( (scroller = iterator.Next ()) )
{
if (scroller->IsType (type))
{
if (sectors[scroller->GetAffectee ()].tag == tag)
{
i++;
scroller->SetRate (dx, dy);
}
}
}
if (i > 0 || (dx|dy) == 0)
{
return;
}
// Need to create scrollers for the sector(s)
for (i = -1; (i = P_FindSectorFromTag (tag, i)) >= 0; )
{
new DScroller (type, dx, dy, -1, i, 0);
}
}
// NOTE: For the next two functions, x-move and y-move are
// 0-based, not 128-based as they are if they appear on lines.
// Note also that parameter ordering is different.
FUNC(LS_Scroll_Floor)
// Scroll_Floor (tag, x-move, y-move, s/c)
{
fixed_t dx = arg1 * FRACUNIT/32;
fixed_t dy = arg2 * FRACUNIT/32;
if (arg3 == 0 || arg3 == 2)
{
SetScroller (arg0, DScroller::sc_floor, -dx, dy);
}
else
{
SetScroller (arg0, DScroller::sc_floor, 0, 0);
}
if (arg3 > 0)
{
SetScroller (arg0, DScroller::sc_carry, dx, dy);
}
else
{
SetScroller (arg0, DScroller::sc_carry, 0, 0);
}
return true;
}
FUNC(LS_Scroll_Ceiling)
// Scroll_Ceiling (tag, x-move, y-move, 0)
{
fixed_t dx = arg1 * FRACUNIT/32;
fixed_t dy = arg2 * FRACUNIT/32;
SetScroller (arg0, DScroller::sc_ceiling, -dx, dy);
return true;
}
FUNC(LS_PointPush_SetForce)
// PointPush_SetForce ()
{
return false;
}
FUNC(LS_Sector_SetDamage)
// Sector_SetDamage (tag, amount, mod)
{
// The sector still stores the mod in its old format because
// adding an FName to the sector_t structure might cause
// problems by adding an unwanted constructor.
// Since it doesn't really matter whether the type is translated
// here or in P_PlayerInSpecialSector I think it's the best solution.
int secnum = -1;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0) {
sectors[secnum].damage = arg1;
sectors[secnum].mod = arg2;
}
return true;
}
FUNC(LS_Sector_SetGravity)
// Sector_SetGravity (tag, intpart, fracpart)
{
int secnum = -1;
float gravity;
if (arg2 > 99)
arg2 = 99;
gravity = (float)arg1 + (float)arg2 * 0.01f;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
sectors[secnum].gravity = gravity;
return true;
}
FUNC(LS_Sector_SetColor)
// Sector_SetColor (tag, r, g, b, desaturate)
{
int secnum = -1;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sectors[secnum].SetColor(arg1, arg2, arg3, arg4);
}
return true;
}
FUNC(LS_Sector_SetFade)
// Sector_SetFade (tag, r, g, b)
{
int secnum = -1;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sectors[secnum].SetFade(arg1, arg2, arg3);
}
return true;
}
FUNC(LS_Sector_SetCeilingPanning)
// Sector_SetCeilingPanning (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xofs = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yofs = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sectors[secnum].SetXOffset(sector_t::ceiling, xofs);
sectors[secnum].SetYOffset(sector_t::ceiling, yofs);
}
return true;
}
FUNC(LS_Sector_SetFloorPanning)
// Sector_SetFloorPanning (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xofs = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yofs = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sectors[secnum].SetXOffset(sector_t::floor, xofs);
sectors[secnum].SetYOffset(sector_t::floor, yofs);
}
return true;
}
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!): Full disclosure of the entire project's source code, except for third party libraries is mandartory. (NOTE: This clause is non-negotiable!) - Fixed: The alpha for 3D floors was always set to 0. Update to ZDoom r1056: - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting code to process their messages. This was necessary to handle the %zu format option used in some memory allocation failure messages. - Fixed: The flat texture scaling action specials were completely broken. - The sound code now handles restarting looping sounds itself. As far as the rest of the game is concerned, these sounds will never stop once they have been started until they are explicitly stopped. If they are evicted from their channels, the sound code will restart them as soon as possible. This means that instead of this: if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1)) { S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); } The following is now just as effective: S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); There are also a couple of other ramifications presented by this change: * The full state of the sound system (sans music) is now stored in save games. Any sounds that were playing when you saved will still be playing when you load. (Try saving while Korax is making a speech in Hexen to hear it.) * Using snd_reset will also preserve any playing sounds. * Movie playback is disabled, probably forever. I did not want to update the MovieDisable/ResumeSound stuff for the new eviction tracking code. A properly updated movie player will use the VMR, which doesn't need these functions, since it would pipe the sound straight through the sound system like everything else, so I decided to dump them now, which leaves the movie player in a totally unworkable state. - Removed some unused constant definitions from sc_man.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
FUNC(LS_Sector_SetFloorScale)
// Sector_SetFloorScale (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xscale = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yscale = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
if (xscale)
xscale = FixedDiv (FRACUNIT, xscale);
if (yscale)
yscale = FixedDiv (FRACUNIT, yscale);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
sectors[secnum].SetXScale(sector_t::floor, xscale);
if (yscale)
sectors[secnum].SetYScale(sector_t::floor, yscale);
}
return true;
}
FUNC(LS_Sector_SetCeilingScale)
// Sector_SetCeilingScale (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xscale = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yscale = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
if (xscale)
xscale = FixedDiv (FRACUNIT, xscale);
if (yscale)
yscale = FixedDiv (FRACUNIT, yscale);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!): Full disclosure of the entire project's source code, except for third party libraries is mandartory. (NOTE: This clause is non-negotiable!) - Fixed: The alpha for 3D floors was always set to 0. Update to ZDoom r1056: - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting code to process their messages. This was necessary to handle the %zu format option used in some memory allocation failure messages. - Fixed: The flat texture scaling action specials were completely broken. - The sound code now handles restarting looping sounds itself. As far as the rest of the game is concerned, these sounds will never stop once they have been started until they are explicitly stopped. If they are evicted from their channels, the sound code will restart them as soon as possible. This means that instead of this: if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1)) { S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); } The following is now just as effective: S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); There are also a couple of other ramifications presented by this change: * The full state of the sound system (sans music) is now stored in save games. Any sounds that were playing when you saved will still be playing when you load. (Try saving while Korax is making a speech in Hexen to hear it.) * Using snd_reset will also preserve any playing sounds. * Movie playback is disabled, probably forever. I did not want to update the MovieDisable/ResumeSound stuff for the new eviction tracking code. A properly updated movie player will use the VMR, which doesn't need these functions, since it would pipe the sound straight through the sound system like everything else, so I decided to dump them now, which leaves the movie player in a totally unworkable state. - Removed some unused constant definitions from sc_man.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
sectors[secnum].SetXScale(sector_t::ceiling, xscale);
if (yscale)
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!): Full disclosure of the entire project's source code, except for third party libraries is mandartory. (NOTE: This clause is non-negotiable!) - Fixed: The alpha for 3D floors was always set to 0. Update to ZDoom r1056: - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting code to process their messages. This was necessary to handle the %zu format option used in some memory allocation failure messages. - Fixed: The flat texture scaling action specials were completely broken. - The sound code now handles restarting looping sounds itself. As far as the rest of the game is concerned, these sounds will never stop once they have been started until they are explicitly stopped. If they are evicted from their channels, the sound code will restart them as soon as possible. This means that instead of this: if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1)) { S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); } The following is now just as effective: S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); There are also a couple of other ramifications presented by this change: * The full state of the sound system (sans music) is now stored in save games. Any sounds that were playing when you saved will still be playing when you load. (Try saving while Korax is making a speech in Hexen to hear it.) * Using snd_reset will also preserve any playing sounds. * Movie playback is disabled, probably forever. I did not want to update the MovieDisable/ResumeSound stuff for the new eviction tracking code. A properly updated movie player will use the VMR, which doesn't need these functions, since it would pipe the sound straight through the sound system like everything else, so I decided to dump them now, which leaves the movie player in a totally unworkable state. - Removed some unused constant definitions from sc_man.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
sectors[secnum].SetYScale(sector_t::ceiling, yscale);
}
return true;
}
FUNC(LS_Sector_SetFloorScale2)
// Sector_SetFloorScale2 (tag, x-factor, y-factor)
{
int secnum = -1;
if (arg1)
arg1 = FixedDiv (FRACUNIT, arg1);
if (arg2)
arg2 = FixedDiv (FRACUNIT, arg2);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (arg1)
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sectors[secnum].SetXScale(sector_t::floor, arg1);
if (arg2)
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!): Full disclosure of the entire project's source code, except for third party libraries is mandartory. (NOTE: This clause is non-negotiable!) - Fixed: The alpha for 3D floors was always set to 0. Update to ZDoom r1056: - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting code to process their messages. This was necessary to handle the %zu format option used in some memory allocation failure messages. - Fixed: The flat texture scaling action specials were completely broken. - The sound code now handles restarting looping sounds itself. As far as the rest of the game is concerned, these sounds will never stop once they have been started until they are explicitly stopped. If they are evicted from their channels, the sound code will restart them as soon as possible. This means that instead of this: if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1)) { S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); } The following is now just as effective: S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); There are also a couple of other ramifications presented by this change: * The full state of the sound system (sans music) is now stored in save games. Any sounds that were playing when you saved will still be playing when you load. (Try saving while Korax is making a speech in Hexen to hear it.) * Using snd_reset will also preserve any playing sounds. * Movie playback is disabled, probably forever. I did not want to update the MovieDisable/ResumeSound stuff for the new eviction tracking code. A properly updated movie player will use the VMR, which doesn't need these functions, since it would pipe the sound straight through the sound system like everything else, so I decided to dump them now, which leaves the movie player in a totally unworkable state. - Removed some unused constant definitions from sc_man.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
sectors[secnum].SetYScale(sector_t::floor, arg2);
}
return true;
}
FUNC(LS_Sector_SetCeilingScale2)
// Sector_SetFloorScale2 (tag, x-factor, y-factor)
{
int secnum = -1;
if (arg1)
arg1 = FixedDiv (FRACUNIT, arg1);
if (arg2)
arg2 = FixedDiv (FRACUNIT, arg2);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (arg1)
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
if (arg2)
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!): Full disclosure of the entire project's source code, except for third party libraries is mandartory. (NOTE: This clause is non-negotiable!) - Fixed: The alpha for 3D floors was always set to 0. Update to ZDoom r1056: - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting code to process their messages. This was necessary to handle the %zu format option used in some memory allocation failure messages. - Fixed: The flat texture scaling action specials were completely broken. - The sound code now handles restarting looping sounds itself. As far as the rest of the game is concerned, these sounds will never stop once they have been started until they are explicitly stopped. If they are evicted from their channels, the sound code will restart them as soon as possible. This means that instead of this: if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1)) { S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); } The following is now just as effective: S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); There are also a couple of other ramifications presented by this change: * The full state of the sound system (sans music) is now stored in save games. Any sounds that were playing when you saved will still be playing when you load. (Try saving while Korax is making a speech in Hexen to hear it.) * Using snd_reset will also preserve any playing sounds. * Movie playback is disabled, probably forever. I did not want to update the MovieDisable/ResumeSound stuff for the new eviction tracking code. A properly updated movie player will use the VMR, which doesn't need these functions, since it would pipe the sound straight through the sound system like everything else, so I decided to dump them now, which leaves the movie player in a totally unworkable state. - Removed some unused constant definitions from sc_man.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
sectors[secnum].SetYScale(sector_t::ceiling, arg2);
}
return true;
}
FUNC(LS_Sector_SetRotation)
// Sector_SetRotation (tag, floor-angle, ceiling-angle)
{
int secnum = -1;
angle_t ceiling = arg2 * ANGLE_1;
angle_t floor = arg1 * ANGLE_1;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
sectors[secnum].SetAngle(sector_t::floor, floor);
sectors[secnum].SetAngle(sector_t::ceiling, ceiling);
}
return true;
}
FUNC(LS_Line_AlignCeiling)
// Line_AlignCeiling (lineid, side)
{
int line = P_FindLineFromID (arg0, -1);
bool ret = 0;
if (line < 0)
I_Error ("Sector_AlignCeiling: Lineid %d is undefined", arg0);
do
{
ret |= R_AlignFlat (line, !!arg1, 1);
} while ( (line = P_FindLineFromID (arg0, line)) >= 0);
return ret;
}
FUNC(LS_Line_AlignFloor)
// Line_AlignFloor (lineid, side)
{
int line = P_FindLineFromID (arg0, -1);
bool ret = 0;
if (line < 0)
I_Error ("Sector_AlignFloor: Lineid %d is undefined", arg0);
do
{
ret |= R_AlignFlat (line, !!arg1, 0);
} while ( (line = P_FindLineFromID (arg0, line)) >= 0);
return ret;
}
FUNC(LS_Line_SetTextureOffset)
// Line_SetTextureOffset (id, x, y, side, flags)
{
const fixed_t NO_CHANGE = 32767<<FRACBITS;
if (arg0 == 0 || arg3 < 0 || arg3 > 1)
return false;
for(int line = -1; (line = P_FindLineFromID (arg0, line)) >= 0; )
{
if (lines[line].sidenum[arg3] != NO_SIDE)
{
side_t *side = &sides[lines[line].sidenum[arg3]];
if ((arg4&8)==0)
{
// set
if (arg1 != NO_CHANGE)
{
if (arg4&1) side->SetTextureXOffset(side_t::top, arg1);
if (arg4&2) side->SetTextureXOffset(side_t::mid, arg1);
if (arg4&4) side->SetTextureXOffset(side_t::bottom, arg1);
}
if (arg2 != NO_CHANGE)
{
if (arg4&1) side->SetTextureYOffset(side_t::top, arg2);
if (arg4&2) side->SetTextureYOffset(side_t::mid, arg2);
if (arg4&4) side->SetTextureYOffset(side_t::bottom, arg2);
}
}
else
{
// add
if (arg1 != NO_CHANGE)
{
if (arg4&1) side->AddTextureXOffset(side_t::top, arg1);
if (arg4&2) side->AddTextureXOffset(side_t::mid, arg1);
if (arg4&4) side->AddTextureXOffset(side_t::bottom, arg1);
}
if (arg2 != NO_CHANGE)
{
if (arg4&1) side->AddTextureYOffset(side_t::top, arg2);
if (arg4&2) side->AddTextureYOffset(side_t::mid, arg2);
if (arg4&4) side->AddTextureYOffset(side_t::bottom, arg2);
}
}
}
}
return true;
}
FUNC(LS_ChangeCamera)
// ChangeCamera (tid, who, revert?)
{
AActor *camera;
if (arg0 != 0)
{
FActorIterator iterator (arg0);
camera = iterator.Next ();
}
else
{
camera = NULL;
}
if (!it || !it->player || arg1)
{
int i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
AActor *oldcamera = players[i].camera;
if (camera)
{
players[i].camera = camera;
if (arg2)
players[i].cheats |= CF_REVERTPLEASE;
}
else
{
players[i].camera = players[i].mo;
players[i].cheats &= ~CF_REVERTPLEASE;
}
if (oldcamera != players[i].camera)
{
R_ClearPastViewer (players[i].camera);
}
}
}
else
{
AActor *oldcamera = it->player->camera;
if (camera)
{
it->player->camera = camera;
if (arg2)
it->player->cheats |= CF_REVERTPLEASE;
}
else
{
it->player->camera = it;
it->player->cheats &= ~CF_REVERTPLEASE;
}
if (oldcamera != it->player->camera)
{
R_ClearPastViewer (it->player->camera);
}
}
return true;
}
enum
{
PROP_FROZEN,
PROP_NOTARGET,
PROP_INSTANTWEAPONSWITCH,
PROP_FLY,
PROP_TOTALLYFROZEN,
PROP_INVULNERABILITY,
PROP_STRENGTH,
PROP_INVISIBILITY,
PROP_RADIATIONSUIT,
PROP_ALLMAP,
PROP_INFRARED,
PROP_WEAPONLEVEL2,
PROP_FLIGHT,
PROP_UNUSED1,
PROP_UNUSED2,
PROP_SPEED,
};
FUNC(LS_SetPlayerProperty)
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
// SetPlayerProperty (who, value, which)
// who == 0: set activator's property
// who == 1: set every player's property
{
int mask = 0;
if ((!it || !it->player) && !arg0)
return false;
// Add or remove a power
if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED)
{
static const PClass *powers[11] =
{
RUNTIME_CLASS(APowerInvulnerable),
RUNTIME_CLASS(APowerStrength),
RUNTIME_CLASS(APowerInvisibility),
RUNTIME_CLASS(APowerIronFeet),
NULL, // MapRevealer
RUNTIME_CLASS(APowerLightAmp),
RUNTIME_CLASS(APowerWeaponLevel2),
RUNTIME_CLASS(APowerFlight),
NULL,
NULL,
RUNTIME_CLASS(APowerSpeed)
};
int power = arg2 - PROP_INVULNERABILITY;
if (power > 4 && powers[power] == NULL)
{
return false;
}
if (arg0 == 0)
{
if (arg1)
{ // Give power to activator
if (power != 4)
{
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
APowerup *item = static_cast<APowerup*>(it->GiveInventoryType (powers[power]));
if (item != NULL && power == 0) item->BlendColor = INVERSECOLOR;
}
else if (it->player - players == consoleplayer)
{
level.flags |= LEVEL_ALLMAP;
}
}
else
{ // Take power from activator
if (power != 4)
{
AInventory *item = it->FindInventory (powers[power]);
if (item != NULL)
{
item->Destroy ();
}
}
else if (it->player - players == consoleplayer)
{
level.flags &= ~LEVEL_ALLMAP;
}
}
}
else
{
int i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].mo == NULL)
continue;
if (arg1)
{ // Give power
if (power != 4)
{
players[i].mo->GiveInventoryType (powers[power]);
}
else if (i == consoleplayer)
{
level.flags |= LEVEL_ALLMAP;
}
}
else
{ // Take power
if (power != 4)
{
AInventory *item = players[i].mo->FindInventory (powers[power]);
if (item != NULL)
{
item->Destroy ();
}
}
else if (i == consoleplayer)
{
level.flags &= ~LEVEL_ALLMAP;
}
}
}
}
return true;
}
// Set or clear a flag
switch (arg2)
{
case PROP_FROZEN:
mask = CF_FROZEN;
break;
case PROP_NOTARGET:
mask = CF_NOTARGET;
break;
case PROP_INSTANTWEAPONSWITCH:
mask = CF_INSTANTWEAPSWITCH;
break;
case PROP_FLY:
mask = CF_FLY;
break;
case PROP_TOTALLYFROZEN:
mask = CF_TOTALLYFROZEN;
break;
}
if (arg0 == 0)
{
if (arg1)
{
it->player->cheats |= mask;
if (arg2 == PROP_FLY)
{
it->flags2 |= MF2_FLY;
it->flags |= MF_NOGRAVITY;
}
}
else
{
it->player->cheats &= ~mask;
if (arg2 == PROP_FLY)
{
it->flags2 &= ~MF2_FLY;
it->flags &= ~MF_NOGRAVITY;
}
}
}
else
{
int i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (arg1)
{
players[i].cheats |= mask;
if (arg2 == PROP_FLY)
{
players[i].mo->flags2 |= MF2_FLY;
players[i].mo->flags |= MF_NOGRAVITY;
}
}
else
{
players[i].cheats &= ~mask;
if (arg2 == PROP_FLY)
{
players[i].mo->flags2 &= ~MF2_FLY;
players[i].mo->flags &= ~MF_NOGRAVITY;
}
}
}
}
return !!mask;
}
FUNC(LS_TranslucentLine)
// TranslucentLine (id, amount, type)
{
int linenum = -1;
while ((linenum = P_FindLineFromID (arg0, linenum)) >= 0)
{
- Fixed: The hitscan tracer had the current sector point to a temporary variable when 3D floors were involved. Update to ZDoom r965: - Fixed: SPAC_AnyCross didn't work. - Fixed: Pushable doors must also check for SPAC_MPush. - Fixed: P_LoadThings2 did not adjust the byte order for the thingid field. - Changed: HIRESTEX 'define' textures now replace existing textures of type MiscPatch with the same name. - Added UDMF line trigger types MonsterUse and MonsterPush. - Separated skill and class filter bits from FMapThing::flags so that UDMF can define up to 16 of each. Also separated easy/baby and hard/nightmare and changed default MAPINFO definitions. - Fixed: FWadCollection::MergeLumps() did not initialize the flags for any marker lumps it inserted. - Fixed: Need write barriers when modifying SequenceListHead. - Added a new cvar: midi_timiditylike. This re-enables TiMidity handling of GUS patch flags, envelopes, and volume levels, while trying to be closer to TiMidity++ than original TiMidity. - Renamed timidity_config and timidity_voices to midi_config and midi_voices respectively. - Changed: Crosshair drawing uses the current player class's default health instead of 100 to calculate the color for the crosshair. - Added SECF_NOFALLINGDAMAGE flag plus Sector_ChangeFlags to set it. Also separated all user settable flags from MoreFlags into their own Flags variable. - Reduced volume, expression, and panning controllers back to 7 bits. - Added very basic Soundfont support to the internal TiMidity. Things missing: filter, LFOs, modulation envelope, chorus, reverb, and modulators. May or may not be compatible with TiMidity++'s soundfont extensions. - Changed all thing coordinates that were stored as shorts into fixed_t. - Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so that it is easier to add new features in the UDMF map format. - Added some initial code to read UDMF maps. - Added support for quoted strings to the TiMidity config parser. - Split off the slope creation code from p_Setup.cpp into its own file. - Separated the linedef activation types into a bit mask that allows combination of all types on the same linedef. Also added a 'first side only' flag. This is not usable from Hexen or Doom format maps though but in preparation of the UDMF format discussed here: http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/ - Changed linedef's alpha property from a byte to fixed point after seeing that 255 wasn't handled to be fully opaque. - fixed a GCC warning in fmodsound.cpp - Fixed: Warped textures didn't work anymore because the default speed was 0. - Fixed: I had instrument vibrato setting the tremolo_sweep_increment value in the instrument loader, effectively disabling vibrato. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@103 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-12 09:58:47 +00:00
lines[linenum].Alpha = Scale(clamp(arg1, 0, 255), FRACUNIT, 255);
if (arg2 == 0)
{
- Added patch for Linux fixes. - Added new ZDoom specific UDMF sector properties to map parser. - Added class definitions for new interpolators that are better equipped to interact with the interpolated objects. - Separated interpolation code into its own file r_interpolate.cpp. - Added some simple customization options to the end game screens. - Fixed: Polyobject detection in the internal node builder did not work anymore due to some code rearrangement for UDMF map loading. To keep it compatible between all map formats the THINGS lump of binary format maps must be loaded before building the nodes. This also means that the spawning itself can be done in the same function for all map types (except Build) now. - Changed 'Smooth mouse movement' menu option from m_filter to smooth_mouse which is more what would be expected from this option. - Fixed: Weapons and ammo items that were modified by Dehacked gave full ammo when being dropped by monsters. To properly handle this the handling of spawning Dehacked modified pickups was changed to use the DECORATE replacement feature instead of hacking the spawn state of the original item and calling a spawn function from there. - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@111 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-02 17:20:22 +00:00
lines[linenum].flags &= ~ML_ADDTRANS;
}
else if (arg2 == 1)
{
- Added patch for Linux fixes. - Added new ZDoom specific UDMF sector properties to map parser. - Added class definitions for new interpolators that are better equipped to interact with the interpolated objects. - Separated interpolation code into its own file r_interpolate.cpp. - Added some simple customization options to the end game screens. - Fixed: Polyobject detection in the internal node builder did not work anymore due to some code rearrangement for UDMF map loading. To keep it compatible between all map formats the THINGS lump of binary format maps must be loaded before building the nodes. This also means that the spawning itself can be done in the same function for all map types (except Build) now. - Changed 'Smooth mouse movement' menu option from m_filter to smooth_mouse which is more what would be expected from this option. - Fixed: Weapons and ammo items that were modified by Dehacked gave full ammo when being dropped by monsters. To properly handle this the handling of spawning Dehacked modified pickups was changed to use the DECORATE replacement feature instead of hacking the spawn state of the original item and calling a spawn function from there. - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@111 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-02 17:20:22 +00:00
lines[linenum].flags |= ML_ADDTRANS;
}
else
{
Printf ("Unknown translucency type used with TranslucentLine\n");
}
}
return true;
}
FUNC(LS_Autosave)
{
if (gameaction != ga_savegame)
{
Net_WriteByte (DEM_CHECKAUTOSAVE);
}
return true;
}
FUNC(LS_ChangeSkill)
{
if ((unsigned)arg0 >= AllSkills.Size())
{
NextSkill = -1;
}
else
{
NextSkill = arg0;
}
return true;
}
FUNC(LS_NoiseAlert)
// NoiseAlert (TID of target, TID of emitter)
{
AActor *target, *emitter;
if (arg0 == 0)
{
target = it;
}
else
{
FActorIterator iter (arg0);
target = iter.Next();
}
if (arg1 == 0)
{
emitter = it;
}
else if (arg1 == arg0)
{
emitter = target;
}
else
{
FActorIterator iter (arg1);
emitter = iter.Next();
}
P_NoiseAlert (target, emitter);
return true;
}
FUNC(LS_SendToCommunicator)
// SendToCommunicator (voc #, front-only, identify, nolog)
{
// This obviously isn't going to work for co-op.
if (arg1 && backSide)
return false;
if (it != NULL && it->player != NULL && it->FindInventory(NAME_Communicator))
{
char name[32];
Update to ZDoom r1083. Not fully tested yet! - Converted most sprintf (and all wsprintf) calls to either mysnprintf or FStrings, depending on the situation. - Changed the strings in the wbstartstruct to be FStrings. - Changed myvsnprintf() to output nothing if count is greater than INT_MAX. This is so that I can use a series of mysnprintf() calls and advance the pointer for each one. Once the pointer goes beyond the end of the buffer, the count will go negative, but since it's an unsigned type it will be seen as excessively huge instead. This should not be a problem, as there's no reason for ZDoom to be using text buffers larger than 2 GB anywhere. - Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig(). - Changed CalcMapName() to return an FString instead of a pointer to a static buffer. - Changed startmap in d_main.cpp into an FString. - Changed CheckWarpTransMap() to take an FString& as the first argument. - Changed d_mapname in g_level.cpp into an FString. - Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an FString. - Fixed: The MAPINFO parser wrote into the string buffer to construct a map name when given a Hexen map number. This was fine with the old scanner code, but only a happy coincidence prevents it from crashing with the new code. - Added the 'B' conversion specifier to StringFormat::VWorker() for printing binary numbers. - Added CMake support for building with MinGW, MSYS, and NMake. Linux support is probably broken until I get around to booting into Linux again. Niceties provided over the existing Makefiles they're replacing: * All command-line builds can use the same build system, rather than having a separate one for MinGW and another for Linux. * Microsoft's NMake tool is supported as a target. * Progress meters. * Parallel makes work from a fresh checkout without needing to be primed first with a single-threaded make. * Porting to other architectures should be simplified, whenever that day comes. - Replaced the makewad tool with zipdir. This handles the dependency tracking itself instead of generating an external makefile to do it, since I couldn't figure out how to generate a makefile with an external tool and include it with a CMake-generated makefile. Where makewad used a master list of files to generate the package file, zipdir just zips the entire contents of one or more directories. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
mysnprintf (name, countof(name), "svox/voc%d", arg0);
if (!arg3)
{
it->player->SetLogNumber (arg0);
}
if (it->CheckLocalView (consoleplayer))
{
Update to ZDoom r1062: - Rewrote myvsnprintf to use the StringFormat routines directly so that no additional memory needs to be allocated from the heap. - Polyobject sounds now play from their lines, similar to the way sector sounds are handled. - Why do polyobjects have a 3D start spot? Flattened it to 2D. - Moved the sector sound origin calculation out of fmodsound.cpp and into s_sound.cpp so that the near sound limiting will use the correct sound location for deciding on neighbors. - Removed the S_Sound() variant that allows for pointing the origin at an arbitrary point. It has been replaced with a variant that takes a polyobject as a source, since that was the only use that couldn't be rewritten with the other variants. This also fixes the bug that polyobject sounds were not successfully saved and caused a crash when reloading the game. Note that this is a significant change to how equality of sound sources is determined, so some things may not behave quite the same as before. (Which would be a bug, but hopefully everything still sounds the same.) - Adjusted the noise debug table so that fractional volume levels do not run into the adjacent columns. - Added a NullSoundRenderer so that most of the checks against a NULL GSnd can be removed. - Fixed: Looping sounds must always successfully allocate a channel, even if it's only a pre-evicted channel. - Added A_ClearReFire code pointer for weapons. Preferably A_WeaponReady should reset this counter but that can't be done due to unwanted side effects with existing weapons. - Changed the 'scale' variable in CVAR(turbo) to double because the calculations depended on the current floating point precision setting and only worked properly when set to 'precise' in VC++. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@130 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-04 16:54:29 +00:00
S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE, name, 1, ATTN_NORM);
if (arg2 == 0)
{
Printf (PRINT_CHAT, "Incoming Message\n");
}
else if (arg2 == 1)
{
Printf (PRINT_CHAT, "Incoming Message from BlackBird\n");
}
}
return true;
}
return false;
}
FUNC(LS_ForceField)
// ForceField ()
{
if (it != NULL)
{
P_DamageMobj (it, NULL, NULL, 16, NAME_None);
P_ThrustMobj (it, it->angle + ANGLE_180, 0x7D000);
}
return true;
}
FUNC(LS_ClearForceField)
// ClearForceField (tag)
{
int secnum = -1;
bool rtn = false;
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sector_t *sec = &sectors[secnum];
rtn = true;
for (int i = 0; i < sec->linecount; ++i)
{
line_t *line = sec->lines[i];
if (line->backsector != NULL && line->special == ForceField)
{
line->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING);
line->special = 0;
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
sides[line->sidenum[0]].SetTexture(side_t::mid, FNullTextureID());
sides[line->sidenum[1]].SetTexture(side_t::mid, FNullTextureID());
}
}
}
return rtn;
}
FUNC(LS_GlassBreak)
// GlassBreak (bNoJunk)
{
bool switched;
bool quest1, quest2;
ln->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING);
switched = P_ChangeSwitchTexture (&sides[ln->sidenum[0]], false, 0, &quest1);
ln->special = 0;
if (ln->sidenum[1] != NO_SIDE)
{
switched |= P_ChangeSwitchTexture (&sides[ln->sidenum[1]], false, 0, &quest2);
}
else
{
quest2 = quest1;
}
if (switched)
{
if (!arg0)
{ // Break some glass
fixed_t x, y;
AActor *glass;
angle_t an;
int speed;
x = ln->v1->x + ln->dx/2;
y = ln->v1->y + ln->dy/2;
x += (ln->frontsector->soundorg[0] - x) / 5;
y += (ln->frontsector->soundorg[1] - y) / 5;
for (int i = 0; i < 7; ++i)
{
glass = Spawn("GlassJunk", x, y, ONFLOORZ, ALLOW_REPLACE);
glass->z += 24 * FRACUNIT;
glass->SetState (glass->SpawnState + (pr_glass() % glass->health));
an = pr_glass() << (32-8);
glass->angle = an;
an >>= ANGLETOFINESHIFT;
speed = pr_glass() & 3;
glass->momx = finecosine[an] * speed;
glass->momy = finesine[an] * speed;
glass->momz = (pr_glass() & 7) << FRACBITS;
// [RH] Let the shards stick around longer than they did in Strife.
glass->tics += pr_glass();
}
}
if (quest1 || quest2)
{ // Up stats and signal this mission is complete
if (it == NULL)
{
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
{
it = players[i].mo;
break;
}
}
}
if (it != NULL)
{
it->GiveInventoryType (QuestItemClasses[28]);
it->GiveInventoryType (RUNTIME_CLASS(AUpgradeAccuracy));
it->GiveInventoryType (RUNTIME_CLASS(AUpgradeStamina));
}
}
}
// We already changed the switch texture, so don't make the main code switch it back.
return false;
}
FUNC(LS_StartConversation)
// StartConversation (tid, facetalker)
{
FActorIterator iterator (arg0);
AActor *target = iterator.Next();
// Nothing to talk to
if (target == NULL)
{
return false;
}
// Only living players are allowed to start conversations
if (it == NULL || it->player == NULL || it->player->mo != it || it->health<=0)
{
return false;
}
// Dead things can't talk.
if (target->health <= 0)
{
return false;
}
// Fighting things don't talk either.
if (target->flags4 & MF4_INCOMBAT)
{
return false;
}
if (target->Conversation != NULL)
{
// Give the NPC a chance to play a brief animation
target->ConversationAnimation (0);
P_StartConversation (target, it, !!arg1, true);
return true;
}
return false;
}
lnSpecFunc LineSpecials[256] =
{
LS_NOP,
LS_NOP, // Polyobj_StartLine,
LS_Polyobj_RotateLeft,
LS_Polyobj_RotateRight,
LS_Polyobj_Move,
LS_NOP, // Polyobj_ExplicitLine
LS_Polyobj_MoveTimes8,
LS_Polyobj_DoorSwing,
LS_Polyobj_DoorSlide,
LS_NOP, // Line_Horizon
LS_Door_Close,
LS_Door_Open,
LS_Door_Raise,
LS_Door_LockedRaise,
LS_Door_Animated,
LS_Autosave,
LS_NOP, // Transfer_WallLight
LS_Thing_Raise,
LS_StartConversation,
LS_Thing_Stop,
LS_Floor_LowerByValue,
LS_Floor_LowerToLowest,
LS_Floor_LowerToNearest,
LS_Floor_RaiseByValue,
LS_Floor_RaiseToHighest,
LS_Floor_RaiseToNearest,
LS_Stairs_BuildDown,
LS_Stairs_BuildUp,
LS_Floor_RaiseAndCrush,
LS_Pillar_Build,
LS_Pillar_Open,
LS_Stairs_BuildDownSync,
LS_Stairs_BuildUpSync,
LS_ForceField,
LS_ClearForceField,
LS_Floor_RaiseByValueTimes8,
LS_Floor_LowerByValueTimes8,
LS_Floor_MoveToValue,
LS_Ceiling_Waggle,
LS_Teleport_ZombieChanger,
LS_Ceiling_LowerByValue,
LS_Ceiling_RaiseByValue,
LS_Ceiling_CrushAndRaise,
LS_Ceiling_LowerAndCrush,
LS_Ceiling_CrushStop,
LS_Ceiling_CrushRaiseAndStay,
LS_Floor_CrushStop,
LS_Ceiling_MoveToValue,
Update to ZDoom r813, including: - Added copyright/license headers to a few files. - Fixed: ACS SetMugShotState needs to check the StatusBar pointer for the proper object type. - Move SBarInfo loading code in d_main.cpp into a static method of DSBarInfo. - Removed dobject.err from the repository. It only contained a list of compiler errors for some very old version of dobject.cpp. - Fixed: A_JumpIfCloser was missing a z-check. - Added Blzut3's SBARINFO update #13: - Split sbarinfo.cpp into two files sbarinfo_display.cpp and sbarinfo_parser.cpp - Rewrote the mug shot system for SBarInfo to allow for scripting and custom states for different means of death. - SBarInfo now loads all SBarInfo lumps instead of just the last one. Clashing status bar definitions will now be cleared before the bar is read. - Fixed: When using transparency with bars the new drawing method (bg over fg) didn't work. In the case that the border value is set to 0 it will revert to the old method (fg over bg). - Fixed: drawbar lost any high res information it was given. - Added: ACS command SetMugShotState(str state) which sets the mug shot state for the activating player. - Added: keepoffsets flag to drawbar. When set the offsets in the fg image will also be applied when displaying the bar. - Fixed the TArray serializer declaration. (Thank you for your warnings, GCC! ;-) - Changed root sector marking so that it can happen incrementally. - Fixed: The TArray serializer needs to be declared as a friend of TArray in order to be able to access its fields. - Since there are no backwards compatibility issues due to savegame version bumping I closed all gaps in the level flag set. - Bumped min. Savegame version and Netgame version for 3dMidtex related changes. - Changed Jump and Crouch DMFlags into 3-way switches: 0: map default, 1: off, 2: on. Since I needed new bits the rest of the DMFlag bit values had to be changed as a result. - fixed: PTR_SlideTraverse didn't check ML_BLOCKMONSTERS for sliding actors without MF3_NOBLOCKMONST. - Added MAPINFO commands 'checkswitchrange' and 'nocheckswitchrange' that can enable or disable switch range checking globally per map. - Changed ML_3DMIDTEX to force ML_CHECKSWITCHRANGE. - Added a ML_CHECKSWITCHRANGE flag which allows checking whether the player can actually reach the switch he wants to use. - Made DActiveButton::EWhere global so that I can use it outside thr DActiveButton class. - Changed P_LineOpening to pass its result in a struct instead of global variables. - Added Eternity's 3DMIDTEX feature (no Eternity code used though.) It should be feature complete with the exception of the ML_BLOCKMONSTERS flag handling. That particular part of Eternity's implementation is sub-optimal because it hijacks an existing flag and doesn't seem to make much sense to me. Maybe I'll implement it as a separate flag later. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@62 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-19 11:19:03 +00:00
LS_NOP, // Sector_Attach3dMidtex
LS_GlassBreak,
LS_NOP, // 50: ExtraFloor_LightOnly
LS_Sector_SetLink,
- Removed precompiled header option for GL code because it caused more problems than the minimal amount of saved time was worth. Update to ZDoom r833: - Disabled scrolling of 3DMIDTEX textures. Due to the special needs this cannot work properly. - Added new Scroll_Wall special to allow more control over wall scrolling. Since it uses fixed point parameters it can only be used in scripts though. - Added flags parameters to all wall scroller specials that didn't use all 5 args. - Separated scrolling of the 3 different texture parts of a sidedef. While doing this I did some more restructuring of the sidedef structure and changed it so that all state changes to sidedefs that affect rendering have to be made with access functions. This is not of much use to the software renderer but it allows far easier caching of rendering data for OpenGL because the only place I need to check is in the access functions. - Added Karate Chris's ThingCountSector submission. - Made texture indices in FSwitchDef full integers. Since that required some data restructuring I also eliminated the MAX_FRAMES limit of 128 per switch. - Removed some debug output from SBarInfo::ParseSBarInfo(). - Fixed: Heretic linetype translations included the wrong file. - Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it only worked as intended on stereo speakers anyway. - Cleaned out ancient crud from i_sound.cpp. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-21 21:15:56 +00:00
LS_Scroll_Wall,
LS_Line_SetTextureOffset,
LS_NOP, // 54
LS_NOP, // 55
LS_NOP, // 56
LS_NOP, // 57
LS_NOP, // 58
LS_NOP, // 59
LS_Plat_PerpetualRaise,
LS_Plat_Stop,
LS_Plat_DownWaitUpStay,
LS_Plat_DownByValue,
LS_Plat_UpWaitDownStay,
LS_Plat_UpByValue,
LS_Floor_LowerInstant,
LS_Floor_RaiseInstant,
LS_Floor_MoveToValueTimes8,
LS_Ceiling_MoveToValueTimes8,
LS_Teleport,
LS_Teleport_NoFog,
LS_ThrustThing,
LS_DamageThing,
LS_Teleport_NewMap,
LS_Teleport_EndGame,
LS_TeleportOther,
LS_TeleportGroup,
LS_TeleportInSector,
LS_NOP, // 79
LS_ACS_Execute,
LS_ACS_Suspend,
LS_ACS_Terminate,
LS_ACS_LockedExecute,
LS_ACS_ExecuteWithResult,
LS_ACS_LockedExecuteDoor,
LS_NOP, // 86
LS_NOP, // 87
LS_NOP, // 88
LS_NOP, // 89
LS_Polyobj_OR_RotateLeft,
LS_Polyobj_OR_RotateRight,
LS_Polyobj_OR_Move,
LS_Polyobj_OR_MoveTimes8,
LS_Pillar_BuildAndCrush,
LS_FloorAndCeiling_LowerByValue,
LS_FloorAndCeiling_RaiseByValue,
LS_NOP, // 97
LS_NOP, // 98
LS_NOP, // 99
LS_NOP, // Scroll_Texture_Left
LS_NOP, // Scroll_Texture_Right
LS_NOP, // Scroll_Texture_Up
LS_NOP, // Scroll_Texture_Down
LS_NOP, // 104
LS_NOP, // 105
LS_NOP, // 106
LS_NOP, // 107
LS_NOP, // 108
LS_Light_ForceLightning,
LS_Light_RaiseByValue,
LS_Light_LowerByValue,
LS_Light_ChangeToValue,
LS_Light_Fade,
LS_Light_Glow,
LS_Light_Flicker,
LS_Light_Strobe,
LS_Light_Stop,
LS_NOP, // 118
LS_Thing_Damage,
LS_Radius_Quake,
LS_NOP, // Line_SetIdentification
LS_NOP, // Thing_SetGravity // [BC] Start
LS_NOP, // Thing_ReverseGravity
LS_NOP, // Thing_RevertGravity
LS_Thing_Move,
LS_NOP, // Thing_SetSprite
LS_Thing_SetSpecial,
LS_ThrustThingZ, // [BC] End
LS_UsePuzzleItem,
LS_Thing_Activate,
LS_Thing_Deactivate,
LS_Thing_Remove,
LS_Thing_Destroy,
LS_Thing_Projectile,
LS_Thing_Spawn,
LS_Thing_ProjectileGravity,
LS_Thing_SpawnNoFog,
LS_Floor_Waggle,
LS_Thing_SpawnFacing,
LS_Sector_ChangeSound,
LS_NOP, // 141 Music_Pause // [BC] Start
LS_NOP, // 142 Music_Change
LS_NOP, // 143 Player_RemoveItem
LS_NOP, // 144 Player_GiveItem
LS_NOP, // 145 Player_SetTeam
LS_NOP, // 146 Player_SetLeader
LS_NOP, // 147 Team_InitFP
LS_NOP, // 148 TeleportAll
LS_NOP, // 149 TeleportAll_NoFog
LS_NOP, // 150 Team_GiveFP
LS_NOP, // 151 Team_UseFP
LS_NOP, // 152 Team_Score
LS_NOP, // 153 Team_Init
LS_NOP, // 154 Var_Lock
LS_NOP, // 155 Team_RemoveItem
LS_NOP, // 156 Team_GiveItem // [BC] End
LS_NOP, // 157
LS_NOP, // 158
LS_NOP, // 159
LS_NOP, // 160
LS_NOP, // 161
LS_NOP, // 162
LS_NOP, // 163
LS_NOP, // 164
LS_NOP, // 165
LS_NOP, // 166
LS_NOP, // 167
LS_NOP, // 168
LS_Generic_Crusher2,
LS_Sector_SetCeilingScale2,
LS_Sector_SetFloorScale2,
LS_Plat_UpNearestWaitDownStay,
LS_NoiseAlert,
LS_SendToCommunicator,
LS_Thing_ProjectileIntercept,
LS_Thing_ChangeTID,
LS_Thing_Hate,
LS_Thing_ProjectileAimed,
LS_ChangeSkill,
LS_Thing_SetTranslation,
LS_NOP, // Plane_Align
LS_NOP, // Line_Mirror
LS_Line_AlignCeiling,
LS_Line_AlignFloor,
LS_Sector_SetRotation,
LS_Sector_SetCeilingPanning,
LS_Sector_SetFloorPanning,
LS_Sector_SetCeilingScale,
LS_Sector_SetFloorScale,
LS_NOP, // Static_Init
LS_SetPlayerProperty,
LS_Ceiling_LowerToHighestFloor,
LS_Ceiling_LowerInstant,
LS_Ceiling_RaiseInstant,
LS_Ceiling_CrushRaiseAndStayA,
LS_Ceiling_CrushAndRaiseA,
LS_Ceiling_CrushAndRaiseSilentA,
LS_Ceiling_RaiseByValueTimes8,
LS_Ceiling_LowerByValueTimes8,
LS_Generic_Floor,
LS_Generic_Ceiling,
LS_Generic_Door,
LS_Generic_Lift,
LS_Generic_Stairs,
LS_Generic_Crusher,
LS_Plat_DownWaitUpStayLip,
LS_Plat_PerpetualRaiseLip,
LS_TranslucentLine,
LS_NOP, // Transfer_Heights
LS_NOP, // Transfer_FloorLight
LS_NOP, // Transfer_CeilingLight
LS_Sector_SetColor,
LS_Sector_SetFade,
LS_Sector_SetDamage,
LS_Teleport_Line,
LS_Sector_SetGravity,
LS_Stairs_BuildUpDoom,
LS_Sector_SetWind,
LS_Sector_SetFriction,
LS_Sector_SetCurrent,
LS_Scroll_Texture_Both,
LS_NOP, // Scroll_Texture_Model
LS_Scroll_Floor,
LS_Scroll_Ceiling,
LS_NOP, // Scroll_Texture_Offsets
LS_ACS_ExecuteAlways,
LS_PointPush_SetForce,
LS_Plat_RaiseAndStayTx0,
LS_Thing_SetGoal,
LS_Plat_UpByValueStayTx,
LS_Plat_ToggleCeiling,
LS_Light_StrobeDoom,
LS_Light_MinNeighbor,
LS_Light_MaxNeighbor,
LS_Floor_TransferTrigger,
LS_Floor_TransferNumeric,
LS_ChangeCamera,
LS_Floor_RaiseToLowestCeiling,
LS_Floor_RaiseByValueTxTy,
LS_Floor_RaiseByTexture,
LS_Floor_LowerToLowestTxTy,
LS_Floor_LowerToHighest,
LS_Exit_Normal,
LS_Exit_Secret,
LS_Elevator_RaiseToNearest,
LS_Elevator_MoveToFloor,
LS_Elevator_LowerToNearest,
LS_HealThing,
LS_Door_CloseWaitOpen,
LS_Floor_Donut,
LS_FloorAndCeiling_LowerRaise,
LS_Ceiling_RaiseToNearest,
LS_Ceiling_LowerToLowest,
LS_Ceiling_LowerToFloor,
LS_Ceiling_CrushRaiseAndStaySilA
};
struct FLineSpecial
{
const char *name;
BYTE number;
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
SBYTE min_args;
SBYTE max_args;
};
#define DEFINE_SPECIAL(name, num, min, max) {#name, num, min, max},
static FLineSpecial LineSpecialNames[]={
#include "actionspecials.h"
};
//==========================================================================
//
// P_FindLineSpecial
//
// Finds a line special and also returns the min and max argument count.
//
//==========================================================================
static int STACK_ARGS lscmp (const void * a, const void * b)
{
return stricmp( ((FLineSpecial*)a)->name, ((FLineSpecial*)b)->name);
}
int P_FindLineSpecial (const char *string, int *min_args, int *max_args)
{
static bool sorted=false;
if (!sorted)
{
qsort(LineSpecialNames, countof(LineSpecialNames), sizeof(FLineSpecial), lscmp);
sorted = true;
}
int min = 0, max = countof(LineSpecialNames) - 1;
while (min <= max)
{
int mid = (min + max) / 2;
int lexval = stricmp (string, LineSpecialNames[mid].name);
if (lexval == 0)
{
if (min_args != NULL) *min_args = LineSpecialNames[mid].min_args;
if (max_args != NULL) *max_args = LineSpecialNames[mid].max_args;
return LineSpecialNames[mid].number;
}
else if (lexval > 0)
{
min = mid + 1;
}
else
{
max = mid - 1;
}
}
return 0;
}