Merge branch 'udmf-cherrypick' into 'master'

Update our UDMF

Closes STJr/SRB2#862

See merge request KartKrew/Kart!727
This commit is contained in:
James R 2022-10-29 06:54:48 +00:00
commit 58bb648b0a
73 changed files with 19753 additions and 12587 deletions

View file

@ -448,31 +448,31 @@ sectortypes
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
//9 = "Ring Drainer (Floor Touch)";
//10 = "Ring Drainer (Anywhere in Sector)";
//11 = "Special Stage Damage";
9 = "<deprecated> Ring Drainer (Floor Touch)";
10 = "<deprecated> Ring Drainer (Anywhere in Sector)";
11 = "<deprecated> Special Stage Damage";
12 = "Wall Sector (no step-up/down)";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
15 = "Bouncy FOF";
15 = "<deprecated> Bouncy FOF";
16 = "Trigger Line Ex. (Pushable Objects)";
32 = "Trigger Line Ex. (Anywhere, All Players)";
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
//96 = "Trigger Line Ex. (Emerald Check)";
96 = "<deprecated> Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (Race Lap)";
128 = "Check for Linedef Executor on FOFs";
//144 = "Egg Capsule";
//160 = "Special Stage Time/Rings Parameters";
176 = "Custom Global Gravity";
144 = "<deprecated> Egg Capsule";
160 = "<deprecated> Special Stage Time/Rings Parameters";
176 = "<deprecated> Custom Global Gravity";
192 = "Invert Encore Remap";
256 = "Spring Panel";
512 = "Wind/Current";
768 = "Spring Panel (Speed Capped)";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
//1536 = "Speed Pad (Spin)";
1536 = "<deprecated> Speed Pad (Spin)";
1792 = "Bustable Block Sprite Parameter (ROIA)";
2048 = "Bustable Block Sprite Parameter (ROIB)";
2304 = "Bustable Block Sprite Parameter (ROIC)";
@ -484,16 +484,16 @@ sectortypes
3840 = "Bustable Block Sprite Parameter (ROII)";
4096 = "Star Post Activator";
8192 = "Exit Level";
//12288 = "CTF Red Team Base";
//16384 = "CTF Blue Team Base";
12288 = "<deprecated> CTF Red Team Base";
16384 = "<deprecated> CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Sneaker Panel";
//28672 = "Force Spin";
28672 = "<deprecated> Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line (Unused)";
//45056 = "Rope Hang";
//49152 = "Intangible to the Camera";
40960 = "<deprecated> Circuit Finish Line";
45056 = "<deprecated> Rope Hang";
49152 = "<deprecated> Intangible to the Camera";
}
@ -511,13 +511,13 @@ gen_sectortypes
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
//9 = "Ring Drainer (Floor Touch)";
//10 = "Ring Drainer (Anywhere in Sector)";
//11 = "Special Stage Damage";
9 = "<deprecated> Ring Drainer (Floor Touch)";
10 = "<deprecated> Ring Drainer (Anywhere in Sector)";
11 = "<deprecated> Special Stage Damage";
12 = "Space Countdown";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
15 = "Bouncy FOF";
15 = "<deprecated> Bouncy FOF";
}
second
@ -528,12 +528,12 @@ gen_sectortypes
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
96 = "Trigger Line Ex. (Emerald Check)";
96 = "<deprecated> Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (Race Lap)";
128 = "Check for Linedef Executor on FOFs";
//144 = "Egg Capsule";
//160 = "Special Stage Time/Rings Parameters";
176 = "Custom Global Gravity";
144 = "<deprecated> Egg Capsule";
160 = "<deprecated> Special Stage Time/Rings Parameters";
176 = "<deprecated> Custom Global Gravity";
192 = "Invert Encore Remap";
}
@ -545,7 +545,7 @@ gen_sectortypes
768 = "Spring Panel (Speed Capped)";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
//1536 = "Speed Pad (Spin)";
1536 = "<deprecated> Speed Pad (Spin)";
1792 = "Bustable Block Sprite Parameter (ROIA)";
2048 = "Bustable Block Sprite Parameter (ROIB)";
2304 = "Bustable Block Sprite Parameter (ROIC)";
@ -562,16 +562,16 @@ gen_sectortypes
0 = "Normal";
4096 = "Star Post Activator";
8192 = "Exit Level";
//12288 = "CTF Red Team Base";
//16384 = "CTF Blue Team Base";
12288 = "<deprecated> CTF Red Team Base";
16384 = "<deprecated> CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Sneaker Panel";
//28672 = "Force Spin";
28672 = "<deprecated> Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line (Unused)";
//45056 = "Rope Hang";
//49152 = "Intangible to the Camera";
40960 = "<deprecated> Circuit Finish Line";
45056 = "<deprecated> Rope Hang";
49152 = "<deprecated> Intangible to the Camera";
}
}
@ -840,9 +840,15 @@ linedeftypes
65
{
title = "Bridge Thinker <disabled>";
title = "<disabled> Bridge Thinker";
prefix = "(65)";
}
76
{
title = "Make FOF Bouncy";
prefix = "(76)";
}
}
polyobject
@ -1284,7 +1290,7 @@ linedeftypes
160
{
title = "Floating, Bobbing";
title = "Water Bobbing";
prefix = "(160)";
flags32text = "[5] Only block player";
flags128text = "[7] Only block non-players";
@ -1782,7 +1788,31 @@ linedeftypes
prefix = "(322)";
flags64text = "[6] Trigger more than once";
}
334
{
title = "Object Dye - Continuous";
prefix = "(334)";
flags64text = "[6] Disable for this color";
flags1024text = "[10] Use faster, unordered execution";
}
335
{
title = "Object Dye - Each Time";
prefix = "(335)";
flags64text = "[6] Disable for this color";
flags1024text = "[10] Use faster, unordered execution";
}
336
{
title = "Object Dye - Once";
prefix = "(336)";
flags64text = "[6] Disable for this color";
flags1024text = "[10] Use faster, unordered execution";
}
399
{
title = "Level Load";
@ -1812,23 +1842,35 @@ linedeftypes
402
{
title = "Set Tagged Sector's Light Level";
title = "Copy Light Level to Tagged Sectors";
prefix = "(402)";
flags8text = "[3] Set delay by backside sector";
}
408
{
title = "Set Tagged Sector's Flats";
prefix = "(408)";
flags64text = "[6] Don't set floor flat";
flags512text = "[9] Don't set ceiling flat";
}
409
{
title = "Change Tagged Sector's Tag";
prefix = "(409)";
flags2text = "[1] Remove tag";
flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Add tag";
}
410
{
title = "Change Front Sector's Tag";
prefix = "(410)";
flags2text = "[1] Remove tag";
flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Add tag";
}
416
@ -1883,6 +1925,14 @@ linedeftypes
prefix = "(435)";
flags8text = "[3] Set delay by backside sector";
}
467
{
title = "Set Tagged Sector's Light Level";
prefix = "(467)";
flags8text = "[3] Set delay by backside sector";
flags256text = "[8] Set relative to current";
}
}
linedefexecplane
@ -2890,6 +2940,7 @@ linedeftypes
{
title = "Set Tagged Dynamic Slope Vertex to Front Sector Height";
prefix = "(799)";
flags64text = "[6] Use relative heights";
}
}

View file

@ -1,77 +0,0 @@
// Default lump name for new map
defaultlumpname = "MAP01";
//GZDB specific. Don't try to load lumps that don't exist.
basegame = "Doom";
//Sky textures for vanilla maps
defaultskytextures
{
SKY1 = "MAP01,MAP02,MAP03,MAP33,MAP50,MAP60,MAPF0,MAPM0";
SKY2 = "MAPM7,MAPMB";
SKY4 = "MAP04,MAP06,MAP61,MAPF6,MAPM1";
SKY6 = "MAP05,MAP51,MAPMA";
SKY7 = "MAPM2,MAPM5";
SKY8 = "MAP07,MAP08,MAP09,MAP52,MAP62,MAPF1";
SKY10 = "MAP10,MAP12,MAP53,MAP63,MAPM3";
SKY11 = "MAP11,MAPF7";
SKY13 = "MAP13,MAP64";
SKY14 = "MAP14";
SKY15 = "MAP15,MAP54";
SKY17 = "MAP70";
SKY20 = "MAP32,MAP55,MAP65,MAPF2,MAPF5";
SKY21 = "MAPM4";
SKY22 = "MAP22,MAP23,MAP25,MAP26,MAP27,MAP56,MAP66,MAPF4,MAPM6";
SKY30 = "MAP30";
SKY31 = "MAP31";
SKY35 = "MAP42";
SKY40 = "MAP41,MAP71,MAPM9";
SKY55 = "MAPF3,MAPM8";
SKY68 = "MAPF8";
SKY99 = "MAP57,MAPZ0";
SKY159 = "MAP16";
SKY172 = "MAP40";
SKY300 = "MAP72";
SKY301 = "MAP73";
}
// Skill levels
skills
{
0 = "Easy";
1 = "Normal";
2 = "Hard";
3 = "Master";
}
// Skins
skins
{
sonic;
tails;
knuckles;
amy;
mighty;
fang;
eggman;
metalsonic;
motobug;
}
// Gametypes
gametypes
{
-1 = "Single Player";
0 = "Race";
1 = "Battle";
}
// Texture loading options
defaultwalltexture = "GFZROCK";
defaultfloortexture = "GFZFLR01";
defaultceilingtexture = "F_SKY1";
// Default texture sets
// (these are not required, but useful for new users)
texturesets
{
}

View file

@ -0,0 +1,53 @@
// Default lump name for new map
defaultlumpname = "MAPNAME";
//GZDB specific. Don't try to load lumps that don't exist.
basegame = "Doom";
//Sky textures for vanilla maps
defaultskytextures
{
SKY1 = "MAP01";
}
// Skill levels
skills
{
0 = "Easy";
1 = "Normal";
2 = "Hard";
3 = "Master";
}
// Skins
skins
{
sonic;
tails;
knuckles;
amy;
mighty;
fang;
eggman;
metalsonic;
motobug;
}
// Gametypes
gametypes
{
-1 = "Grand Prix";
0 = "Race";
1 = "Battle";
}
// Texture loading options
defaultwalltexture = "DEV_OC3";
defaultfloortexture = "DEV_GZ2";
defaultceilingtexture = "F_SKY1";
// Default texture sets
// (these are not required, but useful for new users)
texturesets
{
}

File diff suppressed because it is too large Load diff

View file

@ -1,107 +0,0 @@
sectortypes
{
0 = "Normal";
1 = "Damage";
2 = "Damage (Water)";
3 = "Damage (Fire)";
4 = "Damage (Electrical)";
5 = "Spikes";
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
9 = "Ring Drainer (Floor Touch)";
10 = "Ring Drainer (Anywhere in Sector)";
11 = "Special Stage Damage";
12 = "Space Countdown";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
16 = "Trigger Line Ex. (Pushable Objects)";
32 = "Trigger Line Ex. (Anywhere, All Players)";
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
96 = "Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (NiGHTS Mare)";
128 = "Check for Linedef Executor on FOFs";
144 = "Egg Capsule";
160 = "Special Stage Time/Spheres Parameters";
176 = "Custom Global Gravity";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
12288 = "CTF Red Team Base";
16384 = "CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Super Sonic Transform";
28672 = "Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line";
45056 = "Rope Hang";
49152 = "Intangible to the Camera";
}
gen_sectortypes
{
first
{
0 = "Normal";
1 = "Damage";
2 = "Damage (Water)";
3 = "Damage (Fire)";
4 = "Damage (Electrical)";
5 = "Spikes";
6 = "Death Pit (Camera Tilt)";
7 = "Death Pit (No Camera Tilt)";
8 = "Instant Kill";
9 = "Ring Drainer (Floor Touch)";
10 = "Ring Drainer (Anywhere in Sector)";
11 = "Special Stage Damage";
12 = "Space Countdown";
13 = "Ramp Sector (double step-up/down)";
14 = "Non-Ramp Sector (no step-down)";
}
second
{
0 = "Normal";
16 = "Trigger Line Ex. (Pushable Objects)";
32 = "Trigger Line Ex. (Anywhere, All Players)";
48 = "Trigger Line Ex. (Floor Touch, All Players)";
64 = "Trigger Line Ex. (Anywhere in Sector)";
80 = "Trigger Line Ex. (Floor Touch)";
96 = "Trigger Line Ex. (Emerald Check)";
112 = "Trigger Line Ex. (NiGHTS Mare)";
128 = "Check for Linedef Executor on FOFs";
144 = "Egg Capsule";
160 = "Special Stage Time/Spheres Parameters";
176 = "Custom Global Gravity";
}
third
{
0 = "Normal";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
}
fourth
{
0 = "Normal";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
12288 = "CTF Red Team Base";
16384 = "CTF Blue Team Base";
20480 = "Fan Sector";
24576 = "Super Sonic Transform";
28672 = "Force Spin";
32768 = "Zoom Tube Start";
36864 = "Zoom Tube End";
40960 = "Circuit Finish Line";
45056 = "Rope Hang";
49152 = "Intangible to the Camera";
}
}

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ common
// Enables support for long (> 8 chars) texture names
// WARNING: this should only be enabled for UDMF game configurations!
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
longtexturenames = true;
longtexturenames = false;
// These directory names are ignored when loading PK3/PK7/Directory resources
ignoreddirectories = ".svn .git";
@ -16,7 +16,7 @@ common
// Default testing parameters
testparameters = "-file \"%AP\" \"%F\" -warp %L";
testshortpaths = true;
testshortpaths = false;
// Action special help
actionspecialhelp = "https://wiki.srb2.org/wiki/Linedef_type_%K";
@ -46,26 +46,28 @@ common
// Texture sources
textures
{
include("Kart2_misc.cfg", "textures");
include("RingRacers_misc.cfg", "textures");
}
// Patch sources
patches
{
include("Kart2_misc.cfg", "patches");
include("RingRacers_misc.cfg", "patches");
}
// Sprite sources
sprites
{
include("Kart2_misc.cfg", "sprites");
include("RingRacers_misc.cfg", "sprites");
}
// Flat sources
/*
flats
{
include("Kart2_misc.cfg", "flats");
include("RingRacers_misc.cfg", "flats");
}
*/
}
mapformat_udmf
@ -78,25 +80,26 @@ mapformat_udmf
defaulttestcompiler = "zdbsp_udmf_fast";
// Determines the textmap namespace
engine = "srb2kart";
engine = "ringracers";
maplumpnames
{
include("UDMF_misc.cfg", "udmfmaplumpnames_begin");
include("Kart2_misc.cfg", "udmfmaplumpnames");
include("RingRacers_misc.cfg", "udmfmaplumpnames");
include("RingRacers_misc.cfg", "sharedmaplumpnames");
include("UDMF_misc.cfg", "udmfmaplumpnames_end");
}
universalfields
{
include("Kart2_misc.cfg", "universalfields");
include("RingRacers_misc.cfg", "universalfields");
}
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = false;
// Special linedefs
include("Kart2_misc.cfg", "speciallinedefs_udmf");
include("RingRacers_misc.cfg", "speciallinedefs_udmf");
// Default flags for first new thing
defaultthingflags
@ -106,48 +109,38 @@ mapformat_udmf
// SECTOR FLAGS
sectorflags
{
include("Kart2_misc.cfg", "sectorflags");
include("RingRacers_misc.cfg", "sectorflags");
}
// DEFAULT SECTOR BRIGHTNESS LEVELS
sectorbrightness
{
include("Kart2_misc.cfg", "sectorbrightness");
include("RingRacers_misc.cfg", "sectorbrightness");
}
// SECTOR TYPES
sectortypes
{
include("Kart2_sectors.cfg", "sectortypes");
}
// GENERALISED SECTOR TYPES
gen_sectortypes
{
include("Kart2_sectors.cfg", "gen_sectortypes");
}
damagetypes = "Generic Lava DeathPit Instakill";
// LINEDEF FLAGS
linedefflags
{
include("Kart2_misc.cfg", "linedefflags_udmf");
include("RingRacers_misc.cfg", "linedefflags_udmf");
}
linedefflagstranslation
{
include("Kart2_misc.cfg", "linedefflagstranslation");
include("RingRacers_misc.cfg", "linedefflagstranslation");
}
// LINEDEF RENDERSTYLES
/*linedefrenderstyles
linedefrenderstyles
{
include("Kart2_misc.cfg", "linedefrenderstyles");
}*/
include("RingRacers_misc.cfg", "linedefrenderstyles");
}
// THING FLAGS
thingflags
{
include("Kart2_misc.cfg", "thingflags_udmf");
include("RingRacers_misc.cfg", "thingflags_udmf");
}
// Thing flags UDMF translation table
@ -155,7 +148,7 @@ mapformat_udmf
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
include("Kart2_misc.cfg", "thingflagstranslation");
include("RingRacers_misc.cfg", "thingflagstranslation");
}
// How to compare thing flags (for the stuck things error checker)
@ -164,9 +157,15 @@ mapformat_udmf
include("UDMF_misc.cfg", "thingflagscompare");
}
// THING TYPES
thingtypes
{
include("RingRacers_things.cfg", "udmf");
}
// LINEDEF TYPES
linedeftypes
{
include("Kart2_linedefs.cfg", "udmf");
include("RingRacers_linedefs.cfg", "udmf");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,21 @@
linedefflags
{
1 = "[0] Impassable";
2 = "[1] Block Enemies";
2 = "[1] Block Players";
4 = "[2] Double-Sided";
8 = "[3] Upper Unpegged";
16 = "[4] Lower Unpegged";
32 = "[5] Slope Skew (E1)";
32 = "[5] Slope Skew";
64 = "[6] Not Climbable";
128 = "[7] No Midtexture Skew (E2)";
256 = "[8] Peg Midtexture (E3)";
512 = "[9] Solid Midtexture (E4)";
1024 = "[10] Repeat Midtexture (E5)";
128 = "[7] No Midtexture Skew";
256 = "[8] Peg Midtexture";
512 = "[9] Solid Midtexture";
1024 = "[10] Repeat Midtexture";
2048 = "[11] Netgame Only";
4096 = "[12] No Netgame";
8192 = "[13] Effect 6";
16384 = "[14] Bouncy Wall";
32768 = "[15] Transfer Line";
8192 = "[13] Block Enemies";
16384 = "[14] Don't Bump";
32768 = "[15] FOF Transfer";
}
@ -25,7 +25,7 @@ linedefflags
linedefflagstranslation
{
1 = "blocking";
2 = "blockmonsters";
2 = "blockplayers";
4 = "twosided";
8 = "dontpegtop";
16 = "dontpegbottom";
@ -37,8 +37,8 @@ linedefflagstranslation
1024 = "wrapmidtex";
2048 = "netonly";
4096 = "nonet";
8192 = "effect6";
16384 = "bouncy";
8192 = "blockmonsters";
16384 = "notbouncy";
32768 = "transfer";
}
@ -46,7 +46,7 @@ linedefflagstranslation
linedefflags_udmf
{
blocking = "Impassable";
blockmonsters = "Block Enemies";
blockplayers = "Block Players";
twosided = "Double-Sided";
dontpegtop = "Upper Unpegged";
dontpegbottom = "Lower Unpegged";
@ -56,28 +56,50 @@ linedefflags_udmf
midpeg = "Peg Midtexture";
midsolid = "Solid Midtexture";
wrapmidtex = "Repeat Midtexture";
// effect6 = "Effect 6";
bouncy = "Bouncy Wall";
transfer = "Transfer Line";
}
linedefactivations_udmf
{
netonly = "Netgame Only";
nonet = "No Netgame";
blockmonsters = "Block Enemies";
bouncy = "Don't Bump";
transfer = "FOF Transfer";
}
/*linedefrenderstyles
linedefrenderstyles
{
translucent = "Translucent";
add = "Add";
subtract = "Subtract";
reversesubtract = "Reverse subtract";
modulate = "Modulate";
fog = "Fog";
}*/
}
sectorflags
{
colormapfog = "Fog Planes in Colormap";
colormapfadesprites = "Fade Fullbright in Colormap";
colormapprotected = "Protected Colormap";
flipspecial_nofloor = "No Trigger on Floor Touch";
flipspecial_ceiling = "Trigger on Ceiling Touch";
triggerspecial_touch = "Trigger on Edge Touch";
triggerspecial_headbump = "Trigger on Headbump";
triggerline_plane = "Linedef Trigger Requires Plane Touch";
triggerline_mobj = "Non-Pushables Can Trigger Linedef";
invertprecip = "Invert Precipitation";
gravityflip = "Flip Objects in Reverse Gravity";
heatwave = "Heat Wave";
noclipcamera = "Intangible to the Camera";
ripple_floor = "Water Ripple Floor";
ripple_ceiling = "Water Ripple Ceiling";
invertencore = "Encore Remap Invert";
nostepup = "Wall Sector (no step-up)";
doublestepup = "Ramp Sector (double step-up/down)";
nostepdown = "Non-Ramp Sector (no step-down)";
starpostactivator = "Star Post Activator";
exit = "Exit";
fan = "Fan Sector";
deleteitems = "Delete Items";
zoomtubestart = "Zoom Tube Start";
zoomtubeend = "Zoom Tube End";
}
thingflags
@ -91,10 +113,7 @@ thingflags
// THING FLAGS
thingflags_udmf
{
extra = "Extra";
flip = "Flip";
special = "Special";
ambush = "Ambush";
}
@ -103,10 +122,7 @@ thingflags_udmf
// When the UDMF field name is prefixed with ! it is inverted
thingflagstranslation
{
1 = "extra";
2 = "flip";
4 = "special";
8 = "ambush";
}
@ -227,6 +243,30 @@ universalfields
type = 3;
default = false;
}
friction
{
type = 1;
default = 0.90625;
}
triggertag
{
type = 15;
default = 0;
}
triggerer
{
type = 0;
default = 0;
enum
{
0 = "Player";
1 = "All players";
2 = "Object";
}
}
}
linedef
@ -236,6 +276,26 @@ universalfields
type = 0;
default = 0;
}
arg6
{
type = 0;
default = 0;
}
arg7
{
type = 0;
default = 0;
}
arg8
{
type = 0;
default = 0;
}
arg9
{
type = 0;
default = 0;
}
stringarg0
{
type = 2;
@ -264,6 +324,41 @@ universalfields
thing
{
arg5
{
type = 0;
default = 0;
}
arg6
{
type = 0;
default = 0;
}
arg7
{
type = 0;
default = 0;
}
arg8
{
type = 0;
default = 0;
}
arg9
{
type = 0;
default = 0;
}
stringarg0
{
type = 2;
default = "";
}
stringarg1
{
type = 2;
default = "";
}
}
}
@ -347,20 +442,6 @@ doommaplumpnames
nodebuild = true;
allowempty = false;
}
REJECT
{
required = false;
nodebuild = true;
allowempty = false;
}
BLOCKMAP
{
required = false;
nodebuild = true;
allowempty = true;
}
}
udmfmaplumpnames
@ -371,7 +452,12 @@ udmfmaplumpnames
nodebuild = true;
allowempty = false;
}
}
// Because Ring Racers has a versatile virtual resource
// system, we can separate these out a bit more.
sharedmaplumpnames
{
REJECT
{
required = false;
@ -385,6 +471,34 @@ udmfmaplumpnames
nodebuild = true;
allowempty = true;
}
PICTURE
{
required = false;
blindcopy = true;
nodebuild = false;
}
MINIMAP
{
required = false;
blindcopy = true;
nodebuild = false;
}
TWEAKMAP
{
required = false;
blindcopy = true;
nodebuild = false;
}
ENCORE
{
required = false;
blindcopy = true;
nodebuild = false;
}
}
// ENUMERATIONS
@ -410,6 +524,12 @@ enums
1 = "Yes";
}
setadd
{
0 = "Set";
1 = "Add";
}
onoff
{
0 = "On";
@ -441,6 +561,13 @@ enums
2 = "Back";
}
frontbackboth
{
0 = "Front";
1 = "Back";
2 = "Front and back";
}
tangibility
{
1 = "Intangible from top";
@ -448,12 +575,132 @@ enums
4 = "Don't block players";
8 = "Don't block non-players";
}
floorceiling
{
0 = "Floor";
1 = "Ceiling";
2 = "Both";
}
scrollcarry
{
0 = "Scroll and carry";
1 = "Scroll";
2 = "Carry";
}
scrolltype
{
0 = "Regular";
1 = "Accelerative";
2 = "Displacement";
}
comparison
{
0 = "Equal";
1 = "Less than or equal";
2 = "Greater than or equal";
}
triggertype
{
0 = "Continuous";
1 = "Once";
2 = "Each time on entry";
3 = "Each time on entry/exit";
}
xtriggertype
{
0 = "Continuous";
1 = "Each time on entry";
2 = "Each time on entry/exit";
}
team
{
0 = "Red";
1 = "Blue";
}
flagcheck
{
0 = "Has all";
1 = "Has any";
2 = "Has exactly";
3 = "Doesn't have all";
4 = "Doesn't have any";
}
maceflags
{
1 = "Double size";
2 = "No sounds";
4 = "Player-turnable chain";
8 = "Swing instead of spin";
16 = "Make chain from end item";
32 = "Spawn link at origin";
64 = "Clip inside ground";
128 = "No distance check";
}
pushablebehavior
{
0 = "Normal";
1 = "Slide";
2 = "Immovable";
3 = "Classic";
}
monitorrespawn
{
0 = "Same item";
1 = "Random (Weak)";
2 = "Random (Strong)";
}
blendmodes
{
0 = "Translucent";
1 = "Add";
2 = "Subtract";
3 = "Reverse subtract";
4 = "Modulate";
}
rritems
{
0 = "Rings";
1 = "Sneaker";
2 = "Rocket Sneaker";
3 = "Invincibility";
4 = "Banana";
5 = "Eggman Mark";
6 = "Orbinaut";
7 = "Jawz";
8 = "Proximity Mine";
9 = "Land Mine";
10 = "Ballhog";
11 = "SPB";
12 = "Grow";
13 = "Shrink";
14 = "Lightning Shield";
15 = "Bubble Shield";
16 = "Flame Shield";
17 = "Hyudoro";
18 = "Pogo Spring";
19 = "Super Ring";
20 = "Kitchen Sink";
21 = "Drop Target";
22 = "Garden Top";
}
}
//Default things filters
thingsfilters
{
filter0
{
name = "Player starts";
@ -461,17 +708,7 @@ thingsfilters
type = -1;
}
filter1
{
name = "Enemies";
category = "enemies";
type = -1;
}
filter2
{
name = "Normal Gravity";
category = "";
@ -484,8 +721,7 @@ thingsfilters
}
filter3
filter2
{
name = "Reverse Gravity";
category = "";
@ -498,22 +734,17 @@ thingsfilters
}
filter4
filter3
{
name = "Rings";
category = "";
type = 300;
}
filter5
filter4
{
name = "Waypoints";
category = "";
type = 2001;
category = "waypoints";
}
}
@ -635,4 +866,4 @@ flats
start = "F_START";
end = "FF_END";
}
}
}

View file

@ -0,0 +1,28 @@
// Don't feel like updating, these are only for Doom format anyway...
sectortypes
{
0 = "Normal";
}
gen_sectortypes
{
first
{
0 = "Normal";
}
second
{
0 = "Normal";
}
third
{
0 = "Normal";
}
fourth
{
0 = "Normal";
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,40 +1,34 @@
/************************************************************************\
Ultimate Doom Builder Game Configuration for SRB2Kart
Ultimate Doom Builder Game Configuration for Dr. Robotnik's Ring Racers
\************************************************************************/
// This is required to prevent accidental use of a different configuration
type = "Doom Builder 2 Game Configuration";
// This is the title to show for this game
game = "SRB2Kart v2.0 (UDMF)";
game = "Dr. Robotnik's Ring Racers (UDMF)";
// This is the simplified game engine/sourceport name
engine = "zdoom";
// Settings common to all games and all map formats
include("Includes\\Kart2_common.cfg", "common");
include("Includes\\RingRacers_common.cfg", "common");
// Settings common to text map format
include("Includes\\Kart2_common.cfg", "mapformat_udmf");
include("Includes\\RingRacers_common.cfg", "mapformat_udmf");
include("Includes\\Game_Kart2.cfg");
include("Includes\\Game_RingRacers.cfg");
// Script lumps detection
scriptlumpnames
{
include("Includes\\Kart2_misc.cfg", "scriptlumpnames");
}
// THING TYPES
thingtypes
{
include("Includes\\Kart2_things.cfg");
include("Includes\\RingRacers_misc.cfg", "scriptlumpnames");
}
//Default things filters
thingsfilters
{
include("Includes\\Kart2_misc.cfg", "thingsfilters");
include("Includes\\RingRacers_misc.cfg", "thingsfilters");
}
// ENUMERATIONS
@ -43,5 +37,5 @@ thingsfilters
enums
{
// Basic game enums
include("Includes\\Kart2_misc.cfg", "enums");
}
include("Includes\\RingRacers_misc.cfg", "enums");
}

View file

@ -1067,7 +1067,7 @@ void D_RegisterClientCommands(void)
// ingame object placing
COM_AddCommand("objectplace", Command_ObjectPlace_f);
COM_AddCommand("writethings", Command_Writethings_f);
//COM_AddCommand("writethings", Command_Writethings_f);
CV_RegisterVar(&cv_speed);
CV_RegisterVar(&cv_opflags);
CV_RegisterVar(&cv_ophoopflags);

View file

@ -339,14 +339,85 @@ static inline int lib_getenum(lua_State *L)
}
else if (fastncmp("ML_", word, 3)) {
p = word+3;
for (i = 0; i < 16; i++)
if (ML_LIST[i] && fastcmp(p, ML_LIST[i])) {
for (i = 0; ML_LIST[i]; i++)
if (fastcmp(p, ML_LIST[i])) {
lua_pushinteger(L, ((lua_Integer)1<<i));
return 1;
}
// Aliases
if (fastcmp(p, "EFFECT1"))
{
lua_pushinteger(L, (lua_Integer)ML_SKEWTD);
return 1;
}
if (fastcmp(p, "EFFECT2"))
{
lua_pushinteger(L, (lua_Integer)ML_NOSKEW);
return 1;
}
if (fastcmp(p, "EFFECT3"))
{
lua_pushinteger(L, (lua_Integer)ML_MIDPEG);
return 1;
}
if (fastcmp(p, "EFFECT4"))
{
lua_pushinteger(L, (lua_Integer)ML_MIDSOLID);
return 1;
}
if (fastcmp(p, "EFFECT5"))
{
lua_pushinteger(L, (lua_Integer)ML_WRAPMIDTEX);
return 1;
}
if (mathlib) return luaL_error(L, "linedef flag '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("MSF_", word, 4)) {
p = word + 4;
for (i = 0; MSF_LIST[i]; i++)
if (fastcmp(p, MSF_LIST[i])) {
lua_pushinteger(L, ((lua_Integer)1 << i));
return 1;
}
if (fastcmp(p, "FLIPSPECIAL_BOTH"))
{
lua_pushinteger(L, (lua_Integer)MSF_FLIPSPECIAL_BOTH);
return 1;
}
if (mathlib) return luaL_error(L, "sector flag '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("SSF_", word, 4)) {
p = word + 4;
for (i = 0; SSF_LIST[i]; i++)
if (fastcmp(p, SSF_LIST[i])) {
lua_pushinteger(L, ((lua_Integer)1 << i));
return 1;
}
if (mathlib) return luaL_error(L, "sector special flag '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("SD_", word, 3)) {
p = word + 3;
for (i = 0; SD_LIST[i]; i++)
if (fastcmp(p, SD_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
if (mathlib) return luaL_error(L, "sector damagetype '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("TO_", word, 3)) {
p = word + 3;
for (i = 0; TO_LIST[i]; i++)
if (fastcmp(p, TO_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
if (mathlib) return luaL_error(L, "sector triggerer '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("S_",word,2)) {
p = word+2;
for (i = 0; i < NUMSTATEFREESLOTS; i++) {

View file

@ -168,6 +168,7 @@ actionpointer_t actionpointers[] =
{{A_Boss3Path}, "A_BOSS3PATH"},
{{A_Boss3ShockThink}, "A_BOSS3SHOCKTHINK"},
{{A_LinedefExecute}, "A_LINEDEFEXECUTE"},
{{A_LinedefExecuteFromArg}, "A_LINEDEFEXECUTEFROMARG"},
{{A_PlaySeeSound}, "A_PLAYSEESOUND"},
{{A_PlayAttackSound}, "A_PLAYATTACKSOUND"},
{{A_PlayActiveSound}, "A_PLAYACTIVESOUND"},
@ -5125,17 +5126,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_FINISHFLAG", // Finish flag
// Ambient Sounds
"MT_AWATERA", // Ambient Water Sound 1
"MT_AWATERB", // Ambient Water Sound 2
"MT_AWATERC", // Ambient Water Sound 3
"MT_AWATERD", // Ambient Water Sound 4
"MT_AWATERE", // Ambient Water Sound 5
"MT_AWATERF", // Ambient Water Sound 6
"MT_AWATERG", // Ambient Water Sound 7
"MT_AWATERH", // Ambient Water Sound 8
"MT_RANDOMAMBIENT",
"MT_RANDOMAMBIENT2",
"MT_MACHINEAMBIENCE",
"MT_AMBIENT",
"MT_CORK",
"MT_LHRT",
@ -5239,7 +5230,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_CRUMBLEOBJ", // Sound generator for crumbling platform
"MT_TUBEWAYPOINT",
"MT_PUSH",
"MT_PULL",
"MT_GHOST",
"MT_OVERLAY",
"MT_ANGLEMAN",
@ -5808,23 +5798,79 @@ const char *const GAMETYPERULE_LIST[] = {
};
// Linedef flags
const char *const ML_LIST[16] = {
const char *const ML_LIST[] = {
"IMPASSABLE",
"BLOCKPLAYERS",
"TWOSIDED",
"DONTPEGTOP",
"DONTPEGBOTTOM",
"EFFECT1",
"SKEWTD",
"NOCLIMB",
"EFFECT2",
"EFFECT3",
"EFFECT4",
"EFFECT5",
"NOSONIC",
"NOTAILS",
"NOKNUX",
"BOUNCY",
"TFERLINE"
"NOSKEW",
"MIDPEG",
"MIDSOLID",
"WRAPMIDTEX",
"NETONLY",
"NONET",
"BLOCKMONSTERS",
"NOTBOUNCY",
"TFERLINE",
NULL
};
// Sector flags
const char *const MSF_LIST[] = {
"FLIPSPECIAL_FLOOR",
"FLIPSPECIAL_CEILING",
"TRIGGERSPECIAL_TOUCH",
"TRIGGERSPECIAL_HEADBUMP",
"TRIGGERLINE_PLANE",
"TRIGGERLINE_MOBJ",
"GRAVITYFLIP",
"HEATWAVE",
"NOCLIPCAMERA",
NULL
};
// Sector special flags
const char *const SSF_LIST[] = {
"DELETEITEMS",
"DOUBLESTEPUP",
"WINDCURRENT",
"CONVEYOR",
"\x01", // free (name un-matchable)
"STARPOSTACTIVATOR",
"EXIT",
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"FAN",
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"ZOOMTUBESTART",
"ZOOMTUBEEND",
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
NULL
};
// Sector damagetypes
const char *const SD_LIST[] = {
"NONE",
"GENERIC",
"LAVA",
"DEATHPIT",
"INSTAKILL",
NULL
};
// Sector triggerer
const char *const TO_LIST[] = {
"PLAYER",
"ALLPLAYERS",
"MOBJ",
NULL
};
const char *COLOR_ENUMS[] = {
@ -6172,6 +6218,7 @@ struct int_const_s const INT_CONST[] = {
{"AST_REVERSESUBTRACT",AST_REVERSESUBTRACT},
{"AST_MODULATE",AST_MODULATE},
{"AST_OVERLAY",AST_OVERLAY},
{"AST_FOG",AST_FOG},
// Render flags
{"RF_HORIZONTALFLIP",RF_HORIZONTALFLIP},
@ -6400,44 +6447,92 @@ struct int_const_s const INT_CONST[] = {
{"SKSKPOWR",SKSKPOWR}, // Power item taunt
// 3D Floor/Fake Floor/FOF/whatever flags
{"FF_EXISTS",FF_EXISTS}, ///< Always set, to check for validity.
{"FF_BLOCKPLAYER",FF_BLOCKPLAYER}, ///< Solid to player, but nothing else
{"FF_BLOCKOTHERS",FF_BLOCKOTHERS}, ///< Solid to everything but player
{"FF_SOLID",FF_SOLID}, ///< Clips things.
{"FF_RENDERSIDES",FF_RENDERSIDES}, ///< Renders the sides.
{"FF_RENDERPLANES",FF_RENDERPLANES}, ///< Renders the floor/ceiling.
{"FF_RENDERALL",FF_RENDERALL}, ///< Renders everything.
{"FF_SWIMMABLE",FF_SWIMMABLE}, ///< Is a water block.
{"FF_NOSHADE",FF_NOSHADE}, ///< Messes with the lighting?
{"FF_CUTSOLIDS",FF_CUTSOLIDS}, ///< Cuts out hidden solid pixels.
{"FF_CUTEXTRA",FF_CUTEXTRA}, ///< Cuts out hidden translucent pixels.
{"FF_CUTLEVEL",FF_CUTLEVEL}, ///< Cuts out all hidden pixels.
{"FF_CUTSPRITES",FF_CUTSPRITES}, ///< Final step in making 3D water.
{"FF_BOTHPLANES",FF_BOTHPLANES}, ///< Render inside and outside planes.
{"FF_EXTRA",FF_EXTRA}, ///< Gets cut by ::FF_CUTEXTRA.
{"FF_TRANSLUCENT",FF_TRANSLUCENT}, ///< See through!
{"FF_FOG",FF_FOG}, ///< Fog "brush."
{"FF_INVERTPLANES",FF_INVERTPLANES}, ///< Only render inside planes.
{"FF_ALLSIDES",FF_ALLSIDES}, ///< Render inside and outside sides.
{"FF_INVERTSIDES",FF_INVERTSIDES}, ///< Only render inside sides.
{"FF_DOUBLESHADOW",FF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light?
{"FF_FLOATBOB",FF_FLOATBOB}, ///< Floats on water and bobs if you step on it.
{"FF_NORETURN",FF_NORETURN}, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling.
{"FF_CRUMBLE",FF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
{"FF_SHATTERBOTTOM",FF_SHATTERBOTTOM}, ///< Used with ::FF_BUSTUP. Like FF_SHATTER, but only breaks from the bottom. Good for springing up through rubble.
{"FF_MARIO",FF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
{"FF_BUSTUP",FF_BUSTUP}, ///< You can spin through/punch this block and it will crumble!
{"FF_QUICKSAND",FF_QUICKSAND}, ///< Quicksand!
{"FF_PLATFORM",FF_PLATFORM}, ///< You can jump up through this to the top.
{"FF_REVERSEPLATFORM",FF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
{"FF_INTANGIBLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid.
{"FF_INTANGABLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangable, but the sides are still solid.
{"FF_SHATTER",FF_SHATTER}, ///< Used with ::FF_BUSTUP. Bustable on mere touch.
{"FF_SPINBUST",FF_SPINBUST}, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
{"FF_STRONGBUST",FF_STRONGBUST}, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
{"FF_RIPPLE",FF_RIPPLE}, ///< Ripple the flats
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
{"FOF_EXISTS",FOF_EXISTS}, ///< Always set, to check for validity.
{"FOF_BLOCKPLAYER",FOF_BLOCKPLAYER}, ///< Solid to player, but nothing else
{"FOF_BLOCKOTHERS",FOF_BLOCKOTHERS}, ///< Solid to everything but player
{"FOF_SOLID",FOF_SOLID}, ///< Clips things.
{"FOF_RENDERSIDES",FOF_RENDERSIDES}, ///< Renders the sides.
{"FOF_RENDERPLANES",FOF_RENDERPLANES}, ///< Renders the floor/ceiling.
{"FOF_RENDERALL",FOF_RENDERALL}, ///< Renders everything.
{"FOF_SWIMMABLE",FOF_SWIMMABLE}, ///< Is a water block.
{"FOF_NOSHADE",FOF_NOSHADE}, ///< Messes with the lighting?
{"FOF_CUTSOLIDS",FOF_CUTSOLIDS}, ///< Cuts out hidden solid pixels.
{"FOF_CUTEXTRA",FOF_CUTEXTRA}, ///< Cuts out hidden translucent pixels.
{"FOF_CUTLEVEL",FOF_CUTLEVEL}, ///< Cuts out all hidden pixels.
{"FOF_CUTSPRITES",FOF_CUTSPRITES}, ///< Final step in making 3D water.
{"FOF_BOTHPLANES",FOF_BOTHPLANES}, ///< Render inside and outside planes.
{"FOF_EXTRA",FOF_EXTRA}, ///< Gets cut by ::FOF_CUTEXTRA.
{"FOF_TRANSLUCENT",FOF_TRANSLUCENT}, ///< See through!
{"FOF_FOG",FOF_FOG}, ///< Fog "brush."
{"FOF_INVERTPLANES",FOF_INVERTPLANES}, ///< Only render inside planes.
{"FOF_ALLSIDES",FOF_ALLSIDES}, ///< Render inside and outside sides.
{"FOF_INVERTSIDES",FOF_INVERTSIDES}, ///< Only render inside sides.
{"FOF_DOUBLESHADOW",FOF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light?
{"FOF_FLOATBOB",FOF_FLOATBOB}, ///< Floats on water and bobs if you step on it.
{"FOF_NORETURN",FOF_NORETURN}, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling.
{"FOF_CRUMBLE",FOF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
{"FOF_GOOWATER",FOF_GOOWATER}, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop.
{"FOF_MARIO",FOF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
{"FOF_BUSTUP",FOF_BUSTUP}, ///< You can spin through/punch this block and it will crumble!
{"FOF_QUICKSAND",FOF_QUICKSAND}, ///< Quicksand!
{"FOF_PLATFORM",FOF_PLATFORM}, ///< You can jump up through this to the top.
{"FOF_REVERSEPLATFORM",FOF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
{"FOF_INTANGIBLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid.
{"FOF_RIPPLE",FOF_RIPPLE}, ///< Ripple the flats
{"FOF_COLORMAPONLY",FOF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
{"FOF_BOUNCY",FOF_BOUNCY}, ///< Bounces players
{"FOF_SPLAT",FOF_SPLAT}, ///< Use splat flat renderer (treat cyan pixels as invisible)
// Old FOF flags for backwards compatibility
{"FF_EXISTS",FF_OLD_EXISTS},
{"FF_BLOCKPLAYER",FF_OLD_BLOCKPLAYER},
{"FF_BLOCKOTHERS",FF_OLD_BLOCKOTHERS},
{"FF_SOLID",FF_OLD_SOLID},
{"FF_RENDERSIDES",FF_OLD_RENDERSIDES},
{"FF_RENDERPLANES",FF_OLD_RENDERPLANES},
{"FF_RENDERALL",FF_OLD_RENDERALL},
{"FF_SWIMMABLE",FF_OLD_SWIMMABLE},
{"FF_NOSHADE",FF_OLD_NOSHADE},
{"FF_CUTSOLIDS",FF_OLD_CUTSOLIDS},
{"FF_CUTEXTRA",FF_OLD_CUTEXTRA},
{"FF_CUTLEVEL",FF_OLD_CUTLEVEL},
{"FF_CUTSPRITES",FF_OLD_CUTSPRITES},
{"FF_BOTHPLANES",FF_OLD_BOTHPLANES},
{"FF_EXTRA",FF_OLD_EXTRA},
{"FF_TRANSLUCENT",FF_OLD_TRANSLUCENT},
{"FF_FOG",FF_OLD_FOG},
{"FF_INVERTPLANES",FF_OLD_INVERTPLANES},
{"FF_ALLSIDES",FF_OLD_ALLSIDES},
{"FF_INVERTSIDES",FF_OLD_INVERTSIDES},
{"FF_DOUBLESHADOW",FF_OLD_DOUBLESHADOW},
{"FF_FLOATBOB",FF_OLD_FLOATBOB},
{"FF_NORETURN",FF_OLD_NORETURN},
{"FF_CRUMBLE",FF_OLD_CRUMBLE},
{"FF_SHATTERBOTTOM",FF_OLD_SHATTERBOTTOM},
{"FF_GOOWATER",FF_OLD_GOOWATER},
{"FF_MARIO",FF_OLD_MARIO},
{"FF_BUSTUP",FF_OLD_BUSTUP},
{"FF_QUICKSAND",FF_OLD_QUICKSAND},
{"FF_PLATFORM",FF_OLD_PLATFORM},
{"FF_REVERSEPLATFORM",FF_OLD_REVERSEPLATFORM},
{"FF_INTANGIBLEFLATS",FF_OLD_INTANGIBLEFLATS},
{"FF_INTANGABLEFLATS",FF_OLD_INTANGIBLEFLATS},
{"FF_SHATTER",FF_OLD_SHATTER},
{"FF_SPINBUST",FF_OLD_SPINBUST},
{"FF_STRONGBUST",FF_OLD_STRONGBUST},
{"FF_RIPPLE",FF_OLD_RIPPLE},
{"FF_COLORMAPONLY",FF_OLD_COLORMAPONLY},
// FOF bustable flags
{"FB_PUSHABLES",FB_PUSHABLES},
{"FB_EXECUTOR",FB_EXECUTOR},
{"FB_ONLYBOTTOM",FB_ONLYBOTTOM},
// Bustable FOF type
{"BT_TOUCH",BT_TOUCH},
{"BT_SPINBUST",BT_SPINBUST},
{"BT_REGULAR",BT_REGULAR},
{"BT_STRONG",BT_STRONG},
// PolyObject flags
{"POF_CLIPLINES",POF_CLIPLINES}, ///< Test against lines for collision

View file

@ -63,7 +63,11 @@ extern const char *const MOBJEFLAG_LIST[];
extern const char *const MAPTHINGFLAG_LIST[4];
extern const char *const PLAYERFLAG_LIST[];
extern const char *const GAMETYPERULE_LIST[];
extern const char *const ML_LIST[16]; // Linedef flags
extern const char *const ML_LIST[]; // Linedef flags
extern const char *const MSF_LIST[]; // Sector flags
extern const char *const SSF_LIST[]; // Sector special flags
extern const char *const SD_LIST[]; // Sector damagetype
extern const char *const TO_LIST[]; // Sector triggerer
extern const char *COLOR_ENUMS[];
extern const char *const POWERS_LIST[];
extern const char *const KARTHUD_LIST[];

View file

@ -99,48 +99,57 @@ typedef struct
// LineDef attributes.
//
// Solid, is an obstacle.
#define ML_IMPASSABLE 1
enum
{
// Solid, is an obstacle.
ML_IMPASSABLE = 0x00000001,
// SRB2Kart: Blocks players only; items can be thrown through these.
#define ML_BLOCKPLAYERS 2
// SRB2Kart: Blocks players only; items can be thrown through these.
ML_BLOCKPLAYERS = 0x00000002,
// Backside will not be present at all if not two sided.
#define ML_TWOSIDED 4
// Backside will not be present at all if not two sided.
ML_TWOSIDED = 0x00000004,
// If a texture is pegged, the texture will have
// the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled
// down things) and will move with a height change
// of one of the neighbor sectors.
// Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both
// top and bottom textures (use next to windows).
// If a texture is pegged, the texture will have
// the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled
// down things) and will move with a height change
// of one of the neighbor sectors.
// Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both
// top and bottom textures (use next to windows).
// upper texture unpegged
#define ML_DONTPEGTOP 8
// upper texture unpegged
ML_DONTPEGTOP = 0x00000008,
// lower texture unpegged
#define ML_DONTPEGBOTTOM 16
// lower texture unpegged
ML_DONTPEGBOTTOM = 0x00000010,
#define ML_EFFECT1 32
ML_SKEWTD = 0x00000020,
// Don't let Knuckles climb on this line
#define ML_NOCLIMB 64
// Don't let Knuckles climb on this line
ML_NOCLIMB = 0x00000040,
#define ML_EFFECT2 128
#define ML_EFFECT3 256
#define ML_EFFECT4 512
#define ML_EFFECT5 1024
ML_NOSKEW = 0x00000080,
ML_MIDPEG = 0x00000100,
ML_MIDSOLID = 0x00000200,
ML_WRAPMIDTEX = 0x00000400,
#define ML_NETONLY 2048 // Apply effect only in netgames
#define ML_NONET 4096 // Apply effect only in single player games
#define ML_EFFECT6 8192
// Apply effect only in netgames
ML_NETONLY = 0x00000800,
// Don't bounce off this wall!
#define ML_NOTBOUNCY 16384
// Apply effect only in single player games
ML_NONET = 0x00001000,
#define ML_TFERLINE 32768
// Blocks enemies only
ML_BLOCKMONSTERS = 0x00002000,
// Don't bounce off this wall!
ML_NOTBOUNCY = 0x00004000,
// Transfers FOF properties.
ML_TFERLINE = 0x00008000,
};
// Sector definition, from editing.
typedef struct
@ -196,7 +205,7 @@ typedef struct
#pragma pack()
#endif
#define NUMMAPTHINGARGS 6
#define NUMMAPTHINGARGS 10
#define NUMMAPTHINGSTRINGARGS 2
// Thing definition, position, orientation and type,

View file

@ -423,7 +423,7 @@ extern skincolor_t skincolors[MAXSKINCOLORS];
#define PUSHACCEL (2*FRACUNIT) // Acceleration for MF2_SLIDEPUSH items.
// Special linedef executor tag numbers!
// Special linedef executor tag numbers! Binary map format only (UDMF has other ways of doing these things).
enum {
LE_PINCHPHASE = -2, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!)
LE_ALLBOSSESDEAD = -3, // All bosses in the map are dead (Egg capsule raise)
@ -503,10 +503,17 @@ extern char liveeventbackup[256];
void M_StartupLocale(void);
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
char *va(const char *format, ...) FUNCPRINTF;
char *M_GetToken(const char *inputString);
void M_UnGetToken(void);
UINT32 M_GetTokenPos(void);
void M_SetTokenPos(UINT32 newPos);
void M_TokenizerOpen(const char *inputString);
void M_TokenizerClose(void);
const char *M_TokenizerRead(UINT32 i);
UINT32 M_TokenizerGetEndPos(void);
void M_TokenizerSetEndPos(UINT32 newPos);
char *sizeu1(size_t num);
char *sizeu2(size_t num);
char *sizeu3(size_t num);

View file

@ -3379,7 +3379,7 @@ void G_AddGhost(char *defdemoname)
gh->mo->angle = FixedAngle(mthing->angle << FRACBITS);
f = gh->mo->floorz;
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
if (!!(mthing->args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP))
{
z = c - offset;
if (z < f)

View file

@ -222,6 +222,7 @@ enum EPolyFlags
PF_Fog = 0x20000000, // Fog blocks
PF_NoAlphaTest = 0x40000000, // Disables alpha testing
PF_Blending = (PF_Masked|PF_Translucent|PF_Environment|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Invert|PF_Fog) & ~PF_NoAlphaTest,
PF_EnvironmentTrans = (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment),
// other flag bits
PF_Occlude = 0x00000100, // Updates the depth buffer

View file

@ -503,7 +503,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
lightlevel = HWR_CalcSlopeLight(lightlevel, slope);
HWR_Lighting(&Surf, lightlevel, planecolormap);
if (PolyFlags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_Fog))
if (PolyFlags & PF_EnvironmentTrans)
{
Surf.PolyColor.s.alpha = (UINT8)alpha;
PolyFlags |= PF_Modulated;
@ -839,9 +839,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
if (endtop < endrealbot && top < realbot)
return;
if (!(list[i].flags & FF_NOSHADE))
if (!(list[i].flags & FOF_NOSHADE))
{
if (pfloor && (pfloor->flags & FF_FOG))
if (pfloor && (pfloor->fofflags & FOF_FOG))
{
lightnum = pfloor->master->frontsector->lightlevel;
colormap = pfloor->master->frontsector->extra_colormap;
@ -855,13 +855,13 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
solid = false;
if ((sector->lightlist[i].flags & FF_CUTSOLIDS) && !(cutflag & FF_EXTRA))
if ((sector->lightlist[i].flags & FOF_CUTSOLIDS) && !(cutflag & FOF_EXTRA))
solid = true;
else if ((sector->lightlist[i].flags & FF_CUTEXTRA) && (cutflag & FF_EXTRA))
else if ((sector->lightlist[i].flags & FOF_CUTEXTRA) && (cutflag & FOF_EXTRA))
{
if (sector->lightlist[i].flags & FF_EXTRA)
if (sector->lightlist[i].flags & FOF_EXTRA)
{
if ((sector->lightlist[i].flags & (FF_FOG|FF_SWIMMABLE)) == (cutflag & (FF_FOG|FF_SWIMMABLE))) // Only merge with your own types
if ((sector->lightlist[i].flags & (FOF_FOG|FOF_SWIMMABLE)) == (cutflag & (FOF_FOG|FOF_SWIMMABLE))) // Only merge with your own types
solid = true;
}
else
@ -932,7 +932,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
if (polyflags & PF_Fog)
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, true, HWR_CalcWallLight(lightnum, gl_curline), colormap);
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_Environment))
else if (polyflags & PF_EnvironmentTrans)
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, HWR_CalcWallLight(lightnum, gl_curline), colormap);
else
HWR_ProjectWall(wallVerts, Surf, polyflags, HWR_CalcWallLight(lightnum, gl_curline), colormap);
@ -961,7 +961,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
if (polyflags & PF_Fog)
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, true, HWR_CalcWallLight(lightnum, gl_curline), colormap);
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_Environment))
else if (polyflags & PF_EnvironmentTrans)
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, HWR_CalcWallLight(lightnum, gl_curline), colormap);
else
HWR_ProjectWall(wallVerts, Surf, polyflags, HWR_CalcWallLight(lightnum, gl_curline), colormap);
@ -1098,7 +1098,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// PEGGING
if (gl_linedef->flags & ML_DONTPEGTOP)
texturevpegtop = 0;
else if (gl_linedef->flags & ML_EFFECT1)
else if (gl_linedef->flags & ML_SKEWTD)
texturevpegtop = worldhigh + textureheight[gl_sidedef->toptexture] - worldtop;
else
texturevpegtop = gl_backsector->ceilingheight + textureheight[gl_sidedef->toptexture] - gl_frontsector->ceilingheight;
@ -1114,7 +1114,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
// Adjust t value for sloped walls
if (!(gl_linedef->flags & ML_EFFECT1))
if (!(gl_linedef->flags & ML_SKEWTD))
{
// Unskewed
wallVerts[3].t -= (worldtop - gl_frontsector->ceilingheight) * grTex->scaleY;
@ -1150,7 +1150,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
polyflags = PF_Environment;
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FF_CUTLEVEL, NULL, polyflags);
HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FOF_CUTLEVEL, NULL, polyflags);
else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_toptexture, polyflags, false, lightnum, colormap);
else
@ -1171,7 +1171,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// PEGGING
if (!(gl_linedef->flags & ML_DONTPEGBOTTOM))
texturevpegbottom = 0;
else if (gl_linedef->flags & ML_EFFECT1)
else if (gl_linedef->flags & ML_SKEWTD)
texturevpegbottom = worldbottom - worldlow;
else
texturevpegbottom = gl_frontsector->floorheight - gl_backsector->floorheight;
@ -1187,7 +1187,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
// Adjust t value for sloped walls
if (!(gl_linedef->flags & ML_EFFECT1))
if (!(gl_linedef->flags & ML_SKEWTD))
{
// Unskewed
wallVerts[0].t -= (worldbottom - gl_frontsector->floorheight) * grTex->scaleY;
@ -1223,7 +1223,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
polyflags = PF_Environment;
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FF_CUTLEVEL, NULL, polyflags);
HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FOF_CUTLEVEL, NULL, polyflags);
else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_bottomtexture, polyflags, false, lightnum, colormap);
else
@ -1251,7 +1251,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (gl_sidedef->repeatcnt)
repeats = 1 + gl_sidedef->repeatcnt;
else if (gl_linedef->flags & ML_EFFECT5)
else if (gl_linedef->flags & ML_WRAPMIDTEX)
{
fixed_t high, low;
@ -1293,9 +1293,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
popenbottom = max(worldbottom, worldlow);
}
if (gl_linedef->flags & ML_EFFECT2)
if (gl_linedef->flags & ML_NOSKEW)
{
if (!!(gl_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gl_linedef->flags & ML_EFFECT3))
if (gl_linedef->flags & ML_MIDPEG)
{
polybottom = max(front->floorheight, back->floorheight) + gl_sidedef->rowoffset;
polytop = polybottom + textureheight[gl_midtexture]*repeats;
@ -1306,7 +1306,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
polybottom = polytop - textureheight[gl_midtexture]*repeats;
}
}
else if (!!(gl_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gl_linedef->flags & ML_EFFECT3))
else if (gl_linedef->flags & ML_MIDPEG)
{
polybottom = popenbottom + gl_sidedef->rowoffset;
polytop = polybottom + textureheight[gl_midtexture]*repeats;
@ -1336,7 +1336,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
// PEGGING
if (!!(gl_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gl_linedef->flags & ML_EFFECT3))
if (gl_linedef->flags & ML_MIDPEG)
texturevpeg = textureheight[gl_sidedef->midtexture]*repeats - h + polybottom;
else
texturevpeg = polytop - h;
@ -1359,9 +1359,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
fixed_t midtextureslant;
if (gl_linedef->flags & ML_EFFECT2)
if (gl_linedef->flags & ML_NOSKEW)
midtextureslant = 0;
else if (!!(gl_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gl_linedef->flags & ML_EFFECT3))
else if (gl_linedef->flags & ML_MIDPEG)
midtextureslant = worldlow < worldbottom
? worldbottomslope-worldbottom
: worldlowslope-worldlow;
@ -1386,7 +1386,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
// PEGGING
if (!!(gl_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gl_linedef->flags & ML_EFFECT3))
if (gl_linedef->flags & ML_MIDPEG)
texturevpeg = textureheight[gl_sidedef->midtexture]*repeats - h + polybottom;
else
texturevpeg = polytop - h;
@ -1400,49 +1400,17 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// set alpha for transparent walls
// ooops ! this do not work at all because render order we should render it in backtofront order
switch (gl_linedef->special)
if (gl_linedef->blendmode && gl_linedef->blendmode != AST_FOG)
{
// Translucent
case 102:
case 121:
case 123:
case 124:
case 125:
case 141:
case 142:
case 144:
case 145:
case 174:
case 175:
case 192:
case 195:
case 221:
case 253:
case 256:
blendmode = PF_Translucent;
break;
case 913:
blendmode = PF_Multiplicative;
Surf.PolyColor.s.alpha = 0xff;
break;
default:
{
UINT32 blend = 0;
transnum_t transtable = R_GetLinedefTransTable(gl_linedef);
if (transtable == NUMTRANSMAPS)
transtable = 0;
if (gl_linedef->special == 910 ||
P_IsLineTripWire(gl_linedef))
blend = AST_ADD;
else if (gl_linedef->special == 911)
blend = AST_SUBTRACT;
else if (gl_linedef->special == 912)
blend = AST_REVERSESUBTRACT;
blendmode = HWR_SurfaceBlend(blend, transtable, &Surf);
break;
}
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
else
blendmode = HWR_GetBlendModeFlag(gl_linedef->blendmode);
}
else if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
else
blendmode = PF_Masked;
if (gl_curline->polyseg && gl_curline->polyseg->translucency > 0)
{
@ -1462,10 +1430,10 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (gl_frontsector->numlights)
{
if (!(blendmode & PF_Masked))
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, blendmode); // vanilla just uses PF_Masked here - if we run into any issues, maybe change to that
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_TRANSLUCENT, NULL, blendmode); // vanilla just uses PF_Masked here - if we run into any issues, maybe change to that
else
{
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, blendmode); // vanilla just uses PF_Masked here - if we run into any issues, maybe change to that
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, blendmode); // vanilla just uses PF_Masked here - if we run into any issues, maybe change to that
}
}
else if (!(blendmode & PF_Masked))
@ -1510,7 +1478,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
fixed_t texturevpeg;
// PEGGING
if ((gl_linedef->flags & (ML_DONTPEGBOTTOM|ML_EFFECT2)) == (ML_DONTPEGBOTTOM|ML_EFFECT2))
if ((gl_linedef->flags & (ML_DONTPEGBOTTOM|ML_NOSKEW)) == (ML_DONTPEGBOTTOM|ML_NOSKEW))
texturevpeg = gl_frontsector->floorheight + textureheight[gl_sidedef->midtexture] - gl_frontsector->ceilingheight + gl_sidedef->rowoffset;
else if (gl_linedef->flags & ML_DONTPEGBOTTOM)
texturevpeg = worldbottom + textureheight[gl_sidedef->midtexture] - worldtop + gl_sidedef->rowoffset;
@ -1526,7 +1494,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
// Texture correction for slopes
if (gl_linedef->flags & ML_EFFECT2) {
if (gl_linedef->flags & ML_NOSKEW) {
wallVerts[3].t += (gl_frontsector->ceilingheight - worldtop) * grTex->scaleY;
wallVerts[2].t += (gl_frontsector->ceilingheight - worldtopslope) * grTex->scaleY;
wallVerts[0].t += (gl_frontsector->floorheight - worldbottom) * grTex->scaleY;
@ -1546,6 +1514,10 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope);
wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope);
// I don't think that solid walls can use translucent linedef types...
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, 0);
else
{
FBITFIELD blendmode = PF_Masked;
if (grTex->mipmap.flags & TF_TRANSPARENT)
@ -1553,7 +1525,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// I don't think that solid walls can use translucent linedef types...
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, blendmode);
else
{
if (grTex->mipmap.flags & TF_TRANSPARENT)
@ -1618,9 +1590,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (bothsides) continue;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -1661,7 +1633,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].y = FIXED_TO_FLOAT(hS);
wallVerts[0].y = FIXED_TO_FLOAT(l);
wallVerts[1].y = FIXED_TO_FLOAT(lS);
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
wallVerts[3].t = wallVerts[2].t = 0;
wallVerts[0].t = wallVerts[1].t = 0;
@ -1681,13 +1653,13 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
texturevpeg = sides[newline->sidenum[0]].rowoffset;
attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM);
slopeskew = !!(newline->flags & ML_DONTPEGTOP);
slopeskew = !!(newline->flags & ML_SKEWTD);
}
else
{
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
attachtobottom = !!(gl_linedef->flags & ML_DONTPEGBOTTOM);
slopeskew = !!(rover->master->flags & ML_DONTPEGTOP);
slopeskew = !!(rover->master->flags & ML_SKEWTD);
}
grTex = HWR_GetTexture(texnum);
@ -1720,7 +1692,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
}
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
FBITFIELD blendmode;
@ -1732,7 +1704,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode);
else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
}
@ -1740,7 +1712,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
FBITFIELD blendmode = PF_Masked;
if (rover->flags & FF_TRANSLUCENT)
if (rover->fofflags & FOF_TRANSLUCENT)
{
if (rover->alpha < 256 || rover->blend)
{
@ -1750,7 +1722,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
}
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode);
else
{
if (blendmode != PF_Masked)
@ -1778,9 +1750,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (bothsides) continue;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -1820,7 +1792,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].y = FIXED_TO_FLOAT(hS);
wallVerts[0].y = FIXED_TO_FLOAT(l);
wallVerts[1].y = FIXED_TO_FLOAT(lS);
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
wallVerts[3].t = wallVerts[2].t = 0;
wallVerts[0].t = wallVerts[1].t = 0;
@ -1846,7 +1818,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
}
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
FBITFIELD blendmode;
@ -1858,7 +1830,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode);
else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
}
@ -1866,7 +1838,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
FBITFIELD blendmode = PF_Masked;
if (rover->flags & FF_TRANSLUCENT)
if (rover->fofflags & FOF_TRANSLUCENT)
{
if (rover->alpha < 256 || rover->blend)
{
@ -1876,7 +1848,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
}
if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode);
else
{
if (blendmode != PF_Masked)
@ -2899,7 +2871,7 @@ static void HWR_AddPolyObjectPlanes(void)
}
else
{
HWR_GetLevelFlat(&levelflats[polyobjsector->floorpic], R_NoEncore(polyobjsector, false));
HWR_GetLevelFlat(&levelflats[polyobjsector->floorpic], R_NoEncore(polyobjsector, &levelflats[polyobjsector->floorpic], false));
HWR_RenderPolyObjectPlane(po_ptrs[i], false, polyobjsector->floorheight, PF_Occlude,
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), &levelflats[polyobjsector->floorpic],
polyobjsector, 255, (light == -1 ? gl_frontsector->extra_colormap : *gl_frontsector->lightlist[light].extra_colormap));
@ -2922,7 +2894,7 @@ static void HWR_AddPolyObjectPlanes(void)
}
else
{
HWR_GetLevelFlat(&levelflats[polyobjsector->ceilingpic], R_NoEncore(polyobjsector, true));
HWR_GetLevelFlat(&levelflats[polyobjsector->ceilingpic], R_NoEncore(polyobjsector, &levelflats[polyobjsector->ceilingpic], true));
HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude,
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), &levelflats[polyobjsector->ceilingpic],
polyobjsector, 255, (light == -1 ? gl_frontsector->extra_colormap : *gl_frontsector->lightlist[light].extra_colormap));
@ -3038,13 +3010,13 @@ static void HWR_Subsector(size_t num)
}
light = R_GetPlaneLight(gl_frontsector, locFloorHeight, false);
if (gl_frontsector->floorlightsec == -1)
floorlightlevel = *gl_frontsector->lightlist[light].lightlevel;
if (gl_frontsector->floorlightsec == -1 && !gl_frontsector->floorlightabsolute)
floorlightlevel = max(0, min(255, *gl_frontsector->lightlist[light].lightlevel + gl_frontsector->floorlightlevel));
floorcolormap = *gl_frontsector->lightlist[light].extra_colormap;
light = R_GetPlaneLight(gl_frontsector, locCeilingHeight, false);
if (gl_frontsector->ceilinglightsec == -1)
ceilinglightlevel = *gl_frontsector->lightlist[light].lightlevel;
if (gl_frontsector->ceilinglightsec == -1 && !gl_frontsector->ceilinglightabsolute)
ceilinglightlevel = max(0, min(255, *gl_frontsector->lightlist[light].lightlevel + gl_frontsector->ceilinglightlevel));
ceilingcolormap = *gl_frontsector->lightlist[light].extra_colormap;
}
@ -3059,7 +3031,7 @@ static void HWR_Subsector(size_t num)
{
if (sub->validcount != validcount)
{
HWR_GetLevelFlat(&levelflats[gl_frontsector->floorpic], R_NoEncore(gl_frontsector, false));
HWR_GetLevelFlat(&levelflats[gl_frontsector->floorpic], R_NoEncore(gl_frontsector, &levelflats[gl_frontsector->floorpic], false));
HWR_RenderPlane(sub, &extrasubsectors[num], false,
// Hack to make things continue to work around slopes.
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
@ -3082,7 +3054,7 @@ static void HWR_Subsector(size_t num)
{
if (sub->validcount != validcount)
{
HWR_GetLevelFlat(&levelflats[gl_frontsector->ceilingpic], R_NoEncore(gl_frontsector, true));
HWR_GetLevelFlat(&levelflats[gl_frontsector->ceilingpic], R_NoEncore(gl_frontsector, &levelflats[gl_frontsector->ceilingpic], true));
HWR_RenderPlane(sub, &extrasubsectors[num], true,
// Hack to make things continue to work around slopes.
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
@ -3118,17 +3090,17 @@ static void HWR_Subsector(size_t num)
cullHeight = P_GetFFloorBottomZAt(rover, viewx, viewy);
centerHeight = P_GetFFloorBottomZAt(rover, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (sub->validcount == validcount)
continue;
if (centerHeight <= locCeilingHeight &&
centerHeight >= locFloorHeight &&
((dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
UINT8 alpha;
@ -3143,7 +3115,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, rover->master->frontsector->extra_colormap);
}
else if (rover->flags & FF_TRANSLUCENT
else if (rover->fofflags & FOF_TRANSLUCENT
&& (rover->alpha < 256 || rover->blend)) // SoM: Flags are more efficient
{
FBITFIELD blendmode = HWR_GetBlendModeFlag(rover->blend) | HWR_RippleBlend(gl_frontsector, rover, false);
@ -3160,7 +3132,7 @@ static void HWR_Subsector(size_t num)
}
else
{
HWR_GetLevelFlat(&levelflats[*rover->bottompic], R_NoEncore(gl_frontsector, false));
HWR_GetLevelFlat(&levelflats[*rover->bottompic], R_NoEncore(gl_frontsector, &levelflats[*rover->bottompic], false));
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false) | PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
@ -3173,10 +3145,10 @@ static void HWR_Subsector(size_t num)
if (centerHeight >= locFloorHeight &&
centerHeight <= locCeilingHeight &&
((dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
UINT8 alpha;
@ -3191,7 +3163,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, rover->master->frontsector->extra_colormap);
}
else if (rover->flags & FF_TRANSLUCENT
else if (rover->fofflags & FOF_TRANSLUCENT
&& (rover->alpha < 256 || rover->blend)) // SoM: Flags are more efficient
{
FBITFIELD blendmode = HWR_GetBlendModeFlag(rover->blend) | HWR_RippleBlend(gl_frontsector, rover, false);
@ -3208,7 +3180,7 @@ static void HWR_Subsector(size_t num)
}
else
{
HWR_GetLevelFlat(&levelflats[*rover->toppic], R_NoEncore(gl_frontsector, true));
HWR_GetLevelFlat(&levelflats[*rover->toppic], R_NoEncore(gl_frontsector, &levelflats[*rover->toppic], true));
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, true) | PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
@ -3575,7 +3547,7 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v
return false;
cullplane = FIXED_TO_FLOAT(cullheight->frontsector->floorheight);
if (cullheight->flags & ML_NOCLIMB) // Group culling
if (cullheight->args[1]) // Group culling
{
if (!viewcullheight)
return false;
@ -3954,7 +3926,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
return;
// even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite
if (!(list[i].flags & FF_NOSHADE) && (list[i].flags & FF_CUTSPRITES))
if (!(list[i].flags & FOF_NOSHADE) && (list[i].flags & FOF_CUTSPRITES))
{
if (!lightset)
{
@ -4914,7 +4886,7 @@ static void HWR_CreateDrawNodes(void)
gl_frontsector = NULL;
if (!(sortnode[sortindex[i]].plane->blend & PF_NoTexture))
HWR_GetLevelFlat(sortnode[sortindex[i]].plane->levelflat, R_NoEncore(sortnode[sortindex[i]].plane->FOFSector, sortnode[sortindex[i]].plane->isceiling));
HWR_GetLevelFlat(sortnode[sortindex[i]].plane->levelflat, R_NoEncore(sortnode[sortindex[i]].plane->FOFSector, sortnode[sortindex[i]].plane->levelflat, sortnode[sortindex[i]].plane->isceiling));
HWR_RenderPlane(NULL, sortnode[sortindex[i]].plane->xsub, sortnode[sortindex[i]].plane->isceiling, sortnode[sortindex[i]].plane->fixedheight, sortnode[sortindex[i]].plane->blend, sortnode[sortindex[i]].plane->lightlevel,
sortnode[sortindex[i]].plane->levelflat, sortnode[sortindex[i]].plane->FOFSector, sortnode[sortindex[i]].plane->alpha, sortnode[sortindex[i]].plane->planecolormap);
}
@ -4924,7 +4896,7 @@ static void HWR_CreateDrawNodes(void)
gl_frontsector = NULL;
if (!(sortnode[sortindex[i]].polyplane->blend & PF_NoTexture))
HWR_GetLevelFlat(sortnode[sortindex[i]].polyplane->levelflat, R_NoEncore(sortnode[sortindex[i]].polyplane->FOFSector, sortnode[sortindex[i]].polyplane->isceiling));
HWR_GetLevelFlat(sortnode[sortindex[i]].polyplane->levelflat, R_NoEncore(sortnode[sortindex[i]].polyplane->FOFSector, sortnode[sortindex[i]].polyplane->levelflat, sortnode[sortindex[i]].polyplane->isceiling));
HWR_RenderPolyObjectPlane(sortnode[sortindex[i]].polyplane->polysector, sortnode[sortindex[i]].polyplane->isceiling, sortnode[sortindex[i]].polyplane->fixedheight, sortnode[sortindex[i]].polyplane->blend, sortnode[sortindex[i]].polyplane->lightlevel,
sortnode[sortindex[i]].polyplane->levelflat, sortnode[sortindex[i]].polyplane->FOFSector, sortnode[sortindex[i]].polyplane->alpha, sortnode[sortindex[i]].polyplane->planecolormap);
}

View file

@ -1002,7 +1002,7 @@ state_t states[NUMSTATES] =
{SPR_TRET, FF_FULLBRIGHT|2, 7, {A_Pain}, 0, 0, S_TURRETSHOCK7}, // S_TURRETSHOCK6
{SPR_TRET, FF_FULLBRIGHT|3, 7, {NULL}, 0, 0, S_TURRETSHOCK8}, // S_TURRETSHOCK7
{SPR_TRET, FF_FULLBRIGHT|4, 7, {NULL}, 0, 0, S_TURRETSHOCK9}, // S_TURRETSHOCK8
{SPR_TRET, FF_FULLBRIGHT|4, 7, {A_LinedefExecute}, LE_TURRET, 0, S_XPLD1}, // S_TURRETSHOCK9
{SPR_TRET, FF_FULLBRIGHT|4, 7, {A_LinedefExecuteFromArg}, 0, 0, S_XPLD1}, // S_TURRETSHOCK9
{SPR_TURR, 0, 1, {A_Look}, 1, 0, S_TURRETPOPDOWN8}, // S_TURRETLOOK
{SPR_TURR, 0, 0, {A_FaceTarget}, 0, 0, S_TURRETPOPUP1}, // S_TURRETSEE
@ -1555,7 +1555,7 @@ state_t states[NUMSTATES] =
{SPR_FANG, 18, 16, {A_FaceTarget}, 3, 0, S_FANG_PINCHLOBSHOT1}, // S_FANG_PINCHLOBSHOT0
{SPR_FANG, 19, 2, {A_FaceTarget}, 3, 0, S_FANG_PINCHLOBSHOT2}, // S_FANG_PINCHLOBSHOT1
{SPR_FANG, 20, 30, {A_Boss5MakeItRain}, MT_FBOMB, -16, S_FANG_PINCHLOBSHOT3}, // S_FANG_PINCHLOBSHOT2
{SPR_FANG, 20, 18, {A_LinedefExecute}, LE_BOSS4DROP, 0, S_FANG_PINCHLOBSHOT4}, // S_FANG_PINCHLOBSHOT3
{SPR_FANG, 20, 18, {A_LinedefExecuteFromArg}, 4, 0, S_FANG_PINCHLOBSHOT4}, // S_FANG_PINCHLOBSHOT3
{SPR_FANG, 0, 0, {A_Boss5Calm}, 0, 0, S_FANG_PATHINGSTART1}, // S_FANG_PINCHLOBSHOT4
{SPR_FANG, 21, 0, {A_DoNPCPain}, 0, 0, S_FANG_DIE2}, // S_FANG_DIE1
@ -18929,13 +18929,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
// ambient water 1a (large)
{ // MT_AWATERA
// ambient sound effect
{ // MT_AMBIENT
700, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
1000, // spawnhealth
S_NULL, // seestate
sfx_amwtr1, // seesound
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
@ -18957,283 +18957,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
// ambient water 1b (large)
{ // MT_AWATERB
701, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr2, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 2a (medium)
{ // MT_AWATERC
702, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr3, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 2b (medium)
{ // MT_AWATERD
703, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr4, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 3a (small)
{ // MT_AWATERE
704, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr5, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 3b (small)
{ // MT_AWATERF
705, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr6, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 4a (extra large)
{ // MT_AWATERG
706, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr7, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_SPLASH1, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 4b (extra large)
{ // MT_AWATERH
707, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr8, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_RANDOMAMBIENT
708, // doomednum
S_INVISIBLE, // spawnstate
512, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambint, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
255, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_RANDOMAMBIENT2
709, // doomednum
S_INVISIBLE, // spawnstate
220, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambin2, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
255, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_MACHINEAMBIENCE
710, // doomednum
S_INVISIBLE, // spawnstate
24, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambmac, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
200, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
1*FRACUNIT, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
20, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_CORK
-1, // doomednum
S_CORK, // spawnstate
@ -21586,34 +21309,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
// for use with wind and current effects
{ // MT_PULL
755, // doomednum
S_INVISIBLE, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8, // radius
8, // height
0, // display offset
10, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
{ // MT_GHOST
-1, // doomednum
S_THOK, // spawnstate

View file

@ -134,6 +134,7 @@ enum actionnum
A_BOSS3PATH,
A_BOSS3SHOCKTHINK,
A_LINEDEFEXECUTE,
A_LINEDEFEXECUTEFROMARG,
A_PLAYSEESOUND,
A_PLAYATTACKSOUND,
A_PLAYACTIVESOUND,
@ -396,6 +397,7 @@ void A_Boss3TakeDamage();
void A_Boss3Path();
void A_Boss3ShockThink();
void A_LinedefExecute();
void A_LinedefExecuteFromArg();
void A_PlaySeeSound();
void A_PlayAttackSound();
void A_PlayActiveSound();
@ -6171,17 +6173,7 @@ typedef enum mobj_type
MT_FINISHFLAG, // Finish flag
// Ambient Sounds
MT_AWATERA, // Ambient Water Sound 1
MT_AWATERB, // Ambient Water Sound 2
MT_AWATERC, // Ambient Water Sound 3
MT_AWATERD, // Ambient Water Sound 4
MT_AWATERE, // Ambient Water Sound 5
MT_AWATERF, // Ambient Water Sound 6
MT_AWATERG, // Ambient Water Sound 7
MT_AWATERH, // Ambient Water Sound 8
MT_RANDOMAMBIENT,
MT_RANDOMAMBIENT2,
MT_MACHINEAMBIENCE,
MT_AMBIENT,
MT_CORK,
MT_LHRT,
@ -6285,7 +6277,6 @@ typedef enum mobj_type
MT_CRUMBLEOBJ, // Sound generator for crumbling platform
MT_TUBEWAYPOINT,
MT_PUSH,
MT_PULL,
MT_GHOST,
MT_OVERLAY,
MT_ANGLEMAN,

View file

@ -18,6 +18,7 @@
#include "m_random.h"
#include "r_sky.h" // skyflatnum
#include "k_grandprix.h" // K_CanChangeRules
#include "p_spec.h"
// Battle overtime info
struct battleovertime battleovertime;
@ -716,44 +717,18 @@ void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj)
{
UINT8 sequence = mt->args[0] - 1;
fixed_t speed = (FRACUNIT >> 3) * mt->args[1];
boolean backandforth = (mt->options & MTF_AMBUSH);
boolean reverse = (mt->options & MTF_OBJECTSPECIAL);
mobj_t *mo2;
boolean backandforth = (mt->args[2] & TMBCF_BACKANDFORTH);
boolean reverse = (mt->args[2] & TMBCF_REVERSE);
mobj_t *target = NULL;
thinker_t *th;
// TODO: This and the movement stuff in the thinker should both be using
// 2.2's new optimized functions for doing things with tube waypoints
// Find the inital target
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
if (reverse)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo2 = (mobj_t *)th;
if (mo2->type != MT_TUBEWAYPOINT)
continue;
if (mo2->threshold == sequence)
{
if (reverse) // Use the highest waypoint number as first
{
if (mo2->health != 0)
{
if (target == NULL)
target = mo2;
else if (mo2->health > target->health)
target = mo2;
}
}
else // Use the lowest waypoint number as first
{
if (mo2->health == 0)
target = mo2;
}
}
target = P_GetLastTubeWaypoint(sequence);
}
else
{
target = P_GetFirstTubeWaypoint(sequence);
}
if (!target)

View file

@ -402,7 +402,7 @@ static line_t *K_FindBotController(mobj_t *mo)
{
sector_t *rs = NULL;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
{
continue;
}
@ -510,8 +510,8 @@ fixed_t K_BotRubberband(player_t *player)
if (botController != NULL)
{
// No Climb Flag: Disable rubberbanding
if (botController->flags & ML_NOCLIMB)
// Disable rubberbanding
if (botController->args[1] & TMBOT_NORUBBERBAND)
{
return FRACUNIT;
}
@ -931,7 +931,7 @@ static void K_BotTrick(player_t *player, ticcmd_t *cmd, line_t *botController)
if (player->trickpanel == 1)
{
INT32 type = (sides[botController->sidenum[0]].rowoffset / FRACUNIT);
INT32 type = botController->args[0];
// Y Offset: Trick type
switch (type)
@ -1312,7 +1312,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
return;
}
if (botController != NULL && (botController->flags & ML_EFFECT2))
if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) // FIXME: UDMF-ify
{
// Disable bot controls entirely.
return;
@ -1320,12 +1320,12 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
destangle = player->mo->angle;
if (botController != NULL && (botController->flags & ML_EFFECT1))
if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) // FIXME: UDMF-ify
{
const fixed_t dist = DEFAULT_WAYPOINT_RADIUS * player->mo->scale;
// X Offset: Movement direction
destangle = FixedAngle(sides[botController->sidenum[0]].textureoffset);
destangle = FixedAngle(botController->args[2] * FRACUNIT);
// Overwritten prediction
predict = Z_Calloc(sizeof(botprediction_t), PU_STATIC, NULL);

View file

@ -144,22 +144,14 @@ UINT8 K_EggboxStealth(fixed_t x, fixed_t y)
--------------------------------------------------*/
static boolean K_BotHatesThisSectorsSpecial(player_t *player, sector_t *sec)
{
switch (GETSECSPECIAL(sec->special, 1))
if (sec->damagetype != SD_NONE)
{
case 1: // Damage
case 5: // Spikes
case 6: case 7: // Death Pit
case 8: // Instant Kill
return true;
//case 2: case 3: // Offroad (let's let them lawnmower)
case 4: // Offroad (Strong)
if (!K_BotCanTakeCut(player))
{
return true;
}
break;
default:
break;
return true;
}
if (sec->offroad > FRACUNIT) // Only care about strong offroad.
{
return !K_BotCanTakeCut(player);
}
return false;
@ -177,7 +169,7 @@ boolean K_BotHatesThisSector(player_t *player, sector_t *sec, fixed_t x, fixed_t
sector_t *bestsector = NULL;
ffloor_t *rover;
// TODO: Properly support SF_FLIPSPECIAL_FLOOR / SF_FLIPSPECIAL_CEILING.
// TODO: Properly support MSF_FLIPSPECIAL_FLOOR / MSF_FLIPSPECIAL_CEILING.
// An earlier attempt at it caused lots of false positives and other weird
// quirks with intangible FOFs.
@ -197,7 +189,7 @@ boolean K_BotHatesThisSector(player_t *player, sector_t *sec, fixed_t x, fixed_t
fixed_t top = INT32_MAX;
fixed_t bottom = INT32_MAX;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
{
continue;
}
@ -205,7 +197,7 @@ boolean K_BotHatesThisSector(player_t *player, sector_t *sec, fixed_t x, fixed_t
top = P_GetZAt(*rover->t_slope, x, y, *rover->topheight);
bottom = P_GetZAt(*rover->b_slope, x, y, *rover->bottomheight);
if (!(rover->flags & FF_BLOCKPLAYER))
if (!(rover->fofflags & FOF_BLOCKPLAYER))
{
if ((top >= player->mo->z) && (bottom <= player->mo->z + player->mo->height)
&& K_BotHatesThisSectorsSpecial(player, rover->master->frontsector))

View file

@ -23,10 +23,10 @@ typedef struct brightmapStorage_s
// Stores data for brightmap definitions,
// before putting them into texturebrightmaps.
char textureName[8]; // The texture's name.
char textureName[9]; // The texture's name.
UINT32 textureHash; // The texture name's hash.
char brightmapName[8]; // The brightmap's name.
char brightmapName[9]; // The brightmap's name.
UINT32 brightmapHash; // The brightmap name's hash.
} brightmapStorage_t;

View file

@ -72,7 +72,7 @@ boolean K_IsDuelItem(mobjtype_t type)
boolean K_DuelItemAlwaysSpawns(mapthing_t *mt)
{
return (mt->options & MTF_EXTRA);
return !!(mt->args[0]);
}
static void K_SpawnDuelOnlyItems(void)
@ -1894,10 +1894,9 @@ boolean K_KartSolidBounce(mobj_t *bounceMobj, mobj_t *solidMobj)
\return boolean
*/
static UINT8 K_CheckOffroadCollide(mobj_t *mo)
static fixed_t K_CheckOffroadCollide(mobj_t *mo)
{
// Check for sectors in touching_sectorlist
UINT8 i; // special type iter
msecnode_t *node; // touching_sectorlist iter
sector_t *s; // main sector shortcut
sector_t *s2; // FOF sector shortcut
@ -1926,18 +1925,16 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo)
cel = P_MobjCeilingZ(mo, s, s, mo->x, mo->y, NULL, true, true); // get Z coords of both floors and ceilings for this sector (this accounts for slopes properly.)
// NOTE: we don't use P_GetZAt with our x/y directly because the mobj won't have the same height because of its hitbox on the slope. Complex garbage but tldr it doesn't work.
if ( ((s->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == flr) // floor check
|| ((mo->eflags & MFE_VERTICALFLIP && (s->flags & SF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == cel)) ) // ceiling check.
for (i = 2; i < 5; i++) // check for sector special
if (GETSECSPECIAL(s->special, 1) == i)
return i-1; // return offroad type
if ( ((s->flags & MSF_FLIPSPECIAL_FLOOR) && mo->z == flr) // floor check
|| ((mo->eflags & MFE_VERTICALFLIP && (s->flags & MSF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == cel)) ) // ceiling check.
{
return s->offroad;
}
// 2: If we're here, we haven't found anything. So let's try looking for FOFs in the sectors using the same logic.
for (rover = s->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)) // This FOF doesn't exist anymore.
if (!(rover->fofflags & FOF_EXISTS)) // This FOF doesn't exist anymore.
continue;
s2 = &sectors[rover->secnum]; // makes things easier for us
@ -1947,18 +1944,15 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo)
// we will do essentially the same checks as above instead of bothering with top/bottom height of the FOF.
// Reminder that an FOF's floor is its bottom, silly!
if ( ((s2->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == cel) // "floor" check
|| ((s2->flags & SF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == flr) ) // "ceiling" check.
for (i = 2; i < 5; i++) // check for sector special
if (GETSECSPECIAL(s2->special, 1) == i)
return i-1; // return offroad type
if ( ((s2->flags & MSF_FLIPSPECIAL_FLOOR) && mo->z == cel) // "floor" check
|| ((s2->flags & MSF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == flr) ) // "ceiling" check.
{
return s2->offroad;
}
}
}
return 0; // couldn't find any offroad
return 0; // couldn't find any offroad
}
/** \brief Updates the Player's offroad value once per frame
@ -1972,13 +1966,14 @@ static void K_UpdateOffroad(player_t *player)
terrain_t *terrain = player->mo->terrain;
fixed_t offroadstrength = 0;
// TODO: Make this use actual special touch code.
if (terrain != NULL && terrain->offroad > 0)
{
offroadstrength = (terrain->offroad << FRACBITS);
}
else
{
offroadstrength = (K_CheckOffroadCollide(player->mo) << FRACBITS);
offroadstrength = K_CheckOffroadCollide(player->mo);
}
// If you are in offroad, a timer starts.
@ -7191,13 +7186,13 @@ void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed
fixed_t top, bottom;
fixed_t d1, d2;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if ((!(((rover->flags & FF_BLOCKPLAYER && player)
|| (rover->flags & FF_BLOCKOTHERS && !player))
|| (rover->flags & FF_QUICKSAND))
|| (rover->flags & FF_SWIMMABLE)))
if ((!(((rover->fofflags & FOF_BLOCKPLAYER && player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !player))
|| (rover->fofflags & FOF_QUICKSAND))
|| (rover->fofflags & FOF_SWIMMABLE)))
continue;
top = K_BananaSlopeZ(*rover->t_slope, x, y, *rover->topheight, radius, false);
@ -7205,7 +7200,7 @@ void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed
if (flip)
{
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (z < top && (z + height) > bottom)
{
@ -7229,7 +7224,7 @@ void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed
}
else
{
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (z < top && (z + height) > bottom)
{

View file

@ -112,6 +112,8 @@ static void K_CreateFinishLineFromPoints(fixed_t x1, fixed_t y1, fixed_t x2, fix
finishBeamLine->dx = x2 - x1;
finishBeamLine->dy = y2 - y1;
finishBeamLine->angle = R_PointToAngle2(0, 0, finishBeamLine->dx, finishBeamLine->dy);
finishBeamLine->flags = 0;
}
@ -241,7 +243,7 @@ static void K_DrawFinishLineBeamForLine(fixed_t offset, angle_t aiming, line_t *
fixed_t linex = line->v1->x;
fixed_t liney = line->v1->y;
angle_t lineangle = R_PointToAngle2(0, 0, line->dx, line->dy) + ANGLE_90;
angle_t lineangle = line->angle + ANGLE_90;
UINT8 i;

View file

@ -496,6 +496,64 @@ void K_ProcessTerrainEffect(mobj_t *mo)
P_InstaThrust(mo, mo->angle, speed);
}
// Speed pad
if (terrain->speedPad > 0)
{
if (player->floorboost != 0)
{
player->floorboost = 2;
}
else
{
fixed_t thrustSpeed = terrain->speedPad;
angle_t thrustAngle = terrain->speedPadAngle;
fixed_t playerSpeed = P_AproxDistance(player->mo->momx, player->mo->momy);
// FIXME: come up with a better way to get the touched
// texture's rotation to this function. At least this
// will work for 90% of scenarios...
if (player->mo->eflags & MFE_VERTICALFLIP)
{
if (player->mo->ceilingrover != NULL)
{
thrustAngle -= *player->mo->ceilingrover->bottomangle;
}
else
{
thrustAngle -= player->mo->subsector->sector->ceilingpic_angle;
}
}
else
{
if (player->mo->floorrover != NULL)
{
thrustAngle -= *player->mo->floorrover->topangle;
}
else
{
thrustAngle -= player->mo->subsector->sector->floorpic_angle;
}
}
// Map scale for Shrink, object scale for Grow.
thrustSpeed = FixedMul(thrustSpeed, max(mapobjectscale, player->mo->scale));
thrustAngle = K_ReflectAngle(
K_MomentumAngle(player->mo), thrustAngle,
playerSpeed, thrustSpeed
);
P_InstaThrust(player->mo, thrustAngle, max(thrustSpeed, 2*playerSpeed));
player->dashpadcooldown = TICRATE/3;
player->trickpanel = 0;
player->floorboost = 2;
S_StartSound(player->mo, sfx_cdfm62);
}
}
// Bumpy floor
if (terrain->flags & TRF_STAIRJANK)
{
@ -1426,6 +1484,8 @@ static void K_TerrainDefaults(terrain_t *terrain)
terrain->offroad = 0;
terrain->damageType = -1;
terrain->trickPanel = 0;
terrain->speedPad = 0;
terrain->speedPadAngle = 0;
terrain->flags = 0;
}
@ -1496,6 +1556,14 @@ static void K_ParseTerrainParameter(size_t i, char *param, char *val)
{
terrain->trickPanel = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "speedPad") == 0)
{
terrain->speedPad = FLOAT_TO_FIXED(atof(val));
}
else if (stricmp(param, "speedPadAngle") == 0)
{
terrain->speedPadAngle = FixedAngle(FLOAT_TO_FIXED(atof(val)));
}
else if (stricmp(param, "floorClip") == 0)
{
terrain->floorClip = FLOAT_TO_FIXED(atof(val));

View file

@ -27,7 +27,7 @@ typedef struct t_splash_s
// Splash definition.
// These are particles spawned when hitting the floor.
char name[TERRAIN_NAME_LEN]; // Lookup name.
char name[TERRAIN_NAME_LEN+1]; // Lookup name.
UINT32 hash; // Lookup name's hash.
UINT16 mobjType; // Thing type. MT_NULL to not spawn anything.
@ -48,7 +48,7 @@ typedef struct t_footstep_s
// Footstep definition.
// These are particles spawned when moving fast enough on a floor.
char name[TERRAIN_NAME_LEN]; // Lookup name.
char name[TERRAIN_NAME_LEN+1]; // Lookup name.
UINT32 hash; // Lookup name's hash.
UINT16 mobjType; // Thing type. MT_NULL to not spawn anything.
@ -80,7 +80,7 @@ typedef struct t_overlay_s
// Overlay definition.
// These are sprites displayed on top of the base object.
char name[TERRAIN_NAME_LEN]; // Lookup name.
char name[TERRAIN_NAME_LEN+1]; // Lookup name.
UINT32 hash; // Lookup name's hash.
UINT16 states[TOV__MAX]; // State to use when the object is still.
@ -103,7 +103,7 @@ typedef struct terrain_s
// Terrain definition.
// These are all of the properties that the floor gets.
char name[TERRAIN_NAME_LEN]; // Lookup name.
char name[TERRAIN_NAME_LEN+1]; // Lookup name.
UINT32 hash; // Lookup name's hash.
size_t splashID; // Splash defintion ID.
@ -111,9 +111,11 @@ typedef struct terrain_s
size_t overlayID; // Overlay defintion ID.
fixed_t friction; // The default friction of this texture.
UINT8 offroad; // The default offroad level of this texture.
fixed_t offroad; // The default offroad level of this texture.
INT16 damageType; // The default damage type of this texture. (Negative means no damage).
UINT8 trickPanel; // Trick panel strength
fixed_t trickPanel; // Trick panel strength
fixed_t speedPad; // Speed pad strength
angle_t speedPadAngle; // Speed pad angle
fixed_t floorClip; // Offset for sprites on this ground
UINT32 flags; // Flag values (see: terrain_flags_t)
} terrain_t;
@ -123,7 +125,7 @@ typedef struct t_floor_s
// Terrain floor definition.
// Ties a texture name to a terrain definition.
char textureName[8]; // Floor texture name.
char textureName[9]; // Floor texture name.
UINT32 textureHash; // Floor texture hash.
size_t terrainID; // Terrain definition ID.
} t_floor_t;

View file

@ -2238,6 +2238,7 @@ static boolean K_RaiseWaypoint(
fixed_t sort;
fixed_t z;
fixed_t delta;
if (
!( riser->spawnpoint->options & MTF_OBJECTSPECIAL ) ||
@ -2282,6 +2283,13 @@ static boolean K_RaiseWaypoint(
}
}
// Keep changes for -writetextmap
if (descending)
delta = sort - waypointmobj->z;
else
delta = waypointmobj->z - sort;
waypointmobj->spawnpoint->z += delta;
waypointmobj->z = sort;
}
@ -2316,6 +2324,8 @@ static boolean K_AnchorWaypointRadius(
waypointmobj->x, waypointmobj->y,
anchor->x, anchor->y);
// Keep changes for -writetextmap
waypointmobj->spawnpoint->args[0] = waypointmobj->radius >> FRACBITS;
return true;
}
else

View file

@ -1817,15 +1817,51 @@ static int lib_pExplodeMissile(lua_State *L)
static int lib_pMobjTouchingSectorSpecial(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
mobj_t *mo = *((mobj_t**)luaL_checkudata(L, 1, META_MOBJ));
INT32 section = (INT32)luaL_checkinteger(L, 2);
INT32 number = (INT32)luaL_checkinteger(L, 3);
boolean touchground = lua_optboolean(L, 4);
//HUDSAFE
INLEVEL
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
LUA_PushUserdata(L, P_MobjTouchingSectorSpecial(mo, section, number, touchground), META_SECTOR);
LUA_PushUserdata(L, P_MobjTouchingSectorSpecial(mo, section, number), META_SECTOR);
return 1;
}
static int lib_pMobjTouchingSectorSpecialFlag(lua_State *L)
{
mobj_t *mo = *((mobj_t**)luaL_checkudata(L, 1, META_MOBJ));
sectorspecialflags_t flag = (INT32)luaL_checkinteger(L, 2);
//HUDSAFE
INLEVEL
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
LUA_PushUserdata(L, P_MobjTouchingSectorSpecialFlag(mo, flag), META_SECTOR);
return 1;
}
static int lib_pPlayerTouchingSectorSpecial(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
INT32 section = (INT32)luaL_checkinteger(L, 2);
INT32 number = (INT32)luaL_checkinteger(L, 3);
//HUDSAFE
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
LUA_PushUserdata(L, P_PlayerTouchingSectorSpecial(player, section, number), META_SECTOR);
return 1;
}
static int lib_pPlayerTouchingSectorSpecialFlag(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
sectorspecialflags_t flag = (INT32)luaL_checkinteger(L, 2);
//HUDSAFE
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
LUA_PushUserdata(L, P_PlayerTouchingSectorSpecialFlag(player, flag), META_SECTOR);
return 1;
}
@ -1960,34 +1996,13 @@ static int lib_pFadeLight(lua_State *L)
INT32 speed = (INT32)luaL_checkinteger(L, 3);
boolean ticbased = lua_optboolean(L, 4);
boolean force = lua_optboolean(L, 5);
boolean relative = lua_optboolean(L, 6);
NOHUD
INLEVEL
P_FadeLight(tag, destvalue, speed, ticbased, force);
P_FadeLight(tag, destvalue, speed, ticbased, force, relative);
return 0;
}
static int lib_pThingOnSpecial3DFloor(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
INLEVEL
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
LUA_PushUserdata(L, P_ThingOnSpecial3DFloor(mo), META_SECTOR);
return 1;
}
static int lib_pIsFlagAtBase(lua_State *L)
{
mobjtype_t flag = luaL_checkinteger(L, 1);
NOHUD
INLEVEL
if (flag >= NUMMOBJTYPES)
return luaL_error(L, "mobj type %d out of range (0 - %d)", flag, NUMMOBJTYPES-1);
lua_pushboolean(L, P_IsFlagAtBase(flag));
return 1;
}
static int lib_pSetupLevelSky(lua_State *L)
{
const char *skytexname = luaL_checkstring(L, 1);
@ -3992,6 +4007,9 @@ static luaL_Reg lib[] = {
{"P_SetMobjStateNF",lib_pSetMobjStateNF},
{"P_ExplodeMissile",lib_pExplodeMissile},
{"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial},
{"P_MobjTouchingSectorSpecialFlag",lib_pMobjTouchingSectorSpecialFlag},
{"P_PlayerTouchingSectorSpecial",lib_pPlayerTouchingSectorSpecial},
{"P_PlayerTouchingSectorSpecialFlag",lib_pPlayerTouchingSectorSpecialFlag},
{"P_FindLowestFloorSurrounding",lib_pFindLowestFloorSurrounding},
{"P_FindHighestFloorSurrounding",lib_pFindHighestFloorSurrounding},
{"P_FindNextHighestFloor",lib_pFindNextHighestFloor},
@ -4003,8 +4021,6 @@ static luaL_Reg lib[] = {
{"P_LinedefExecute",lib_pLinedefExecute},
{"P_SpawnLightningFlash",lib_pSpawnLightningFlash},
{"P_FadeLight",lib_pFadeLight},
{"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor},
{"P_IsFlagAtBase",lib_pIsFlagAtBase},
{"P_SetupLevelSky",lib_pSetupLevelSky},
{"P_SetSkyboxMobj",lib_pSetSkyboxMobj},
{"P_StartQuake",lib_pStartQuake},

View file

@ -35,6 +35,10 @@ enum sector_e {
sector_floorpic,
sector_ceilingpic,
sector_lightlevel,
sector_floorlightlevel,
sector_floorlightabsolute,
sector_ceilinglightlevel,
sector_ceilinglightabsolute,
sector_special,
sector_tag,
sector_taglist,
@ -44,7 +48,14 @@ enum sector_e {
sector_lines,
sector_ffloors,
sector_fslope,
sector_cslope
sector_cslope,
sector_flags,
sector_specialflags,
sector_damagetype,
sector_triggertag,
sector_triggerer,
sector_friction,
sector_gravity,
};
static const char *const sector_opt[] = {
@ -54,6 +65,10 @@ static const char *const sector_opt[] = {
"floorpic",
"ceilingpic",
"lightlevel",
"floorlightlevel",
"floorlightabsolute",
"ceilinglightlevel",
"ceilinglightabsolute",
"special",
"tag",
"taglist",
@ -64,6 +79,13 @@ static const char *const sector_opt[] = {
"ffloors",
"f_slope",
"c_slope",
"flags",
"specialflags",
"damagetype",
"triggertag",
"triggerer",
"friction",
"gravity",
NULL};
enum subsector_e {
@ -88,6 +110,7 @@ enum line_e {
line_v2,
line_dx,
line_dy,
line_angle,
line_flags,
line_special,
line_tag,
@ -113,6 +136,7 @@ static const char *const line_opt[] = {
"v2",
"dx",
"dy",
"angle",
"flags",
"special",
"tag",
@ -190,6 +214,7 @@ enum ffloor_e {
ffloor_tslope,
ffloor_bslope,
ffloor_sector,
ffloor_fofflags,
ffloor_flags,
ffloor_master,
ffloor_target,
@ -197,6 +222,12 @@ enum ffloor_e {
ffloor_prev,
ffloor_alpha,
ffloor_blend,
ffloor_bustflags,
ffloor_busttype,
ffloor_busttag,
ffloor_sinkspeed,
ffloor_friction,
ffloor_bouncestrength,
};
static const char *const ffloor_opt[] = {
@ -209,6 +240,7 @@ static const char *const ffloor_opt[] = {
"t_slope",
"b_slope",
"sector", // secnum pushed as control sector userdata
"fofflags",
"flags",
"master", // control linedef
"target", // target sector
@ -216,6 +248,12 @@ static const char *const ffloor_opt[] = {
"prev",
"alpha",
"blend",
"bustflags",
"busttype",
"busttag",
"sinkspeed",
"friction",
"bouncestrength",
NULL};
#ifdef HAVE_LUA_SEGS
@ -581,6 +619,18 @@ static int sector_get(lua_State *L)
case sector_lightlevel:
lua_pushinteger(L, sector->lightlevel);
return 1;
case sector_floorlightlevel:
lua_pushinteger(L, sector->floorlightlevel);
return 1;
case sector_floorlightabsolute:
lua_pushboolean(L, sector->floorlightabsolute);
return 1;
case sector_ceilinglightlevel:
lua_pushinteger(L, sector->ceilinglightlevel);
return 1;
case sector_ceilinglightabsolute:
lua_pushboolean(L, sector->ceilinglightabsolute);
return 1;
case sector_special:
lua_pushinteger(L, sector->special);
return 1;
@ -619,6 +669,27 @@ static int sector_get(lua_State *L)
case sector_cslope: // c_slope
LUA_PushUserdata(L, sector->c_slope, META_SLOPE);
return 1;
case sector_flags: // flags
lua_pushinteger(L, sector->flags);
return 1;
case sector_specialflags: // specialflags
lua_pushinteger(L, sector->specialflags);
return 1;
case sector_damagetype: // damagetype
lua_pushinteger(L, (UINT8)sector->damagetype);
return 1;
case sector_triggertag: // triggertag
lua_pushinteger(L, (INT16)sector->triggertag);
return 1;
case sector_triggerer: // triggerer
lua_pushinteger(L, (UINT8)sector->triggerer);
return 1;
case sector_friction: // friction
lua_pushfixed(L, sector->friction);
return 1;
case sector_gravity: // gravity
lua_pushfixed(L, sector->gravity);
return 1;
}
return 0;
}
@ -646,6 +717,7 @@ static int sector_set(lua_State *L)
case sector_ffloors: // ffloors
case sector_fslope: // f_slope
case sector_cslope: // c_slope
case sector_friction: // friction
default:
return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
case sector_floorheight: { // floorheight
@ -685,6 +757,18 @@ static int sector_set(lua_State *L)
case sector_lightlevel:
sector->lightlevel = (INT16)luaL_checkinteger(L, 3);
break;
case sector_floorlightlevel:
sector->floorlightlevel = (INT16)luaL_checkinteger(L, 3);
break;
case sector_floorlightabsolute:
sector->floorlightabsolute = luaL_checkboolean(L, 3);
break;
case sector_ceilinglightlevel:
sector->ceilinglightlevel = (INT16)luaL_checkinteger(L, 3);
break;
case sector_ceilinglightabsolute:
sector->ceilinglightabsolute = luaL_checkboolean(L, 3);
break;
case sector_special:
sector->special = (INT16)luaL_checkinteger(L, 3);
break;
@ -693,6 +777,25 @@ static int sector_set(lua_State *L)
break;
case sector_taglist:
return LUA_ErrSetDirectly(L, "sector_t", "taglist");
case sector_flags:
sector->flags = luaL_checkinteger(L, 3);
CheckForReverseGravity |= (sector->flags & MSF_GRAVITYFLIP);
break;
case sector_specialflags:
sector->specialflags = luaL_checkinteger(L, 3);
break;
case sector_damagetype:
sector->damagetype = (UINT8)luaL_checkinteger(L, 3);
break;
case sector_triggertag:
sector->triggertag = (INT16)luaL_checkinteger(L, 3);
break;
case sector_triggerer:
sector->triggerer = (UINT8)luaL_checkinteger(L, 3);
break;
case sector_gravity:
sector->gravity = luaL_checkfixed(L, 3);
break;
}
return 0;
}
@ -823,6 +926,9 @@ static int line_get(lua_State *L)
case line_dy:
lua_pushfixed(L, line->dy);
return 1;
case line_angle:
lua_pushangle(L, line->angle);
return 1;
case line_flags:
lua_pushinteger(L, line->flags);
return 1;
@ -1737,6 +1843,80 @@ static int lib_numnodes(lua_State *L)
// ffloor_t //
//////////////
static INT32 P_GetOldFOFFlags(ffloor_t *fflr)
{
INT32 result = 0;
if (fflr->fofflags & FOF_EXISTS)
result |= FF_OLD_EXISTS;
if (fflr->fofflags & FOF_BLOCKPLAYER)
result |= FF_OLD_BLOCKPLAYER;
if (fflr->fofflags & FOF_BLOCKOTHERS)
result |= FF_OLD_BLOCKOTHERS;
if (fflr->fofflags & FOF_RENDERSIDES)
result |= FF_OLD_RENDERSIDES;
if (fflr->fofflags & FOF_RENDERPLANES)
result |= FF_OLD_RENDERPLANES;
if (fflr->fofflags & FOF_SWIMMABLE)
result |= FF_OLD_SWIMMABLE;
if (fflr->fofflags & FOF_NOSHADE)
result |= FF_OLD_NOSHADE;
if (fflr->fofflags & FOF_CUTSOLIDS)
result |= FF_OLD_CUTSOLIDS;
if (fflr->fofflags & FOF_CUTEXTRA)
result |= FF_OLD_CUTEXTRA;
if (fflr->fofflags & FOF_CUTSPRITES)
result |= FF_OLD_CUTSPRITES;
if (fflr->fofflags & FOF_BOTHPLANES)
result |= FF_OLD_BOTHPLANES;
if (fflr->fofflags & FOF_EXTRA)
result |= FF_OLD_EXTRA;
if (fflr->fofflags & FOF_TRANSLUCENT)
result |= FF_OLD_TRANSLUCENT;
if (fflr->fofflags & FOF_FOG)
result |= FF_OLD_FOG;
if (fflr->fofflags & FOF_INVERTPLANES)
result |= FF_OLD_INVERTPLANES;
if (fflr->fofflags & FOF_ALLSIDES)
result |= FF_OLD_ALLSIDES;
if (fflr->fofflags & FOF_INVERTSIDES)
result |= FF_OLD_INVERTSIDES;
if (fflr->fofflags & FOF_DOUBLESHADOW)
result |= FF_OLD_DOUBLESHADOW;
if (fflr->fofflags & FOF_FLOATBOB)
result |= FF_OLD_FLOATBOB;
if (fflr->fofflags & FOF_NORETURN)
result |= FF_OLD_NORETURN;
if (fflr->fofflags & FOF_CRUMBLE)
result |= FF_OLD_CRUMBLE;
if (fflr->bustflags & FB_ONLYBOTTOM)
result |= FF_OLD_SHATTERBOTTOM;
if (fflr->fofflags & FOF_GOOWATER)
result |= FF_OLD_GOOWATER;
if (fflr->fofflags & FOF_MARIO)
result |= FF_OLD_MARIO;
if (fflr->fofflags & FOF_BUSTUP)
result |= FF_OLD_BUSTUP;
if (fflr->fofflags & FOF_QUICKSAND)
result |= FF_OLD_QUICKSAND;
if (fflr->fofflags & FOF_PLATFORM)
result |= FF_OLD_PLATFORM;
if (fflr->fofflags & FOF_REVERSEPLATFORM)
result |= FF_OLD_REVERSEPLATFORM;
if (fflr->fofflags & FOF_INTANGIBLEFLATS)
result |= FF_OLD_INTANGIBLEFLATS;
if (fflr->busttype == BT_TOUCH)
result |= FF_OLD_SHATTER;
if (fflr->busttype == BT_SPINBUST)
result |= FF_OLD_SPINBUST;
if (fflr->busttype == BT_STRONG)
result |= FF_OLD_STRONGBUST;
if (fflr->fofflags & FF_OLD_RIPPLE)
result |= FOF_RIPPLE;
if (fflr->fofflags & FF_OLD_COLORMAPONLY)
result |= FOF_COLORMAPONLY;
return result;
}
static int ffloor_get(lua_State *L)
{
ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
@ -1791,8 +1971,11 @@ static int ffloor_get(lua_State *L)
case ffloor_sector:
LUA_PushUserdata(L, &sectors[ffloor->secnum], META_SECTOR);
return 1;
case ffloor_fofflags:
lua_pushinteger(L, ffloor->fofflags);
return 1;
case ffloor_flags:
lua_pushinteger(L, ffloor->flags);
lua_pushinteger(L, P_GetOldFOFFlags(ffloor));
return 1;
case ffloor_master:
LUA_PushUserdata(L, ffloor->master, META_LINE);
@ -1812,10 +1995,110 @@ static int ffloor_get(lua_State *L)
case ffloor_blend:
lua_pushinteger(L, ffloor->blend);
return 1;
case ffloor_bustflags:
lua_pushinteger(L, ffloor->bustflags);
return 1;
case ffloor_busttype:
lua_pushinteger(L, ffloor->busttype);
return 1;
case ffloor_busttag:
lua_pushinteger(L, ffloor->busttag);
return 1;
case ffloor_sinkspeed:
lua_pushfixed(L, ffloor->sinkspeed);
return 1;
case ffloor_friction:
lua_pushfixed(L, ffloor->friction);
return 1;
case ffloor_bouncestrength:
lua_pushfixed(L, ffloor->bouncestrength);
return 1;
}
return 0;
}
static void P_SetOldFOFFlags(ffloor_t *fflr, oldffloortype_e oldflags)
{
ffloortype_e originalflags = fflr->fofflags;
fflr->fofflags = 0;
if (oldflags & FF_OLD_EXISTS)
fflr->fofflags |= FOF_EXISTS;
if (oldflags & FF_OLD_BLOCKPLAYER)
fflr->fofflags |= FOF_BLOCKPLAYER;
if (oldflags & FF_OLD_BLOCKOTHERS)
fflr->fofflags |= FOF_BLOCKOTHERS;
if (oldflags & FF_OLD_RENDERSIDES)
fflr->fofflags |= FOF_RENDERSIDES;
if (oldflags & FF_OLD_RENDERPLANES)
fflr->fofflags |= FOF_RENDERPLANES;
if (oldflags & FF_OLD_SWIMMABLE)
fflr->fofflags |= FOF_SWIMMABLE;
if (oldflags & FF_OLD_NOSHADE)
fflr->fofflags |= FOF_NOSHADE;
if (oldflags & FF_OLD_CUTSOLIDS)
fflr->fofflags |= FOF_CUTSOLIDS;
if (oldflags & FF_OLD_CUTEXTRA)
fflr->fofflags |= FOF_CUTEXTRA;
if (oldflags & FF_OLD_CUTSPRITES)
fflr->fofflags |= FOF_CUTSPRITES;
if (oldflags & FF_OLD_BOTHPLANES)
fflr->fofflags |= FOF_BOTHPLANES;
if (oldflags & FF_OLD_EXTRA)
fflr->fofflags |= FOF_EXTRA;
if (oldflags & FF_OLD_TRANSLUCENT)
fflr->fofflags |= FOF_TRANSLUCENT;
if (oldflags & FF_OLD_FOG)
fflr->fofflags |= FOF_FOG;
if (oldflags & FF_OLD_INVERTPLANES)
fflr->fofflags |= FOF_INVERTPLANES;
if (oldflags & FF_OLD_ALLSIDES)
fflr->fofflags |= FOF_ALLSIDES;
if (oldflags & FF_OLD_INVERTSIDES)
fflr->fofflags |= FOF_INVERTSIDES;
if (oldflags & FF_OLD_DOUBLESHADOW)
fflr->fofflags |= FOF_DOUBLESHADOW;
if (oldflags & FF_OLD_FLOATBOB)
fflr->fofflags |= FOF_FLOATBOB;
if (oldflags & FF_OLD_NORETURN)
fflr->fofflags |= FOF_NORETURN;
if (oldflags & FF_OLD_CRUMBLE)
fflr->fofflags |= FOF_CRUMBLE;
if (oldflags & FF_OLD_GOOWATER)
fflr->fofflags |= FOF_GOOWATER;
if (oldflags & FF_OLD_MARIO)
fflr->fofflags |= FOF_MARIO;
if (oldflags & FF_OLD_BUSTUP)
fflr->fofflags |= FOF_BUSTUP;
if (oldflags & FF_OLD_QUICKSAND)
fflr->fofflags |= FOF_QUICKSAND;
if (oldflags & FF_OLD_PLATFORM)
fflr->fofflags |= FOF_PLATFORM;
if (oldflags & FF_OLD_REVERSEPLATFORM)
fflr->fofflags |= FOF_REVERSEPLATFORM;
if (oldflags & FF_OLD_RIPPLE)
fflr->fofflags |= FOF_RIPPLE;
if (oldflags & FF_OLD_COLORMAPONLY)
fflr->fofflags |= FOF_COLORMAPONLY;
if (originalflags & FOF_BOUNCY)
fflr->fofflags |= FOF_BOUNCY;
if (originalflags & FOF_SPLAT)
fflr->fofflags |= FOF_SPLAT;
if (oldflags & FF_OLD_SHATTER)
fflr->busttype = BT_TOUCH;
else if (oldflags & FF_OLD_SPINBUST)
fflr->busttype = BT_SPINBUST;
else if (oldflags & FF_OLD_STRONGBUST)
fflr->busttype = BT_STRONG;
else
fflr->busttype = BT_REGULAR;
if (oldflags & FF_OLD_SHATTERBOTTOM)
fflr->bustflags |= FB_ONLYBOTTOM;
else
fflr->bustflags &= ~FB_ONLYBOTTOM;
}
static int ffloor_set(lua_State *L)
{
ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
@ -1880,10 +2163,20 @@ static int ffloor_set(lua_State *L)
case ffloor_bottompic:
*ffloor->bottompic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3));
break;
case ffloor_fofflags: {
ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags
ffloor->fofflags = luaL_checkinteger(L, 3);
if (ffloor->fofflags != oldflags)
ffloor->target->moved = true; // reset target sector's lightlist
break;
}
case ffloor_flags: {
ffloortype_e oldflags = ffloor->flags; // store FOF's old flags
ffloor->flags = luaL_checkinteger(L, 3);
if (ffloor->flags != oldflags)
ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags
busttype_e oldbusttype = ffloor->busttype;
ffloorbustflags_e oldbustflags = ffloor->bustflags;
oldffloortype_e newflags = luaL_checkinteger(L, 3);
P_SetOldFOFFlags(ffloor, newflags);
if (ffloor->fofflags != oldflags || ffloor->busttype != oldbusttype || ffloor->bustflags != oldbustflags)
ffloor->target->moved = true; // reset target sector's lightlist
break;
}

View file

@ -244,13 +244,14 @@ static int lib_polyobj_rotate(lua_State *L)
{
polyobj_t *po = *((polyobj_t **)luaL_checkudata(L, 1, META_POLYOBJ));
angle_t delta = luaL_checkangle(L, 2);
UINT8 turnthings = (UINT8)luaL_optinteger(L, 3, 0); // don't turn anything by default? (could change this if not desired)
boolean checkmobjs = lua_opttrueboolean(L, 4);
boolean turnplayers = lua_opttrueboolean(L, 3);
boolean turnothers = lua_opttrueboolean(L, 4);
boolean checkmobjs = lua_opttrueboolean(L, 5);
NOHUD
INLEVEL
if (!po)
return LUA_ErrInvalid(L, "polyobj_t");
lua_pushboolean(L, Polyobj_rotate(po, delta, turnthings, checkmobjs));
lua_pushboolean(L, Polyobj_rotate(po, delta, turnplayers, turnothers, checkmobjs));
return 1;
}

View file

@ -382,7 +382,7 @@ void Command_Teleport_f(void)
// Flagging a player's ambush will make them start on the ceiling
// Objectflip inverts
if (!!(mt->options & MTF_AMBUSH) ^ !!(mt->options & MTF_OBJECTFLIP))
if (!!(mt->args[0]) ^ !!(mt->options & MTF_OBJECTFLIP))
intz = ss->sector->ceilingheight - p->mo->height - offset;
else
intz = ss->sector->floorheight + offset;
@ -807,7 +807,7 @@ static void OP_CycleThings(INT32 amt)
} while
(mobjinfo[op_currentthing].doomednum == -1
|| op_currentthing == MT_NIGHTSDRONE
|| mobjinfo[op_currentthing].flags & (MF_AMBIENT|MF_NOSECTOR)
|| mobjinfo[op_currentthing].flags & MF_NOSECTOR
|| (states[mobjinfo[op_currentthing].spawnstate].sprite == SPR_NULL
&& states[mobjinfo[op_currentthing].seestate].sprite == SPR_NULL)
);
@ -1050,9 +1050,9 @@ void OP_ObjectplaceMovement(player_t *player)
return;
mt = OP_CreateNewMapThing(player, (UINT16)spawnthing, ceiling);
if (mt->type >= 600 && mt->type <= 609) // Placement patterns
if (mt->type >= 600 && mt->type <= 611) // Placement patterns
P_SpawnItemPattern(mt);
else if (mt->type == 1705 || mt->type == 1713) // NiGHTS Hoops
else if (mt->type == 1713) // NiGHTS Hoops
P_SpawnHoop(mt);
else
P_SpawnMapThing(mt);
@ -1064,13 +1064,13 @@ void OP_ObjectplaceMovement(player_t *player)
//
// Objectplace related commands.
//
void Command_Writethings_f(void)
/*void Command_Writethings_f(void)
{
REQUIRE_INLEVEL;
REQUIRE_OBJECTPLACE;
P_WriteThings();
}
}*/
void Command_ObjectPlace_f(void)
{

View file

@ -45,7 +45,7 @@ void cht_Init(void);
// ObjectPlace
//
void Command_ObjectPlace_f(void);
void Command_Writethings_f(void);
//void Command_Writethings_f(void);
extern consvar_t cv_opflags, cv_ophoopflags, cv_mapthingnum, cv_speed;
//extern consvar_t cv_snapto, cv_grid;

View file

@ -2081,11 +2081,168 @@ UINT32 M_GetTokenPos(void)
return endPos;
}
/** Sets the current token's position.
*/
void M_SetTokenPos(UINT32 newPos)
#define NUMTOKENS 2
static const char *tokenizerInput = NULL;
static UINT32 tokenCapacity[NUMTOKENS] = {0};
static char *tokenizerToken[NUMTOKENS] = {NULL};
static UINT32 tokenizerStartPos = 0;
static UINT32 tokenizerEndPos = 0;
static UINT32 tokenizerInputLength = 0;
static UINT8 tokenizerInComment = 0; // 0 = not in comment, 1 = // Single-line, 2 = /* Multi-line */
void M_TokenizerOpen(const char *inputString)
{
endPos = newPos;
size_t i;
tokenizerInput = inputString;
for (i = 0; i < NUMTOKENS; i++)
{
tokenCapacity[i] = 1024;
tokenizerToken[i] = (char*)Z_Malloc(tokenCapacity[i] * sizeof(char), PU_STATIC, NULL);
}
tokenizerInputLength = strlen(tokenizerInput);
}
void M_TokenizerClose(void)
{
size_t i;
tokenizerInput = NULL;
for (i = 0; i < NUMTOKENS; i++)
Z_Free(tokenizerToken[i]);
tokenizerStartPos = 0;
tokenizerEndPos = 0;
tokenizerInComment = 0;
}
static void M_DetectComment(UINT32 *pos)
{
if (tokenizerInComment)
return;
if (*pos >= tokenizerInputLength - 1)
return;
if (tokenizerInput[*pos] != '/')
return;
//Single-line comment start
if (tokenizerInput[*pos + 1] == '/')
tokenizerInComment = 1;
//Multi-line comment start
else if (tokenizerInput[*pos + 1] == '*')
tokenizerInComment = 2;
}
static void M_ReadTokenString(UINT32 i)
{
UINT32 tokenLength = tokenizerEndPos - tokenizerStartPos;
if (tokenLength + 1 > tokenCapacity[i])
{
tokenCapacity[i] = tokenLength + 1;
// Assign the memory. Don't forget an extra byte for the end of the string!
tokenizerToken[i] = (char *)Z_Malloc(tokenCapacity[i] * sizeof(char), PU_STATIC, NULL);
}
// Copy the string.
M_Memcpy(tokenizerToken[i], tokenizerInput + tokenizerStartPos, (size_t)tokenLength);
// Make the final character NUL.
tokenizerToken[i][tokenLength] = '\0';
}
const char *M_TokenizerRead(UINT32 i)
{
if (!tokenizerInput)
return NULL;
tokenizerStartPos = tokenizerEndPos;
// Try to detect comments now, in case we're pointing right at one
M_DetectComment(&tokenizerStartPos);
// Find the first non-whitespace char, or else the end of the string trying
while ((tokenizerInput[tokenizerStartPos] == ' '
|| tokenizerInput[tokenizerStartPos] == '\t'
|| tokenizerInput[tokenizerStartPos] == '\r'
|| tokenizerInput[tokenizerStartPos] == '\n'
|| tokenizerInput[tokenizerStartPos] == '\0'
|| tokenizerInput[tokenizerStartPos] == '=' || tokenizerInput[tokenizerStartPos] == ';' // UDMF TEXTMAP.
|| tokenizerInComment != 0)
&& tokenizerStartPos < tokenizerInputLength)
{
// Try to detect comment endings now
if (tokenizerInComment == 1 && tokenizerInput[tokenizerStartPos] == '\n')
tokenizerInComment = 0; // End of line for a single-line comment
else if (tokenizerInComment == 2
&& tokenizerStartPos < tokenizerInputLength - 1
&& tokenizerInput[tokenizerStartPos] == '*'
&& tokenizerInput[tokenizerStartPos+1] == '/')
{
// End of multi-line comment
tokenizerInComment = 0;
tokenizerStartPos++; // Make damn well sure we're out of the comment ending at the end of it all
}
tokenizerStartPos++;
M_DetectComment(&tokenizerStartPos);
}
// If the end of the string is reached, no token is to be read
if (tokenizerStartPos == tokenizerInputLength) {
tokenizerEndPos = tokenizerInputLength;
return NULL;
}
// Else, if it's one of these three symbols, capture only this one character
else if (tokenizerInput[tokenizerStartPos] == ','
|| tokenizerInput[tokenizerStartPos] == '{'
|| tokenizerInput[tokenizerStartPos] == '}')
{
tokenizerEndPos = tokenizerStartPos + 1;
tokenizerToken[i][0] = tokenizerInput[tokenizerStartPos];
tokenizerToken[i][1] = '\0';
return tokenizerToken[i];
}
// Return entire string within quotes, except without the quotes.
else if (tokenizerInput[tokenizerStartPos] == '"')
{
tokenizerEndPos = ++tokenizerStartPos;
while (tokenizerInput[tokenizerEndPos] != '"' && tokenizerEndPos < tokenizerInputLength)
tokenizerEndPos++;
M_ReadTokenString(i);
tokenizerEndPos++;
return tokenizerToken[i];
}
// Now find the end of the token. This includes several additional characters that are okay to capture as one character, but not trailing at the end of another token.
tokenizerEndPos = tokenizerStartPos + 1;
while ((tokenizerInput[tokenizerEndPos] != ' '
&& tokenizerInput[tokenizerEndPos] != '\t'
&& tokenizerInput[tokenizerEndPos] != '\r'
&& tokenizerInput[tokenizerEndPos] != '\n'
&& tokenizerInput[tokenizerEndPos] != ','
&& tokenizerInput[tokenizerEndPos] != '{'
&& tokenizerInput[tokenizerEndPos] != '}'
&& tokenizerInput[tokenizerEndPos] != '=' && tokenizerInput[tokenizerEndPos] != ';' // UDMF TEXTMAP.
&& tokenizerInComment == 0)
&& tokenizerEndPos < tokenizerInputLength)
{
tokenizerEndPos++;
// Try to detect comment starts now; if it's in a comment, we don't want it in this token
M_DetectComment(&tokenizerEndPos);
}
M_ReadTokenString(i);
return tokenizerToken[i];
}
UINT32 M_TokenizerGetEndPos(void)
{
return tokenizerEndPos;
}
void M_TokenizerSetEndPos(UINT32 newPos)
{
tokenizerEndPos = newPos;
}
/** Count bits in a number.

View file

@ -219,10 +219,12 @@ void Obj_JawzThink(mobj_t *th)
JawzChase(th, grounded);
K_DriftDustHandling(th);
if (P_MobjTouchingSectorSpecial(th, 3, 1, true))
/* todo: UDMFify
if (P_MobjTouchingSectorSpecialFlag(th, ?))
{
K_DoPogoSpring(th, 0, 1);
}
*/
if (jawz_selfdelay(th) > 0)
{

View file

@ -124,10 +124,12 @@ void Obj_OrbinautThink(mobj_t *th)
P_Thrust(th, th->angle, thrustamount);
}
if (P_MobjTouchingSectorSpecial(th, 3, 1, true))
/* todo: UDMFify
if (P_MobjTouchingSectorSpecialFlag(th, ?))
{
K_DoPogoSpring(th, 0, 1);
}
*/
if (orbinaut_selfdelay(th) > 0)
{

View file

@ -35,7 +35,6 @@ INT32 ceilmovesound = sfx_None;
void T_MoveCeiling(ceiling_t *ceiling)
{
result_e res;
boolean dontupdate = false;
if (ceiling->delaytimer)
{
@ -43,259 +42,81 @@ void T_MoveCeiling(ceiling_t *ceiling)
return;
}
switch (ceiling->direction)
res = T_MovePlane(ceiling->sector, ceiling->speed, (ceiling->direction == 1) ? ceiling->topheight : ceiling->bottomheight, false, true, ceiling->direction);
if (ceiling->type == bounceCeiling)
{
case 0: // IN STASIS
break;
case 1: // UP
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->topheight, false, true, ceiling->direction);
if (ceiling->type == bounceCeiling)
{
const fixed_t origspeed = FixedDiv(ceiling->origspeed,(ELEVATORSPEED/2));
const fixed_t fs = abs(ceiling->sector->ceilingheight - lines[ceiling->texture].frontsector->ceilingheight);
const fixed_t bs = abs(ceiling->sector->ceilingheight - lines[ceiling->texture].backsector->ceilingheight);
if (fs < bs)
ceiling->speed = FixedDiv(fs,25*FRACUNIT) + FRACUNIT/4;
else
ceiling->speed = FixedDiv(bs,25*FRACUNIT) + FRACUNIT/4;
ceiling->speed = FixedMul(ceiling->speed,origspeed);
}
if (res == pastdest)
{
switch (ceiling->type)
{
case instantMoveCeilingByFrontSector:
if (ceiling->texture > -1)
ceiling->sector->ceilingpic = ceiling->texture;
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
dontupdate = true;
break;
case moveCeilingByFrontSector:
if (ceiling->texture < -1) // chained linedef executing
P_LinedefExecute((INT16)(ceiling->texture + INT16_MAX + 2), NULL, NULL);
if (ceiling->texture > -1) // flat changing
ceiling->sector->ceilingpic = ceiling->texture;
/* FALLTHRU */
case raiseToHighest:
// case raiseCeilingByLine:
case moveCeilingByFrontTexture:
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
dontupdate = true;
break;
case fastCrushAndRaise:
case crushAndRaise:
ceiling->direction = -1;
break;
case bounceCeiling:
{
fixed_t dest = ceiling->topheight;
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
dest = lines[ceiling->texture].backsector->ceilingheight;
else
dest = lines[ceiling->texture].frontsector->ceilingheight;
if (dest < ceiling->sector->ceilingheight) // must move down
{
ceiling->direction = -1;
ceiling->bottomheight = dest;
}
else // must move up
{
ceiling->direction = 1;
ceiling->topheight = dest;
}
ceiling->delaytimer = ceiling->delay;
// That's it. Do not set dontupdate, do not remove the thinker.
break;
}
case bounceCeilingCrush:
{
fixed_t dest = ceiling->topheight;
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
{
dest = lines[ceiling->texture].backsector->ceilingheight;
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dy),4*FRACUNIT); // return trip, use dy
}
else
{
dest = lines[ceiling->texture].frontsector->ceilingheight;
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dx),4*FRACUNIT); // going frontways, use dx
}
if (dest < ceiling->sector->ceilingheight) // must move down
{
ceiling->direction = -1;
ceiling->bottomheight = dest;
}
else // must move up
{
ceiling->direction = 1;
ceiling->topheight = dest;
}
ceiling->delaytimer = ceiling->delay;
// That's it. Do not set dontupdate, do not remove the thinker.
break;
}
default:
break;
}
}
break;
case -1: // DOWN
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight, ceiling->crush, true, ceiling->direction);
if (ceiling->type == bounceCeiling)
{
const fixed_t origspeed = FixedDiv(ceiling->origspeed,(ELEVATORSPEED/2));
const fixed_t fs = abs(ceiling->sector->ceilingheight - lines[ceiling->texture].frontsector->ceilingheight);
const fixed_t bs = abs(ceiling->sector->ceilingheight - lines[ceiling->texture].backsector->ceilingheight);
if (fs < bs)
ceiling->speed = FixedDiv(fs,25*FRACUNIT) + FRACUNIT/4;
else
ceiling->speed = FixedDiv(bs,25*FRACUNIT) + FRACUNIT/4;
ceiling->speed = FixedMul(ceiling->speed,origspeed);
}
if (res == pastdest)
{
switch (ceiling->type)
{
// make platform stop at bottom of all crusher strokes
// except generalized ones, reset speed, start back up
case crushAndRaise:
ceiling->speed = CEILSPEED;
/* FALLTHRU */
case fastCrushAndRaise:
ceiling->direction = 1;
break;
case instantMoveCeilingByFrontSector:
if (ceiling->texture > -1)
ceiling->sector->ceilingpic = ceiling->texture;
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
dontupdate = true;
break;
case moveCeilingByFrontSector:
if (ceiling->texture < -1) // chained linedef executing
P_LinedefExecute((INT16)(ceiling->texture + INT16_MAX + 2), NULL, NULL);
if (ceiling->texture > -1) // flat changing
ceiling->sector->ceilingpic = ceiling->texture;
// don't break
/* FALLTHRU */
// in all other cases, just remove the active ceiling
case lowerAndCrush:
case lowerToLowest:
case raiseToLowest:
// case lowerCeilingByLine:
case moveCeilingByFrontTexture:
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
dontupdate = true;
break;
case bounceCeiling:
{
fixed_t dest = ceiling->bottomheight;
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
dest = lines[ceiling->texture].backsector->ceilingheight;
else
dest = lines[ceiling->texture].frontsector->ceilingheight;
if (dest < ceiling->sector->ceilingheight) // must move down
{
ceiling->direction = -1;
ceiling->bottomheight = dest;
}
else // must move up
{
ceiling->direction = 1;
ceiling->topheight = dest;
}
ceiling->delaytimer = ceiling->delay;
// That's it. Do not set dontupdate, do not remove the thinker.
break;
}
case bounceCeilingCrush:
{
fixed_t dest = ceiling->bottomheight;
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
{
dest = lines[ceiling->texture].backsector->ceilingheight;
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dy),4*FRACUNIT); // return trip, use dy
}
else
{
dest = lines[ceiling->texture].frontsector->ceilingheight;
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dx),4*FRACUNIT); // going frontways, use dx
}
if (dest < ceiling->sector->ceilingheight) // must move down
{
ceiling->direction = -1;
ceiling->bottomheight = dest;
}
else // must move up
{
ceiling->direction = 1;
ceiling->topheight = dest;
}
ceiling->delaytimer = ceiling->delay;
// That's it. Do not set dontupdate, do not remove the thinker.
break;
}
default:
break;
}
}
else if (res == crushed)
{
switch (ceiling->type)
{
case crushAndRaise:
case lowerAndCrush:
ceiling->speed = FixedDiv(CEILSPEED,8*FRACUNIT);
break;
default:
break;
}
}
break;
const fixed_t origspeed = FixedDiv(ceiling->origspeed, (ELEVATORSPEED/2));
const fixed_t fs = abs(ceiling->sector->ceilingheight - lines[ceiling->sourceline].frontsector->ceilingheight);
const fixed_t bs = abs(ceiling->sector->ceilingheight - lines[ceiling->sourceline].backsector->ceilingheight);
if (fs < bs)
ceiling->speed = FixedDiv(fs, 25*FRACUNIT) + FRACUNIT/4;
else
ceiling->speed = FixedDiv(bs, 25*FRACUNIT) + FRACUNIT/4;
ceiling->speed = FixedMul(ceiling->speed, origspeed);
}
if (!dontupdate)
ceiling->sector->ceilspeed = ceiling->speed*ceiling->direction;
else
ceiling->sector->ceilspeed = 0;
if (res == pastdest)
{
switch (ceiling->type)
{
case instantMoveCeilingByFrontSector:
if (ceiling->texture > -1) // flat changing
ceiling->sector->ceilingpic = ceiling->texture;
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
return;
case moveCeilingByFrontSector:
if (ceiling->tag) // chained linedef executing
P_LinedefExecute(ceiling->tag, NULL, NULL);
if (ceiling->texture > -1) // flat changing
ceiling->sector->ceilingpic = ceiling->texture;
/* FALLTHRU */
case raiseToHighest:
case moveCeilingByDistance:
ceiling->sector->ceilingdata = NULL;
ceiling->sector->ceilspeed = 0;
P_RemoveThinker(&ceiling->thinker);
return;
case bounceCeiling:
case bounceCeilingCrush:
{
fixed_t dest = (ceiling->direction == 1) ? ceiling->topheight : ceiling->bottomheight;
if (dest == lines[ceiling->sourceline].frontsector->ceilingheight)
{
dest = lines[ceiling->sourceline].backsector->ceilingheight;
ceiling->origspeed = lines[ceiling->sourceline].args[3] << (FRACBITS - 2); // return trip, use args[3]
}
else
{
dest = lines[ceiling->sourceline].frontsector->ceilingheight;
ceiling->origspeed = lines[ceiling->sourceline].args[2] << (FRACBITS - 2); // going frontways, use args[2]
}
if (ceiling->type == bounceCeilingCrush)
ceiling->speed = ceiling->origspeed;
if (dest < ceiling->sector->ceilingheight) // must move down
{
ceiling->direction = -1;
ceiling->bottomheight = dest;
}
else // must move up
{
ceiling->direction = 1;
ceiling->topheight = dest;
}
ceiling->delaytimer = ceiling->delay;
break;
}
default:
break;
}
}
ceiling->sector->ceilspeed = ceiling->speed*ceiling->direction;
}
/** Moves a ceiling crusher.
@ -323,11 +144,7 @@ void T_CrushCeiling(ceiling_t *ceiling)
if (res == pastdest)
{
ceiling->direction = -1;
if (lines[ceiling->sourceline].flags & ML_EFFECT4)
ceiling->speed = ceiling->oldspeed;
else
ceiling->speed = ceiling->oldspeed*2;
ceiling->speed = lines[ceiling->sourceline].args[2] << (FRACBITS - 2);
if (ceiling->type == crushCeilOnce
|| ceiling->type == crushBothOnce)
@ -368,12 +185,8 @@ void T_CrushCeiling(ceiling_t *ceiling)
ceiling->sector->soundorg.z = ceiling->sector->floorheight;
S_StartSound(mp,sfx_pstop);
if (lines[ceiling->sourceline].flags & ML_EFFECT4)
ceiling->speed = ceiling->oldspeed;
else
ceiling->speed = ceiling->oldspeed/2;
ceiling->direction = 1;
ceiling->speed = lines[ceiling->sourceline].args[3] << (FRACBITS - 2);
}
break;
}
@ -386,18 +199,18 @@ void T_CrushCeiling(ceiling_t *ceiling)
/** Starts a ceiling mover.
*
* \param tag Tag.
* \param line The source line.
* \param type The type of ceiling movement.
* \return 1 if at least one ceiling mover was started, 0 otherwise.
* \sa EV_DoCrush, EV_DoFloor, EV_DoElevator, T_MoveCeiling
*/
INT32 EV_DoCeiling(line_t *line, ceiling_e type)
INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
{
INT32 rtn = 0, firstone = 1;
INT32 secnum = -1;
sector_t *sec;
ceiling_t *ceiling;
mtag_t tag = Tag_FGet(&line->tags);
TAG_ITER_SECTORS(tag, secnum)
{
@ -418,44 +231,12 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
switch (type)
{
case fastCrushAndRaise:
ceiling->crush = true;
ceiling->topheight = sec->ceilingheight;
ceiling->bottomheight = sec->floorheight + (8*FRACUNIT);
ceiling->direction = -1;
ceiling->speed = CEILSPEED * 2;
break;
case crushAndRaise:
ceiling->crush = true;
ceiling->topheight = sec->ceilingheight;
/* FALLTHRU */
case lowerAndCrush:
ceiling->bottomheight = sec->floorheight;
ceiling->bottomheight += 4*FRACUNIT;
ceiling->direction = -1;
ceiling->speed = line->dx;
break;
case raiseToHighest:
ceiling->topheight = P_FindHighestCeilingSurrounding(sec);
ceiling->direction = 1;
ceiling->speed = CEILSPEED;
break;
//SoM: 3/6/2000: Added Boom types
case lowerToLowest:
ceiling->bottomheight = P_FindLowestCeilingSurrounding(sec);
ceiling->direction = -1;
ceiling->speed = CEILSPEED;
break;
case raiseToLowest: // Graue 09-07-2004
ceiling->topheight = P_FindLowestCeilingSurrounding(sec) - 4*FRACUNIT;
ceiling->direction = 1;
ceiling->speed = line->dx; // hack
break;
case lowerToLowestFast:
ceiling->bottomheight = P_FindLowestCeilingSurrounding(sec);
ceiling->direction = -1;
@ -470,8 +251,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
// Linedef executor excellence
case moveCeilingByFrontSector:
ceiling->speed = P_AproxDistance(line->dx, line->dy);
ceiling->speed = FixedDiv(ceiling->speed,8*FRACUNIT);
ceiling->speed = line->args[2] << (FRACBITS - 3);
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
{
ceiling->direction = 1;
@ -484,21 +264,13 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
}
// chained linedef executing ability
if (line->flags & ML_BLOCKPLAYERS)
{
// only set it on ONE of the moving sectors (the smallest numbered)
// and front side x offset must be positive
if (firstone && sides[line->sidenum[0]].textureoffset > 0)
ceiling->texture = (sides[line->sidenum[0]].textureoffset>>FRACBITS) - 32769;
else
ceiling->texture = -1;
}
// only set it on ONE of the moving sectors (the smallest numbered)
// only set it if there isn't also a floor mover
if (line->args[3] && line->args[1] == 1)
ceiling->tag = firstone ? (INT16)line->args[3] : 0;
// flat changing ability
else if (line->flags & ML_NOCLIMB)
ceiling->texture = line->frontsector->ceilingpic;
else
ceiling->texture = -1;
ceiling->texture = line->args[4] ? line->frontsector->ceilingpic : -1;
break;
// More linedef executor junk
@ -515,67 +287,30 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
ceiling->direction = -1;
ceiling->bottomheight = line->frontsector->ceilingheight;
}
if (line->flags & ML_NOCLIMB)
ceiling->texture = -1;
else
ceiling->texture = line->frontsector->ceilingpic;
// If flag is set, change ceiling texture after moving
ceiling->texture = line->args[2] ? line->frontsector->ceilingpic : -1;
break;
case moveCeilingByFrontTexture:
if (line->flags & ML_NOCLIMB)
case moveCeilingByDistance:
if (line->args[4])
ceiling->speed = INT32_MAX/2; // as above, "instant" is one tic
else
ceiling->speed = FixedDiv(sides[line->sidenum[0]].textureoffset,8*FRACUNIT); // texture x offset
if (sides[line->sidenum[0]].rowoffset > 0)
ceiling->speed = line->args[3] << (FRACBITS - 3);
if (line->args[2] > 0)
{
ceiling->direction = 1; // up
ceiling->topheight = sec->ceilingheight + sides[line->sidenum[0]].rowoffset; // texture y offset
ceiling->topheight = sec->ceilingheight + (line->args[2] << FRACBITS);
}
else {
ceiling->direction = -1; // down
ceiling->bottomheight = sec->ceilingheight + sides[line->sidenum[0]].rowoffset; // texture y offset
ceiling->bottomheight = sec->ceilingheight + (line->args[2] << FRACBITS);
}
break;
/*
case lowerCeilingByLine:
ceiling->speed = FixedDiv(abs(line->dx),8*FRACUNIT);
ceiling->direction = -1; // Move down
ceiling->bottomheight = sec->ceilingheight - abs(line->dy);
break;
case raiseCeilingByLine:
ceiling->speed = FixedDiv(abs(line->dx),8*FRACUNIT);
ceiling->direction = 1; // Move up
ceiling->topheight = sec->ceilingheight + abs(line->dy);
break;
*/
case bounceCeiling:
ceiling->speed = P_AproxDistance(line->dx, line->dy); // same speed as elevateContinuous
ceiling->speed = FixedDiv(ceiling->speed,4*FRACUNIT);
ceiling->origspeed = ceiling->speed;
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
{
ceiling->direction = 1;
ceiling->topheight = line->frontsector->ceilingheight;
}
else // Move down
{
ceiling->direction = -1;
ceiling->bottomheight = line->frontsector->ceilingheight;
}
// Any delay?
ceiling->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
ceiling->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
ceiling->texture = (fixed_t)(line - lines); // hack: use texture to store sourceline number
break;
case bounceCeilingCrush:
ceiling->speed = abs(line->dx); // same speed as elevateContinuous
ceiling->speed = FixedDiv(ceiling->speed,4*FRACUNIT);
ceiling->speed = line->args[2] << (FRACBITS - 2); // same speed as elevateContinuous
ceiling->origspeed = ceiling->speed;
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
{
@ -589,10 +324,8 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
}
// Any delay?
ceiling->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
ceiling->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
ceiling->texture = (fixed_t)(line - lines); // hack: use texture to store sourceline number
ceiling->delay = line->args[5];
ceiling->delaytimer = line->args[4]; // Initial delay
break;
default:
@ -600,7 +333,6 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
}
ceiling->tag = tag;
ceiling->type = type;
firstone = 0;
@ -612,19 +344,19 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
/** Starts a ceiling crusher.
*
* \param tag Tag.
* \param line The source line.
* \param type The type of ceiling, either ::crushAndRaise or
* ::fastCrushAndRaise.
* \return 1 if at least one crusher was started, 0 otherwise.
* \sa EV_DoCeiling, EV_DoFloor, EV_DoElevator, T_CrushCeiling
*/
INT32 EV_DoCrush(line_t *line, ceiling_e type)
INT32 EV_DoCrush(mtag_t tag, line_t *line, ceiling_e type)
{
INT32 rtn = 0;
INT32 secnum = -1;
sector_t *sec;
ceiling_t *ceiling;
mtag_t tag = Tag_FGet(&line->tags);
TAG_ITER_SECTORS(tag, secnum)
{
@ -642,46 +374,33 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
ceiling->sector = sec;
ceiling->crush = true;
ceiling->sourceline = (INT32)(line-lines);
if (line->flags & ML_EFFECT4)
ceiling->oldspeed = FixedDiv(abs(line->dx),4*FRACUNIT);
else
ceiling->oldspeed = (R_PointToDist2(line->v2->x, line->v2->y, line->v1->x, line->v1->y)/16);
ceiling->speed = ceiling->origspeed = line->args[2] << (FRACBITS - 2);
switch(type)
{
case fastCrushAndRaise: // Up and then down
case raiseAndCrush: // Up and then down
ceiling->topheight = P_FindHighestCeilingSurrounding(sec);
ceiling->direction = 1;
ceiling->speed = ceiling->oldspeed;
// Retain stupid behavior for backwards compatibility
if (!udmf && !(line->flags & ML_MIDSOLID))
ceiling->speed /= 2;
else
ceiling->speed = line->args[3] << (FRACBITS - 2);
ceiling->bottomheight = sec->floorheight + FRACUNIT;
break;
case crushBothOnce:
ceiling->topheight = sec->ceilingheight;
ceiling->bottomheight = sec->floorheight + (sec->ceilingheight-sec->floorheight)/2;
ceiling->direction = -1;
if (line->flags & ML_EFFECT4)
ceiling->speed = ceiling->oldspeed;
else
ceiling->speed = ceiling->oldspeed*2;
break;
case crushCeilOnce:
default: // Down and then up.
ceiling->topheight = sec->ceilingheight;
ceiling->direction = -1;
if (line->flags & ML_EFFECT4)
ceiling->speed = ceiling->oldspeed;
else
ceiling->speed = ceiling->oldspeed*2;
ceiling->bottomheight = sec->floorheight + FRACUNIT;
break;
}
ceiling->tag = tag;
ceiling->type = type;
// interpolation

View file

@ -12,6 +12,7 @@
/// \brief Enemy thinking, AI
/// Action Pointer Functions that are associated with states/frames
#include "dehacked.h"
#include "doomdef.h"
#include "g_game.h"
#include "p_local.h"
@ -162,6 +163,7 @@ void A_Boss3TakeDamage(mobj_t *actor);
void A_Boss3Path(mobj_t *actor);
void A_Boss3ShockThink(mobj_t *actor);
void A_LinedefExecute(mobj_t *actor);
void A_LinedefExecuteFromArg(mobj_t *actor);
void A_PlaySeeSound(mobj_t *actor);
void A_PlayAttackSound(mobj_t *actor);
void A_PlayActiveSound(mobj_t *actor);
@ -504,7 +506,7 @@ static boolean P_WaterInSector(mobj_t *mobj, fixed_t x, fixed_t y)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE))
continue;
if (*rover->topheight >= mobj->floorz && *rover->topheight <= mobj->z)
@ -3385,6 +3387,116 @@ void A_Explode(mobj_t *actor)
P_RadiusAttack(actor, actor->target, actor->info->damage, locvar1, true);
}
static mobj_t *P_FindBossFlyPoint(mobj_t *mo, INT32 tag)
{
INT32 i;
mobj_t *closest = NULL;
TAG_ITER_THINGS(tag, i)
{
mobj_t *mo2 = mapthings[i].mobj;
if (!mo2)
continue;
if (mo2->type != MT_BOSSFLYPOINT)
continue;
// If this one's further than the last one, don't go for it.
if (closest &&
P_AproxDistance(P_AproxDistance(mo->x - mo2->x, mo->y - mo2->y), mo->z - mo2->z) >
P_AproxDistance(P_AproxDistance(mo->x - closest->x, mo->y - closest->y), mo->z - closest->z))
continue;
closest = mo2;
}
return closest;
}
static void P_DoBossVictory(mobj_t *mo)
{
thinker_t *th;
mobj_t *mo2;
INT32 i;
// scan the remaining thinkers to see if all bosses are dead
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo2 = (mobj_t *)th;
if (mo2 == mo)
continue;
if ((mo2->flags & MF_BOSS) && mo2->health > 0)
return;
}
// victory!
if (mo->spawnpoint)
P_LinedefExecute(mo->spawnpoint->args[3], mo, NULL);
if (stoppedclock && modeattacking) // if you're just time attacking, skip making the capsule appear since you don't need to step on it anyways.
return;
if (mo->flags2 & MF2_BOSSNOTRAP)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
}
}
else
{
if (!udmf)
{
// Bring the egg trap up to the surface
// Incredibly shitty code ahead
EV_DoElevator(LE_CAPSULE0, NULL, elevateHighest);
EV_DoElevator(LE_CAPSULE1, NULL, elevateUp);
EV_DoElevator(LE_CAPSULE2, NULL, elevateHighest);
}
}
}
static void P_DoBossDefaultDeath(mobj_t *mo)
{
INT32 bossid = (mo->spawnpoint ? mo->spawnpoint->args[0] : 0);
// Stop exploding and prepare to run.
P_SetMobjState(mo, mo->info->xdeathstate);
if (P_MobjWasRemoved(mo))
return;
P_SetTarget(&mo->target, P_FindBossFlyPoint(mo, bossid));
mo->flags |= MF_NOGRAVITY|MF_NOCLIP;
mo->flags |= MF_NOCLIPHEIGHT;
mo->movedir = 0;
mo->extravalue1 = 35;
mo->flags2 |= MF2_BOSSFLEE;
mo->momz = P_MobjFlip(mo)*2*mo->scale;
if (mo->target)
{
angle_t diff = R_PointToAngle2(mo->x, mo->y, mo->target->x, mo->target->y) - mo->angle;
if (diff)
{
if (diff > ANGLE_180)
diff = InvAngle(InvAngle(diff)/mo->extravalue1);
else
diff /= mo->extravalue1;
mo->movedir = diff;
}
}
}
// Function: A_BossDeath
//
// Description: Possibly trigger special effects when boss dies.
@ -3394,18 +3506,13 @@ void A_Explode(mobj_t *actor)
//
void A_BossDeath(mobj_t *mo)
{
thinker_t *th;
mobj_t *mo2;
line_t junk;
INT32 i;
if (LUA_CallAction(A_BOSSDEATH, mo))
return;
if (mo->spawnpoint && mo->spawnpoint->extrainfo)
P_LinedefExecute(LE_BOSSDEAD+(mo->spawnpoint->extrainfo*LE_PARAMWIDTH), mo, NULL);
else
P_LinedefExecute(LE_BOSSDEAD, mo, NULL);
if (mo->spawnpoint)
P_LinedefExecute(mo->spawnpoint->args[2], mo, NULL);
mo->health = 0;
// Boss is dead (but not necessarily fleeing...)
@ -3421,241 +3528,19 @@ void A_BossDeath(mobj_t *mo)
if (i == MAXPLAYERS)
return; // no one left alive, so do not end game
// scan the remaining thinkers to see
// if all bosses are dead
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
P_DoBossVictory(mo);
mo2 = (mobj_t *)th;
if (mo2 != mo && (mo2->flags & MF_BOSS) && mo2->health > 0)
goto bossjustdie; // other boss not dead - just go straight to dying!
}
// victory!
P_LinedefExecute(LE_ALLBOSSESDEAD, mo, NULL);
if (stoppedclock && modeattacking) // if you're just time attacking, skip making the capsule appear since you don't need to step on it anyways.
goto bossjustdie;
if (mo->flags2 & MF2_BOSSNOTRAP)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
}
}
else
{
// Initialize my junk
junk.tags.tags = NULL;
junk.tags.count = 0;
// Bring the egg trap up to the surface
// Incredibly shitty code ahead
Tag_FSet(&junk.tags, LE_CAPSULE0);
EV_DoElevator(&junk, elevateHighest, false);
Tag_FSet(&junk.tags, LE_CAPSULE1);
EV_DoElevator(&junk, elevateUp, false);
Tag_FSet(&junk.tags, LE_CAPSULE2);
EV_DoElevator(&junk, elevateHighest, false);
}
bossjustdie:
if (LUA_HookMobj(mo, MOBJ_HOOK(BossDeath)))
return;
else if (P_MobjWasRemoved(mo))
return;
// Spawn your junk
switch (mo->type)
{
default:
break;
case MT_EGGMOBILE: // twin laser pods
{
mo2 = P_SpawnMobjFromMobj(mo,
P_ReturnThrustX(mo, mo->angle - ANGLE_90, 32<<FRACBITS),
P_ReturnThrustY(mo, mo->angle - ANGLE_90, 32<<FRACBITS),
32<<FRACBITS, MT_BOSSJUNK);
mo2->angle = mo->angle;
P_InstaThrust(mo2, mo2->angle - ANGLE_90, 4*mo2->scale);
P_SetObjectMomZ(mo2, 4*FRACUNIT, false);
P_SetMobjState(mo2, S_BOSSEGLZ1);
mo2 = P_SpawnMobjFromMobj(mo,
P_ReturnThrustX(mo, mo->angle + ANGLE_90, 32<<FRACBITS),
P_ReturnThrustY(mo, mo->angle + ANGLE_90, 32<<FRACBITS),
32<<FRACBITS, MT_BOSSJUNK);
mo2->angle = mo->angle;
P_InstaThrust(mo2, mo2->angle + ANGLE_90, 4*mo2->scale);
P_SetObjectMomZ(mo2, 4*FRACUNIT, false);
P_SetMobjState(mo2, S_BOSSEGLZ2);
}
break;
case MT_EGGMOBILE2: // twin tanks + spigot
{
mo2 = P_SpawnMobjFromMobj(mo,
P_ReturnThrustX(mo, mo->angle - ANGLE_90, 32<<FRACBITS),
P_ReturnThrustY(mo, mo->angle - ANGLE_90, 32<<FRACBITS),
32<<FRACBITS, MT_BOSSJUNK);
mo2->angle = mo->angle;
P_InstaThrust(mo2, mo2->angle - ANGLE_90, 4*mo2->scale);
P_SetObjectMomZ(mo2, 4*FRACUNIT, false);
P_SetMobjState(mo2, S_BOSSTANK1);
mo2 = P_SpawnMobjFromMobj(mo,
P_ReturnThrustX(mo, mo->angle + ANGLE_90, 32<<FRACBITS),
P_ReturnThrustY(mo, mo->angle + ANGLE_90, 32<<FRACBITS),
32<<FRACBITS, MT_BOSSJUNK);
mo2->angle = mo->angle;
P_InstaThrust(mo2, mo2->angle + ANGLE_90, 4*mo2->scale);
P_SetObjectMomZ(mo2, 4*FRACUNIT, false);
P_SetMobjState(mo2, S_BOSSTANK2);
mo2 = P_SpawnMobjFromMobj(mo, 0, 0,
mobjinfo[MT_EGGMOBILE2].height + (32<<FRACBITS),
MT_BOSSJUNK);
mo2->angle = mo->angle;
P_SetObjectMomZ(mo2, 4*FRACUNIT, false);
mo2->momz += mo->momz;
P_SetMobjState(mo2, S_BOSSSPIGOT);
}
break;
case MT_EGGMOBILE3:
{
mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_BOSSJUNK);
mo2->angle = mo->angle;
P_SetMobjState(mo2, S_BOSSSEBH1);
}
break;
}
// now do another switch case for escaping
switch (mo->type)
{
case MT_KOOPA:
{
// Initialize my junk
junk.tags.tags = NULL;
junk.tags.count = 0;
Tag_FSet(&junk.tags, LE_KOOPA);
EV_DoCeiling(&junk, raiseToHighest);
return;
}
case MT_FANG:
{
if (mo->flags2 & MF2_SLIDEPUSH)
{
P_RemoveMobj(mo);
return;
}
if (mo->tracer)
{
var1 = var2 = 0;
A_Boss5Jump(mo);
mo->momx = ((16 - 1)*mo->momx)/16;
mo->momy = ((16 - 1)*mo->momy)/16;
{
const fixed_t time = FixedHypot(mo->tracer->x - mo->x, mo->tracer->y - mo->y)/FixedHypot(mo->momx, mo->momy);
const fixed_t speed = 64*FRACUNIT;
mobj_t *pole = P_SpawnMobj(
mo->tracer->x - P_ReturnThrustX(mo->tracer, mo->tracer->angle, speed*time),
mo->tracer->y - P_ReturnThrustY(mo->tracer, mo->tracer->angle, speed*time),
mo->tracer->floorz + (256+1)*FRACUNIT,
MT_FSGNB);
P_SetTarget(&pole->tracer, P_SpawnMobj(
pole->x, pole->y,
pole->z - 256*FRACUNIT,
MT_FSGNB));
P_SetTarget(&pole->tracer->tracer, P_SpawnMobj(
pole->x + P_ReturnThrustX(pole, mo->tracer->angle, FRACUNIT),
pole->y + P_ReturnThrustY(pole, mo->tracer->angle, FRACUNIT),
pole->z + 256*FRACUNIT,
MT_FSGNA));
pole->tracer->flags |= MF_NOCLIPTHING;
P_SetScale(pole, (pole->destscale = 2*FRACUNIT));
P_SetScale(pole->tracer, (pole->tracer->destscale = 2*FRACUNIT));
pole->angle = mo->tracer->angle;
pole->tracer->angle = mo->tracer->angle;
pole->tracer->tracer->angle = pole->angle - ANGLE_90;
pole->momx = P_ReturnThrustX(pole, pole->angle, speed);
pole->momy = P_ReturnThrustY(pole, pole->angle, speed);
pole->tracer->momx = pole->momx;
pole->tracer->momy = pole->momy;
pole->tracer->tracer->momx = pole->momx;
pole->tracer->tracer->momy = pole->momy;
}
}
else
{
P_SetObjectMomZ(mo, 10*FRACUNIT, false);
mo->flags |= MF_NOGRAVITY;
}
mo->flags |= MF_NOCLIP|MF_NOCLIPHEIGHT;
return;
}
default: //eggmobiles
{
UINT8 extrainfo = (mo->spawnpoint ? mo->spawnpoint->extrainfo : 0);
// Stop exploding and prepare to run.
P_SetMobjState(mo, mo->info->xdeathstate);
if (P_MobjWasRemoved(mo))
return;
P_SetTarget(&mo->target, NULL);
// Flee! Flee! Find a point to escape to! If none, just shoot upward!
// scan the thinkers to find the runaway point
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo2 = (mobj_t *)th;
if (mo2->type != MT_BOSSFLYPOINT)
continue;
if (mo2->spawnpoint && mo2->spawnpoint->extrainfo != extrainfo)
continue;
// If this one's further then the last one, don't go for it.
if (mo->target &&
P_AproxDistance(P_AproxDistance(mo->x - mo2->x, mo->y - mo2->y), mo->z - mo2->z) >
P_AproxDistance(P_AproxDistance(mo->x - mo->target->x, mo->y - mo->target->y), mo->z - mo->target->z))
continue;
// Otherwise... Do!
P_SetTarget(&mo->target, mo2);
}
mo->flags |= MF_NOGRAVITY|MF_NOCLIP;
mo->flags |= MF_NOCLIPHEIGHT;
mo->movedir = 0;
mo->extravalue1 = 35;
mo->flags2 |= MF2_BOSSFLEE;
mo->momz = P_MobjFlip(mo)*2*mo->scale;
if (mo->target)
{
angle_t diff = R_PointToAngle2(mo->x, mo->y, mo->target->x, mo->target->y) - mo->angle;
if (diff)
{
if (diff > ANGLE_180)
diff = InvAngle(InvAngle(diff)/mo->extravalue1);
else
diff /= mo->extravalue1;
mo->movedir = diff;
}
}
P_DoBossDefaultDeath(mo);
break;
}
}
}
@ -4193,12 +4078,16 @@ void A_FishJump(mobj_t *actor)
fixed_t jumpval;
if (locvar1)
jumpval = var1;
jumpval = locvar1;
else
jumpval = FixedMul(AngleFixed(actor->angle)/4, actor->scale);
{
if (actor->spawnpoint && actor->spawnpoint->args[0])
jumpval = actor->spawnpoint->args[0];
else
jumpval = 44;
}
if (!jumpval) jumpval = FixedMul(44*(FRACUNIT/4), actor->scale);
actor->momz = jumpval;
actor->momz = FixedMul(jumpval << (FRACBITS - 2), actor->scale);
P_SetMobjStateNF(actor, actor->info->seestate);
}
@ -5197,48 +5086,34 @@ void A_RockSpawn(mobj_t *actor)
{
mobj_t *mo;
mobjtype_t type;
INT32 i = Tag_FindLineSpecial(12, (INT16)actor->threshold);
line_t *line;
fixed_t dist;
fixed_t randomoomph;
if (LUA_CallAction(A_ROCKSPAWN, actor))
return;
if (i == -1)
if (!actor->spawnpoint)
return;
type = actor->spawnpoint->stringargs[0] ? get_number(actor->spawnpoint->stringargs[0]) : MT_ROCKCRUMBLE1;
if (type < MT_NULL || type >= NUMMOBJTYPES)
{
CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Unable to find parameter line 12 (tag %d)!\n", actor->threshold);
CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Invalid mobj type %s!\n", actor->spawnpoint->stringargs[0]);
return;
}
line = &lines[i];
if (!(sides[line->sidenum[0]].textureoffset >> FRACBITS))
{
CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: No X-offset detected! (tag %d)!\n", actor->threshold);
return;
}
dist = P_AproxDistance(line->dx, line->dy)/16;
if (dist < 1)
dist = 1;
type = MT_ROCKCRUMBLE1 + (sides[line->sidenum[0]].rowoffset >> FRACBITS);
if (line->flags & ML_NOCLIMB)
randomoomph = P_RandomByte(PR_DECORATION) * (FRACUNIT/32);
else
randomoomph = 0;
dist = max(actor->spawnpoint->args[0] << (FRACBITS - 4), 1);
if (actor->spawnpoint->args[2])
dist += P_RandomByte(PR_UNDEFINED) * (FRACUNIT/32); // random oomph
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FALLINGROCK);
P_SetMobjState(mo, mobjinfo[type].spawnstate);
mo->angle = R_PointToAngle2(line->v2->x, line->v2->y, line->v1->x, line->v1->y);
mo->angle = FixedAngle(actor->spawnpoint->angle << FRACBITS);
P_InstaThrust(mo, mo->angle, dist + randomoomph);
mo->momz = dist + randomoomph;
P_InstaThrust(mo, mo->angle, dist);
mo->momz = dist;
var1 = sides[line->sidenum[0]].textureoffset >> FRACBITS;
var1 = actor->spawnpoint->args[1];
A_SetTics(actor);
}
@ -5900,10 +5775,8 @@ void A_Boss1Chase(mobj_t *actor)
}
else
{
if (actor->spawnpoint && actor->spawnpoint->extrainfo)
P_LinedefExecute(LE_PINCHPHASE+(actor->spawnpoint->extrainfo*LE_PARAMWIDTH), actor, NULL);
else
P_LinedefExecute(LE_PINCHPHASE, actor, NULL);
if (actor->spawnpoint)
P_LinedefExecute(actor->spawnpoint->args[4], actor, NULL);
P_SetMobjState(actor, actor->info->raisestate);
}
@ -6027,7 +5900,7 @@ void A_Boss2Chase(mobj_t *actor)
}
else
{
// Only speed up if you have the 'Deaf' flag.
// Only speed up if you have the ambush flag.
if (actor->flags2 & MF2_AMBUSH)
speedvar = actor->health;
else
@ -6600,12 +6473,21 @@ void A_GuardChase(mobj_t *actor)
false)
&& speed > 0) // can't be the same check as previous so that P_TryMove gets to happen.
{
if (actor->spawnpoint && ((actor->spawnpoint->options & (MTF_EXTRA|MTF_OBJECTSPECIAL)) == MTF_OBJECTSPECIAL))
actor->angle += ANGLE_90;
else if (actor->spawnpoint && ((actor->spawnpoint->options & (MTF_EXTRA|MTF_OBJECTSPECIAL)) == MTF_EXTRA))
actor->angle -= ANGLE_90;
else
actor->angle += ANGLE_180;
INT32 direction = actor->spawnpoint ? actor->spawnpoint->args[0] : TMGD_BACK;
switch (direction)
{
case TMGD_BACK:
default:
actor->angle += ANGLE_180;
break;
case TMGD_RIGHT:
actor->angle -= ANGLE_90;
break;
case TMGD_LEFT:
actor->angle += ANGLE_90;
break;
}
}
if (actor->extravalue1 < actor->info->speed)
@ -6805,10 +6687,6 @@ void A_Boss3TakeDamage(mobj_t *actor)
actor->movecount = var1;
actor->movefactor = -512*FRACUNIT;
/*if (actor->target && actor->target->spawnpoint)
actor->threshold = actor->target->spawnpoint->extrainfo;*/
}
// Function: A_Boss3Path
@ -6848,27 +6726,21 @@ void A_Boss3Path(mobj_t *actor)
if (!(actor->flags2 & MF2_STRONGBOX))
{
thinker_t *th;
mobj_t *mo2;
INT32 i;
P_SetTarget(&actor->target, NULL);
// scan the thinkers
// to find a point that matches
// the number
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
// Find waypoint
TAG_ITER_THINGS(actor->cusval, i)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo2 = mapthings[i].mobj;
mo2 = (mobj_t *)th;
if (!mo2)
continue;
if (mo2->type != MT_BOSS3WAYPOINT)
continue;
if (!mo2->spawnpoint)
continue;
if (mo2->spawnpoint->angle != actor->threshold)
continue;
if (mo2->spawnpoint->extrainfo != actor->cusval)
if (mapthings[i].args[0] != actor->threshold)
continue;
P_SetTarget(&actor->target, mo2);
@ -7014,8 +6886,6 @@ void A_LinedefExecute(mobj_t *actor)
if (locvar2)
tagnum += locvar2*(AngleFixed(actor->angle)>>FRACBITS);
else if (actor->spawnpoint && actor->spawnpoint->extrainfo)
tagnum += (actor->spawnpoint->extrainfo*LE_PARAMWIDTH);
CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecute: Running mobjtype %d's sector with tag %d\n", actor->type, tagnum);
@ -7023,6 +6893,38 @@ void A_LinedefExecute(mobj_t *actor)
P_LinedefExecute((INT16)tagnum, actor, actor->subsector->sector);
}
// Function: A_LinedefExecuteFromArg
//
// Description: Object's location is used to set the calling sector. The tag used is the spawnpoint mapthing's args[var1].
//
// var1 = mapthing arg to take tag from
// var2 = unused
//
void A_LinedefExecuteFromArg(mobj_t *actor)
{
INT32 tagnum;
INT32 locvar1 = var1;
if (LUA_CallAction(A_LINEDEFEXECUTEFROMARG, actor))
return;
if (!actor->spawnpoint)
return;
if (locvar1 < 0 || locvar1 > NUMMAPTHINGARGS)
{
CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecuteFromArg: Invalid mapthing arg %d\n", locvar1);
return;
}
tagnum = actor->spawnpoint->args[locvar1];
CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecuteFromArg: Running mobjtype %d's sector with tag %d\n", actor->type, tagnum);
// tag 32768 displayed in map editors is actually tag -32768, tag 32769 is -32767, 65535 is -1 etc.
P_LinedefExecute((INT16)tagnum, actor, actor->subsector->sector);
}
// Function: A_PlaySeeSound
//
// Description: Plays the object's seesound.
@ -10152,10 +10054,7 @@ void A_BrakLobShot(mobj_t *actor)
return; // Don't even bother if we've got nothing to aim at.
// Look up actor's current gravity situation
if (actor->subsector->sector->gravity)
g = FixedMul(gravity,(FixedDiv(*actor->subsector->sector->gravity>>FRACBITS, 1000)));
else
g = gravity;
g = FixedMul(gravity, P_GetSectorGravityFactor(actor->subsector->sector));
// Look up distance between actor and its target
x = P_AproxDistance(actor->target->x - actor->x, actor->target->y - actor->y);
@ -10267,10 +10166,7 @@ void A_NapalmScatter(mobj_t *actor)
airtime = 16<<FRACBITS;
// Look up actor's current gravity situation
if (actor->subsector->sector->gravity)
g = FixedMul(gravity,(FixedDiv(*actor->subsector->sector->gravity>>FRACBITS, 1000)));
else
g = gravity;
g = FixedMul(gravity, P_GetSectorGravityFactor(actor->subsector->sector));
// vy = (g*(airtime-1))/2
vy = FixedMul(g,(airtime-(1<<FRACBITS)))>>1;
@ -10395,7 +10291,7 @@ void A_FlickySpawn(mobj_t *actor)
}
// Internal Flicky color setting
void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo)
void P_InternalFlickySetColor(mobj_t *actor, UINT8 color)
{
UINT8 flickycolors[] = {
SKINCOLOR_RED,
@ -10415,11 +10311,11 @@ void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo)
SKINCOLOR_YELLOW,
};
if (extrainfo == 0)
if (color == 0)
// until we can customize flicky colors by level header, just stick to SRB2's defaults
actor->color = flickycolors[P_RandomKey(PR_UNDEFINED, 2)]; //flickycolors[P_RandomKey(sizeof(flickycolors))];
else
actor->color = flickycolors[min(extrainfo-1, 14)]; // sizeof(flickycolors)-1
actor->color = flickycolors[min(color-1, 14)]; // sizeof(flickycolors)-1
}
// Function: A_FlickyCenter
@ -10429,17 +10325,17 @@ void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo)
// var1:
// Lower 16 bits = if 0, spawns random flicky based on level header. Else, spawns the designated thing type.
// Bits 17-20 = Flicky color, up to 15. Applies to fish.
// Bit 21 = Flag MF_SLIDEME (see below)
// Bit 22 = Flag MF_GRENADEBOUNCE (see below)
// Bit 23 = Flag MF_NOCLIPTHING (see below)
// Bit 21 = Flag TMFF_AIMLESS (see below)
// Bit 22 = Flag TMFF_STATIONARY (see below)
// Bit 23 = Flag TMFF_HOP (see below)
//
// If actor is placed from a spawnpoint (map Thing), the Thing's properties take precedence.
//
// var2 = maximum default distance away from spawn the flickies are allowed to travel. If angle != 0, then that's the radius.
// var2 = maximum default distance away from spawn the flickies are allowed to travel. If args[0] != 0, then that's the radius.
//
// If MTF_EXTRA (MF_SLIDEME): is flagged, Flickies move aimlessly. Else, orbit around the target.
// If MTF_OBJECTSPECIAL (MF_GRENADEBOUNCE): Flickies stand in-place without gravity (unless they hop, then gravity is applied.)
// If MTF_AMBUSH (MF_NOCLIPTHING): is flagged, Flickies hop.
// If TMFF_AIMLESS (MF_SLIDEME): is flagged, Flickies move aimlessly. Else, orbit around the target.
// If TMFF_STATIONARY (MF_GRENADEBOUNCE): Flickies stand in-place without gravity (unless they hop, then gravity is applied.)
// If TMFF_HOP (MF_NOCLIPTHING): is flagged, Flickies hop.
//
void A_FlickyCenter(mobj_t *actor)
{
@ -10461,14 +10357,15 @@ void A_FlickyCenter(mobj_t *actor)
if (actor->spawnpoint)
{
actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING);
actor->flags |= (
((actor->spawnpoint->options & MTF_EXTRA) ? MF_SLIDEME : 0)
| ((actor->spawnpoint->options & MTF_OBJECTSPECIAL) ? MF_GRENADEBOUNCE : 0)
| ((actor->spawnpoint->options & MTF_AMBUSH) ? MF_NOCLIPTHING : 0)
);
actor->extravalue1 = actor->spawnpoint->angle ? abs(actor->spawnpoint->angle) * FRACUNIT
: locvar2 ? abs(locvar2) : 384 * FRACUNIT;
actor->extravalue2 = actor->spawnpoint->extrainfo;
if (actor->spawnpoint->args[1] & TMFF_AIMLESS)
actor->flags |= MF_SLIDEME;
if (actor->spawnpoint->args[1] & TMFF_STATIONARY)
actor->flags |= MF_GRENADEBOUNCE;
if (actor->spawnpoint->args[1] & TMFF_HOP)
actor->flags |= MF_NOCLIPTHING;
actor->extravalue1 = actor->spawnpoint->args[0] ? abs(actor->spawnpoint->args[0])*FRACUNIT
: locvar2 ? abs(locvar2) : 384*FRACUNIT;
actor->extravalue2 = actor->spawnpoint->args[2];
actor->friction = actor->spawnpoint->x*FRACUNIT;
actor->movefactor = actor->spawnpoint->y*FRACUNIT;
actor->watertop = actor->spawnpoint->z*FRACUNIT;
@ -10476,11 +10373,12 @@ void A_FlickyCenter(mobj_t *actor)
else
{
actor->flags &= ~(MF_SLIDEME|MF_GRENADEBOUNCE|MF_NOCLIPTHING);
actor->flags |= (
((flickyflags & 1) ? MF_SLIDEME : 0)
| ((flickyflags & 2) ? MF_GRENADEBOUNCE : 0)
| ((flickyflags & 4) ? MF_NOCLIPTHING : 0)
);
if (flickyflags & TMFF_AIMLESS)
actor->flags |= MF_SLIDEME;
if (flickyflags & TMFF_STATIONARY)
actor->flags |= MF_GRENADEBOUNCE;
if (flickyflags & TMFF_HOP)
actor->flags |= MF_NOCLIPTHING;
actor->extravalue1 = abs(locvar2);
actor->extravalue2 = flickycolor;
actor->friction = actor->x;
@ -10981,8 +10879,12 @@ void A_Boss5Jump(mobj_t *actor)
if (!actor->tracer)
return; // Don't even bother if we've got nothing to aim at.
// Scale with map
g = FixedMul(gravity, mapobjectscale);
// Look up actor's current gravity situation
g = FixedMul(gravity, P_GetSectorGravityFactor(actor->subsector->sector));
// Look up distance between actor and its tracer
x = FixedHypot(actor->tracer->x - actor->x, actor->tracer->y - actor->y);
// Look up height difference between actor and its tracer
@ -11406,67 +11308,43 @@ void A_Boss5FindWaypoint(mobj_t *actor)
{
INT32 locvar1 = var1;
boolean avoidcenter;
UINT32 i;
UINT8 extrainfo = (actor->spawnpoint ? actor->spawnpoint->extrainfo : 0);
INT32 i;
INT32 bossid = (actor->spawnpoint ? actor->spawnpoint->args[0] : 0);
if (LUA_CallAction(A_BOSS5FINDWAYPOINT, actor))
return;
avoidcenter = !actor->tracer || (actor->health == actor->info->damage+1);
if (locvar1 == 2) // look for the boss waypoint
if (locvar1 == 2) // look for the boss flypoint
{
thinker_t *th;
mobj_t *mo2;
P_SetTarget(&actor->tracer, NULL);
// Flee! Flee! Find a point to escape to! If none, just shoot upward!
// scan the thinkers to find the runaway point
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
P_SetTarget(&actor->tracer, P_FindBossFlyPoint(actor, bossid));
mo2 = (mobj_t *)th;
if (mo2->type != MT_BOSSFLYPOINT)
continue;
if (mo2->spawnpoint && mo2->spawnpoint->extrainfo != extrainfo)
continue;
// If this one's further then the last one, don't go for it.
if (actor->tracer &&
P_AproxDistance(P_AproxDistance(actor->x - mo2->x, actor->y - mo2->y), actor->z - mo2->z) >
P_AproxDistance(P_AproxDistance(actor->x - actor->tracer->x, actor->y - actor->tracer->y), actor->z - actor->tracer->z))
continue;
// Otherwise... Do!
P_SetTarget(&actor->tracer, mo2);
}
if (!actor->tracer)
return; // no boss flypoints found
}
else if (locvar1 == 1) // always go to ambush-marked waypoint
{
boolean found = false;
if (avoidcenter)
goto nowaypoints; // if we can't go the center, why on earth are we doing this?
for (i = 0; i < nummapthings; i++)
TAG_ITER_THINGS(bossid, i)
{
if (!mapthings[i].mobj)
continue;
if (mapthings[i].mobj->type != MT_FANGWAYPOINT)
continue;
if (mapthings[i].extrainfo != extrainfo)
continue;
if (!(mapthings[i].options & MTF_AMBUSH))
if (!(mapthings[i].args[0]))
continue;
P_SetTarget(&actor->tracer, mapthings[i].mobj);
found = true;
break;
}
if (i == nummapthings)
if (!found)
goto nowaypoints;
}
else // locvar1 == 0
@ -11479,7 +11357,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
actor->z += hackoffset;
// first, count how many waypoints we have
for (i = 0; i < nummapthings; i++)
TAG_ITER_THINGS(bossid, i)
{
if (!mapthings[i].mobj)
continue;
@ -11487,9 +11365,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue;
if (actor->tracer == mapthings[i].mobj) // this was your tracer last time
continue;
if (mapthings[i].extrainfo != extrainfo)
continue;
if (mapthings[i].options & MTF_AMBUSH)
if (mapthings[i].args[0])
{
if (avoidcenter)
continue;
@ -11536,7 +11412,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
numfangwaypoints = 0;
// now find them again and add them to the table!
for (i = 0; i < nummapthings; i++)
TAG_ITER_THINGS(bossid, i)
{
if (!mapthings[i].mobj)
continue;
@ -11544,9 +11420,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue;
if (actor->tracer == mapthings[i].mobj) // this was your tracer last time
continue;
if (mapthings[i].extrainfo != extrainfo)
continue;
if (mapthings[i].options & MTF_AMBUSH)
if (mapthings[i].args[0])
{
if (avoidcenter)
continue;
@ -12834,7 +12708,7 @@ void A_SpawnPterabytes(mobj_t *actor)
return;
if (actor->spawnpoint)
amount = actor->spawnpoint->extrainfo + 1;
amount = min(1, actor->spawnpoint->args[0]);
interval = FixedAngle(FRACUNIT*360/amount);
@ -13501,10 +13375,11 @@ void A_MayonakaArrow(mobj_t *actor)
if (LUA_CallAction(A_MAYONAKAARROW, (actor)))
return;
iswarning = actor->spawnpoint->options & MTF_OBJECTSPECIAL; // is our object a warning sign?
iswarning = (actor->spawnpoint->args[0] == TMMA_WARN); // is our object a warning sign?
// "animtimer" is replaced by "extravalue1" here.
actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(PR_DECORATION, 0, (iswarning) ? (TICRATE/2) : TICRATE*3)));
flip = ((actor->spawnpoint->options & 1) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign.
flip = ((actor->spawnpoint->args[0] == TMMA_FLIP) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign.
// special warning behavior:
if (iswarning)
flip = 6;

View file

@ -11,6 +11,7 @@
/// \file p_floor.c
/// \brief Floor animation, elevators
#include "dehacked.h"
#include "doomdef.h"
#include "doomstat.h"
#include "m_random.h"
@ -163,7 +164,7 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus
void T_MoveFloor(floormove_t *movefloor)
{
result_e res = 0;
boolean dontupdate = false;
boolean remove = false;
if (movefloor->delaytimer)
{
@ -179,8 +180,8 @@ void T_MoveFloor(floormove_t *movefloor)
if (movefloor->type == bounceFloor)
{
const fixed_t origspeed = FixedDiv(movefloor->origspeed,(ELEVATORSPEED/2));
const fixed_t fs = abs(movefloor->sector->floorheight - lines[movefloor->texture].frontsector->floorheight);
const fixed_t bs = abs(movefloor->sector->floorheight - lines[movefloor->texture].backsector->floorheight);
const fixed_t fs = abs(movefloor->sector->floorheight - lines[movefloor->sourceline].frontsector->floorheight);
const fixed_t bs = abs(movefloor->sector->floorheight - lines[movefloor->sourceline].backsector->floorheight);
if (fs < bs)
movefloor->speed = FixedDiv(fs,25*FRACUNIT) + FRACUNIT/4;
else
@ -191,113 +192,62 @@ void T_MoveFloor(floormove_t *movefloor)
if (res == pastdest)
{
if (movefloor->direction == 1)
switch (movefloor->type)
{
switch (movefloor->type)
{
case moveFloorByFrontSector:
if (movefloor->texture < -1) // chained linedef executing
P_LinedefExecute((INT16)(movefloor->texture + INT16_MAX + 2), NULL, NULL);
/* FALLTHRU */
case instantMoveFloorByFrontSector:
if (movefloor->texture > -1) // flat changing
movefloor->sector->floorpic = movefloor->texture;
break;
case bounceFloor: // Graue 03-12-2004
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
else
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
movefloor->sector->floorspeed = movefloor->speed * movefloor->direction;
movefloor->delaytimer = movefloor->delay;
P_RecalcPrecipInSector(movefloor->sector);
return; // not break, why did this work? Graue 04-03-2004
case bounceFloorCrush: // Graue 03-27-2004
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
{
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dy),4*FRACUNIT); // return trip, use dy
}
else
{
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dx),4*FRACUNIT); // forward again, use dx
}
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
movefloor->sector->floorspeed = movefloor->speed * movefloor->direction;
movefloor->delaytimer = movefloor->delay;
P_RecalcPrecipInSector(movefloor->sector);
return; // not break, why did this work? Graue 04-03-2004
case crushFloorOnce:
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
case moveFloorByFrontSector:
if (movefloor->tag) // chained linedef executing
P_LinedefExecute(movefloor->tag, NULL, NULL);
/* FALLTHRU */
case instantMoveFloorByFrontSector:
if (movefloor->texture > -1) // flat changing
movefloor->sector->floorpic = movefloor->texture;
remove = true;
break;
case bounceFloor: // Graue 03-12-2004
case bounceFloorCrush: // Graue 03-27-2004
if (movefloor->floordestheight == lines[movefloor->sourceline].frontsector->floorheight)
{
movefloor->floordestheight = lines[movefloor->sourceline].backsector->floorheight;
movefloor->origspeed = lines[movefloor->sourceline].args[3] << (FRACBITS - 2); // return trip, use args[3]
}
else
{
movefloor->floordestheight = lines[movefloor->sourceline].frontsector->floorheight;
movefloor->origspeed = lines[movefloor->sourceline].args[2] << (FRACBITS - 2); // forward again, use args[2]
}
if (movefloor->type == bounceFloorCrush)
movefloor->speed = movefloor->origspeed;
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
movefloor->delaytimer = movefloor->delay;
remove = false;
break;
case crushFloorOnce:
if (movefloor->direction == 1)
{
movefloor->floordestheight = lines[movefloor->sourceline].frontsector->floorheight;
movefloor->direction = -1;
movefloor->speed = lines[movefloor->sourceline].args[3] << (FRACBITS - 2);
movefloor->sector->soundorg.z = movefloor->sector->floorheight;
S_StartSound(&movefloor->sector->soundorg,sfx_pstop);
P_RecalcPrecipInSector(movefloor->sector);
return;
default:
break;
}
}
else if (movefloor->direction == -1)
{
switch (movefloor->type)
{
case moveFloorByFrontSector:
if (movefloor->texture < -1) // chained linedef executing
P_LinedefExecute((INT16)(movefloor->texture + INT16_MAX + 2), NULL, NULL);
/* FALLTHRU */
case instantMoveFloorByFrontSector:
if (movefloor->texture > -1) // flat changing
movefloor->sector->floorpic = movefloor->texture;
break;
case bounceFloor: // Graue 03-12-2004
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
else
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
movefloor->sector->floorspeed = movefloor->speed * movefloor->direction;
movefloor->delaytimer = movefloor->delay;
P_RecalcPrecipInSector(movefloor->sector);
return; // not break, why did this work? Graue 04-03-2004
case bounceFloorCrush: // Graue 03-27-2004
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
{
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dy),4*FRACUNIT); // return trip, use dy
}
else
{
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dx),4*FRACUNIT); // forward again, use dx
}
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
movefloor->sector->floorspeed = movefloor->speed * movefloor->direction;
movefloor->delaytimer = movefloor->delay;
P_RecalcPrecipInSector(movefloor->sector);
return; // not break, why did this work? Graue 04-03-2004
case crushFloorOnce:
movefloor->sector->floordata = NULL; // Clear up the thinker so others can use it
P_RemoveThinker(&movefloor->thinker);
movefloor->sector->floorspeed = 0;
P_RecalcPrecipInSector(movefloor->sector);
return;
default:
break;
}
S_StartSound(&movefloor->sector->soundorg, sfx_pstop);
remove = false;
}
else
remove = true;
break;
default:
remove = true;
break;
}
}
if (remove)
{
movefloor->sector->floordata = NULL; // Clear up the thinker so others can use it
movefloor->sector->floorspeed = 0;
P_RemoveThinker(&movefloor->thinker);
dontupdate = true;
}
if (!dontupdate)
movefloor->sector->floorspeed = movefloor->speed*movefloor->direction;
else
movefloor->sector->floorspeed = 0;
movefloor->sector->floorspeed = movefloor->speed*movefloor->direction;
P_RecalcPrecipInSector(movefloor->sector);
}
@ -604,7 +554,7 @@ static fixed_t P_SectorCheckWater(sector_t *analyzesector,
for (rover = analyzesector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_SOLID)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_SOLID)
continue;
// If the sector is below the water, don't bother.
@ -637,7 +587,6 @@ void T_BounceCheese(bouncecheese_t *bouncer)
sector_t *actionsector;
boolean remove;
INT32 i;
mtag_t tag = Tag_FGet(&bouncer->sourceline->tags);
if (bouncer->sector->crumblestate == CRUMBLE_RESTORE || bouncer->sector->crumblestate == CRUMBLE_WAIT
|| bouncer->sector->crumblestate == CRUMBLE_ACTIVATED) // Oops! Crumbler says to remove yourself!
@ -652,7 +601,7 @@ void T_BounceCheese(bouncecheese_t *bouncer)
}
// You can use multiple target sectors, but at your own risk!!!
TAG_ITER_SECTORS(tag, i)
TAG_ITER_SECTORS(bouncer->sourceline->args[0], i)
{
actionsector = &sectors[i];
actionsector->moved = true;
@ -776,7 +725,7 @@ void T_StartCrumble(crumble_t *crumble)
ffloor_t *rover;
sector_t *sector;
INT32 i;
mtag_t tag = Tag_FGet(&crumble->sourceline->tags);
mtag_t tag = crumble->sourceline->args[0];
// Once done, the no-return thinker just sits there,
// constantly 'returning'... kind of an oxymoron, isn't it?
@ -811,10 +760,10 @@ void T_StartCrumble(crumble_t *crumble)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_CRUMBLE))
if (!(rover->fofflags & FOF_CRUMBLE))
continue;
if (!(rover->flags & FF_FLOATBOB))
if (!(rover->fofflags & FOF_FLOATBOB))
continue;
if (rover->master != crumble->sourceline)
@ -823,7 +772,7 @@ void T_StartCrumble(crumble_t *crumble)
rover->alpha = crumble->origalpha;
if (rover->alpha == 0xff)
rover->flags &= ~FF_TRANSLUCENT;
rover->fofflags &= ~FOF_TRANSLUCENT;
}
}
@ -847,13 +796,13 @@ void T_StartCrumble(crumble_t *crumble)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (rover->flags & FF_NORETURN)
if (rover->fofflags & FOF_NORETURN)
continue;
if (!(rover->flags & FF_CRUMBLE))
if (!(rover->fofflags & FOF_CRUMBLE))
continue;
if (!(rover->flags & FF_FLOATBOB))
if (!(rover->fofflags & FOF_FLOATBOB))
continue;
if (rover->master != crumble->sourceline)
@ -861,7 +810,7 @@ void T_StartCrumble(crumble_t *crumble)
if (rover->alpha == crumble->origalpha)
{
rover->flags |= FF_TRANSLUCENT;
rover->fofflags |= FOF_TRANSLUCENT;
rover->alpha = 0x00;
}
else
@ -869,7 +818,7 @@ void T_StartCrumble(crumble_t *crumble)
rover->alpha = crumble->origalpha;
if (rover->alpha == 0xff)
rover->flags &= ~FF_TRANSLUCENT;
rover->fofflags &= ~FOF_TRANSLUCENT;
}
}
}
@ -1099,23 +1048,6 @@ void T_MarioBlockChecker(mariocheck_t *block)
}
}
static boolean P_IsPlayerValid(size_t playernum)
{
if (!playeringame[playernum])
return false;
if (!players[playernum].mo)
return false;
if (players[playernum].mo->health <= 0)
return false;
if (players[playernum].spectator)
return false;
return true;
}
// This is the Thwomp's 'brain'. It looks around for players nearby, and if
// it finds any, **SMASH**!!! Muahahhaa....
void T_ThwompSector(thwomp_t *thwomp)
@ -1126,14 +1058,18 @@ void T_ThwompSector(thwomp_t *thwomp)
INT32 secnum;
fixed_t speed;
if (thwompsactive == false)
{
// Ring Racers: Rest until Lap 2
return;
}
// SRB2kart 170217 - Thwomps are automatic.
// Put up a timer before you start falling down.
// I could of used rowoffset, but the FOF actually
// modifies the textures's Y offset. It doesn't with
// textureoffset, so Effect 4 can be ignored as usual.
if (thwomp->sourceline->flags & ML_EFFECT1
&& leveltime < (unsigned)(sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS))
thwomp->direction = 0;
if (--thwomp->initDelay > 0)
{
return;
}
// If you just crashed down, wait a second before coming back up.
if (--thwomp->delay > 0)
@ -1235,7 +1171,7 @@ void T_ThwompSector(thwomp_t *thwomp)
if (res == pastdest)
{
if (rover->flags & FF_EXISTS)
if (rover->fofflags & FOF_EXISTS)
S_StartSound((void *)&actionsector->soundorg, thwomp->sound);
thwomp->direction = 1; // start heading back up
@ -1282,7 +1218,7 @@ void T_NoEnemiesSector(noenemies_t *nobaddies)
sector_t *sec = NULL;
INT32 secnum = -1;
boolean FOFsector = false;
mtag_t tag = Tag_FGet(&nobaddies->sourceline->tags);
mtag_t tag = nobaddies->sourceline->args[0];
TAG_ITER_SECTORS(tag, secnum)
{
@ -1294,14 +1230,13 @@ void T_NoEnemiesSector(noenemies_t *nobaddies)
for (i = 0; i < sec->linecount; i++)
{
INT32 targetsecnum = -1;
mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags);
if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300)
continue;
FOFsector = true;
TAG_ITER_SECTORS(tag2, targetsecnum)
TAG_ITER_SECTORS(sec->lines[i]->args[0], targetsecnum)
{
if (T_SectorHasEnemies(&sectors[targetsecnum]))
return;
@ -1319,190 +1254,68 @@ void T_NoEnemiesSector(noenemies_t *nobaddies)
P_RemoveThinker(&nobaddies->thinker);
}
static boolean P_IsMobjTouchingSector(mobj_t *mo, sector_t *sec)
static boolean P_CheckAllTrigger(eachtime_t *eachtime)
{
msecnode_t *node;
size_t i;
if (mo->subsector->sector == sec)
return true;
if (!(sec->flags & SF_TRIGGERSPECIAL_TOUCH))
return false;
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
for (i = 0; i < MAXPLAYERS; i++)
{
if (node->m_sector == sec)
return true;
if (P_CanPlayerTrigger(i) && !eachtime->playersInArea[i])
return false;
}
return false;
return true;
}
//
// T_EachTimeThinker
//
// Runs a linedef exec whenever a player enters an area.
// Keeps track of players currently in the area and notices any changes.
//
// \sa P_AddEachTimeThinker
//
void T_EachTimeThinker(eachtime_t *eachtime)
{
size_t i, j;
sector_t *sec = NULL;
sector_t *targetsec = NULL;
INT32 secnum = -1;
size_t i;
boolean oldPlayersInArea[MAXPLAYERS];
boolean oldPlayersOnArea[MAXPLAYERS];
boolean *oldPlayersArea;
boolean *playersArea;
boolean FOFsector = false;
boolean floortouch = false;
fixed_t bottomheight, topheight;
ffloor_t *rover;
mtag_t tag = Tag_FGet(&eachtime->sourceline->tags);
sector_t *caller[MAXPLAYERS];
boolean allPlayersChecked = false;
boolean allPlayersTrigger = false;
for (i = 0; i < MAXPLAYERS; i++)
{
oldPlayersInArea[i] = eachtime->playersInArea[i];
oldPlayersOnArea[i] = eachtime->playersOnArea[i];
eachtime->playersInArea[i] = false;
eachtime->playersOnArea[i] = false;
}
TAG_ITER_SECTORS(tag, secnum)
{
sec = &sectors[secnum];
FOFsector = false;
if (GETSECSPECIAL(sec->special, 2) == 3 || GETSECSPECIAL(sec->special, 2) == 5)
floortouch = true;
else if (GETSECSPECIAL(sec->special, 2) >= 1 && GETSECSPECIAL(sec->special, 2) <= 8)
floortouch = false;
else
continue;
// Check the lines of this sector, to see if it is a FOF control sector.
for (i = 0; i < sec->linecount; i++)
{
INT32 targetsecnum = -1;
mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags);
if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300)
continue;
FOFsector = true;
TAG_ITER_SECTORS(tag2, targetsecnum)
{
targetsec = &sectors[targetsecnum];
// Find the FOF corresponding to the control linedef
for (rover = targetsec->ffloors; rover; rover = rover->next)
{
if (rover->master == sec->lines[i])
break;
}
if (!rover) // This should be impossible, but don't complain if it is the case somehow
continue;
if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there
continue;
for (j = 0; j < MAXPLAYERS; j++)
{
if (!P_IsPlayerValid(j))
continue;
if (!P_IsMobjTouchingSector(players[j].mo, targetsec))
continue;
topheight = P_GetSpecialTopZ(players[j].mo, sec, targetsec);
bottomheight = P_GetSpecialBottomZ(players[j].mo, sec, targetsec);
if (players[j].mo->z > topheight)
continue;
if (players[j].mo->z + players[j].mo->height < bottomheight)
continue;
if (floortouch && P_IsObjectOnGroundIn(players[j].mo, targetsec))
eachtime->playersOnArea[j] = true;
else
eachtime->playersInArea[j] = true;
}
}
}
if (!FOFsector)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!P_IsPlayerValid(i))
continue;
if (!P_IsMobjTouchingSector(players[i].mo, sec))
continue;
if (!(players[i].mo->subsector->sector == sec
|| P_MobjTouchingSectorSpecial(players[i].mo, 2, (GETSECSPECIAL(sec->special, 2)), false) == sec))
continue;
if (floortouch && P_IsObjectOnRealGround(players[i].mo, sec))
eachtime->playersOnArea[i] = true;
else
eachtime->playersInArea[i] = true;
}
}
}
// Check if a new player entered.
// If not, check if a player hit the floor.
// If either condition is true, execute.
if (floortouch)
{
playersArea = eachtime->playersOnArea;
oldPlayersArea = oldPlayersOnArea;
}
else
{
playersArea = eachtime->playersInArea;
oldPlayersArea = oldPlayersInArea;
caller[i] = P_CanPlayerTrigger(i) ? P_FindPlayerTrigger(&players[i], eachtime->sourceline) : NULL;
eachtime->playersInArea[i] = caller[i] != NULL;
}
// Easy check... nothing has changed
if (!memcmp(playersArea, oldPlayersArea, sizeof(boolean)*MAXPLAYERS))
if (!memcmp(eachtime->playersInArea, oldPlayersInArea, sizeof(boolean)*MAXPLAYERS))
return;
// If sector has an "all players" trigger type, all players need to be in area
if (GETSECSPECIAL(sec->special, 2) == 2 || GETSECSPECIAL(sec->special, 2) == 3)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (P_IsPlayerValid(i) && !playersArea[i])
return;
}
}
// Trigger for every player who has entered (and exited, if triggerOnExit)
for (i = 0; i < MAXPLAYERS; i++)
{
if (playersArea[i] == oldPlayersArea[i])
if (eachtime->playersInArea[i] == oldPlayersInArea[i])
continue;
// If player has just left, check if still valid
if (!playersArea[i] && (!eachtime->triggerOnExit || !P_IsPlayerValid(i)))
if (!eachtime->playersInArea[i] && (!eachtime->triggerOnExit || !P_CanPlayerTrigger(i)))
continue;
CONS_Debug(DBG_GAMELOGIC, "Trying to activate each time executor with tag %d\n", tag);
// If sector has an "all players" trigger type, all players need to be in area
if (caller[i] && caller[i]->triggerer == TO_ALLPLAYERS)
{
if (!allPlayersChecked)
{
allPlayersChecked = true;
allPlayersTrigger = P_CheckAllTrigger(eachtime);
}
if (!allPlayersTrigger)
continue;
}
CONS_Debug(DBG_GAMELOGIC, "Trying to activate each time executor with tag %d\n", Tag_FGet(&eachtime->sourceline->tags));
// 03/08/14 -Monster Iestyn
// No more stupid hacks involving changing eachtime->sourceline's tag or special or whatever!
// This should now run ONLY the stuff for eachtime->sourceline itself, instead of all trigger linedefs sharing the same tag.
// Makes much more sense doing it this way, honestly.
P_RunTriggerLinedef(eachtime->sourceline, players[i].mo, sec);
P_RunTriggerLinedef(eachtime->sourceline, players[i].mo, caller[i]);
if (!eachtime->sourceline->special) // this happens only for "Trigger on X calls" linedefs
P_RemoveThinker(&eachtime->thinker);
@ -1747,13 +1560,12 @@ void T_PlaneDisplace(planedisplace_t *pd)
// (egg capsule button), P_PlayerInSpecialSector (buttons),
// and P_SpawnSpecials (continuous floor movers and instant lower).
//
void EV_DoFloor(line_t *line, floor_e floortype)
void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
{
INT32 firstone = 1;
INT32 secnum = -1;
sector_t *sec;
floormove_t *dofloor;
mtag_t tag = Tag_FGet(&line->tags);
TAG_ITER_SECTORS(tag, secnum)
{
@ -1774,34 +1586,25 @@ void EV_DoFloor(line_t *line, floor_e floortype)
dofloor->type = floortype;
dofloor->crush = false; // default: types that crush will change this
dofloor->sector = sec;
dofloor->sourceline = (INT32)(line - lines);
switch (floortype)
{
// Lowers a floor to the lowest surrounding floor.
case lowerFloorToLowest:
dofloor->direction = -1; // down
dofloor->speed = FLOORSPEED*2; // 2 fracunits per tic
dofloor->floordestheight = P_FindLowestFloorSurrounding(sec);
break;
// Used for part of the Egg Capsule, when an FOF with type 666 is
// contacted by the player.
// Used to open the top of an Egg Capsule.
case raiseFloorToNearestFast:
dofloor->direction = -1; // down
dofloor->speed = FLOORSPEED*4; // 4 fracunits per tic
dofloor->floordestheight = P_FindNextHighestFloor(sec, sec->floorheight);
break;
// Used for sectors tagged to 50 linedefs (effectively
// changing the base height for placing things in that sector).
// Instantly lower floor to surrounding sectors.
// Used as a hack in the binary map format to allow thing heights above 4096.
case instantLower:
dofloor->direction = -1; // down
dofloor->speed = INT32_MAX/2; // "instant" means "takes one tic"
dofloor->floordestheight = P_FindLowestFloorSurrounding(sec);
break;
// Linedef executor command, linetype 101.
// Front sector floor = destination height.
case instantMoveFloorByFrontSector:
dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic
dofloor->floordestheight = line->frontsector->floorheight;
@ -1811,22 +1614,12 @@ void EV_DoFloor(line_t *line, floor_e floortype)
else
dofloor->direction = -1; // down
// New for 1.09: now you can use the no climb flag to
// DISABLE the flat changing. This makes it work
// totally opposite the way linetype 106 does. Yet
// another reason I'll be glad to break backwards
// compatibility for the final.
if (line->flags & ML_NOCLIMB)
dofloor->texture = -1; // don't mess with the floorpic
else
dofloor->texture = line->frontsector->floorpic;
// If flag is set, change floor texture after moving
dofloor->texture = line->args[2] ? line->frontsector->floorpic : -1;
break;
// Linedef executor command, linetype 106.
// Line length = speed, front sector floor = destination height.
case moveFloorByFrontSector:
dofloor->speed = P_AproxDistance(line->dx, line->dy);
dofloor->speed = FixedDiv(dofloor->speed,8*FRACUNIT);
dofloor->speed = line->args[2] << (FRACBITS - 3);
dofloor->floordestheight = line->frontsector->floorheight;
if (dofloor->floordestheight >= sec->floorheight)
@ -1835,85 +1628,31 @@ void EV_DoFloor(line_t *line, floor_e floortype)
dofloor->direction = -1; // down
// chained linedef executing ability
if (line->flags & ML_BLOCKPLAYERS)
{
// Only set it on one of the moving sectors (the
// smallest numbered) and only if the front side
// x offset is positive, indicating a valid tag.
if (firstone && sides[line->sidenum[0]].textureoffset > 0)
dofloor->texture = (sides[line->sidenum[0]].textureoffset>>FRACBITS) - 32769;
else
dofloor->texture = -1;
}
// Only set it on one of the moving sectors (the smallest numbered)
if (line->args[3])
dofloor->tag = firstone ? (INT16)line->args[3] : -1;
// flat changing ability
else if (line->flags & ML_NOCLIMB)
dofloor->texture = line->frontsector->floorpic;
else
dofloor->texture = -1; // nothing special to do after movement completes
dofloor->texture = line->args[4] ? line->frontsector->floorpic : -1;
break;
case moveFloorByFrontTexture:
if (line->flags & ML_NOCLIMB)
case moveFloorByDistance:
if (line->args[4])
dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic
else
dofloor->speed = FixedDiv(sides[line->sidenum[0]].textureoffset,8*FRACUNIT); // texture x offset
dofloor->floordestheight = sec->floorheight + sides[line->sidenum[0]].rowoffset; // texture y offset
dofloor->speed = line->args[3] << (FRACBITS - 3);
dofloor->floordestheight = sec->floorheight + (line->args[2] << FRACBITS);
if (dofloor->floordestheight > sec->floorheight)
dofloor->direction = 1; // up
else
dofloor->direction = -1; // down
break;
/*
// Linedef executor command, linetype 108.
// dx = speed, dy = amount to lower.
case lowerFloorByLine:
dofloor->direction = -1; // down
dofloor->speed = FixedDiv(abs(line->dx),8*FRACUNIT);
dofloor->floordestheight = sec->floorheight - abs(line->dy);
if (dofloor->floordestheight > sec->floorheight) // wrapped around
I_Error("Can't lower sector %d\n", secnum);
break;
// Linedef executor command, linetype 109.
// dx = speed, dy = amount to raise.
case raiseFloorByLine:
dofloor->direction = 1; // up
dofloor->speed = FixedDiv(abs(line->dx),8*FRACUNIT);
dofloor->floordestheight = sec->floorheight + abs(line->dy);
if (dofloor->floordestheight < sec->floorheight) // wrapped around
I_Error("Can't raise sector %d\n", secnum);
break;
*/
// Linetypes 2/3.
// Move floor up and down indefinitely like the old elevators.
// Move floor up and down indefinitely.
// bounceFloor has slowdown at the top and bottom of movement.
case bounceFloor:
dofloor->speed = P_AproxDistance(line->dx, line->dy); // same speed as elevateContinuous
dofloor->speed = FixedDiv(dofloor->speed,4*FRACUNIT);
dofloor->origspeed = dofloor->speed; // it gets slowed down at the top and bottom
dofloor->floordestheight = line->frontsector->floorheight;
if (dofloor->floordestheight >= sec->floorheight)
dofloor->direction = 1; // up
else
dofloor->direction = -1; // down
// Any delay?
dofloor->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
dofloor->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
dofloor->texture = (fixed_t)(line - lines); // hack: store source line number
break;
// Linetypes 6/7.
// Like 2/3, but no slowdown at the top and bottom of movement,
// and the speed is line->dx the first way, line->dy for the
// return trip. Good for crushers.
case bounceFloorCrush:
dofloor->speed = FixedDiv(abs(line->dx),4*FRACUNIT);
dofloor->speed = line->args[2] << (FRACBITS - 2); // same speed as elevateContinuous
dofloor->origspeed = dofloor->speed;
dofloor->floordestheight = line->frontsector->floorheight;
@ -1923,27 +1662,18 @@ void EV_DoFloor(line_t *line, floor_e floortype)
dofloor->direction = -1; // down
// Any delay?
dofloor->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
dofloor->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
dofloor->texture = (fixed_t)(line - lines); // hack: store source line number
dofloor->delay = line->args[5];
dofloor->delaytimer = line->args[4]; // Initial delay
break;
case crushFloorOnce:
dofloor->speed = FixedDiv(abs(line->dx),4*FRACUNIT);
dofloor->origspeed = dofloor->speed;
dofloor->speed = dofloor->origspeed = line->args[2] << (FRACBITS - 2);
dofloor->floordestheight = line->frontsector->ceilingheight;
if (dofloor->floordestheight >= sec->floorheight)
dofloor->direction = 1; // up
else
dofloor->direction = -1; // down
// Any delay?
dofloor->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
dofloor->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS;
dofloor->texture = (fixed_t)(line - lines); // hack: store source line number
break;
default:
@ -1967,14 +1697,13 @@ void EV_DoFloor(line_t *line, floor_e floortype)
//
// jff 2/22/98 new type to move floor and ceiling in parallel
//
void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype)
{
INT32 secnum = -1;
sector_t *sec;
elevator_t *elevator;
mtag_t tag = Tag_FGet(&line->tags);
// act on all sectors with the same tag as the triggering linedef
// act on all sectors with the given tag
TAG_ITER_SECTORS(tag, secnum)
{
sec = &sectors[secnum];
@ -1992,6 +1721,7 @@ void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
elevator->type = elevtype;
elevator->sourceline = line;
elevator->distance = 1; // Always crush unless otherwise
elevator->sector = sec;
// set up the fields according to the type of elevator action
switch (elevtype)
@ -1999,92 +1729,58 @@ void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
// elevator down to next floor
case elevateDown:
elevator->direction = -1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/2; // half speed
elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
break;
// elevator up to next floor
case elevateUp:
elevator->direction = 1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/4; // quarter speed
elevator->floordestheight = P_FindNextHighestFloor(sec, sec->floorheight);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
break;
// elevator up to highest floor
case elevateHighest:
elevator->direction = 1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED/4; // quarter speed
elevator->floordestheight = P_FindHighestFloorSurrounding(sec);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
break;
// elevator to floor height of activating switch's front sector
case elevateCurrent:
elevator->sector = sec;
elevator->speed = ELEVATORSPEED;
elevator->floordestheight = line->frontsector->floorheight;
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
elevator->direction = elevator->floordestheight > sec->floorheight? 1 : -1;
break;
case elevateContinuous:
if (customspeed)
{
elevator->origspeed = P_AproxDistance(line->dx, line->dy);
elevator->origspeed = FixedDiv(elevator->origspeed,4*FRACUNIT);
elevator->speed = elevator->origspeed;
}
else
{
elevator->speed = ELEVATORSPEED/2;
elevator->origspeed = elevator->speed;
}
elevator->origspeed = line->args[1] << (FRACBITS - 2);
elevator->speed = elevator->origspeed;
elevator->sector = sec;
elevator->low = !(line->flags & ML_NOCLIMB); // go down first unless noclimb is on
elevator->low = !line->args[4]; // go down first unless args[4] is set
if (elevator->low)
{
elevator->direction = 1;
elevator->floordestheight = P_FindNextHighestFloor(sec, sec->floorheight);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
}
else
{
elevator->direction = -1;
elevator->floordestheight = P_FindNextLowestFloor(sec,sec->floorheight);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
}
elevator->floorwasheight = elevator->sector->floorheight;
elevator->ceilingwasheight = elevator->sector->ceilingheight;
elevator->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
elevator->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
elevator->delay = line->args[3];
elevator->delaytimer = line->args[2]; // Initial delay
break;
case bridgeFall:
elevator->direction = -1;
elevator->sector = sec;
elevator->speed = ELEVATORSPEED*4; // quadruple speed
elevator->floordestheight = P_FindNextLowestFloor(sec, sec->floorheight);
elevator->ceilingdestheight = elevator->floordestheight
+ sec->ceilingheight - sec->floorheight;
break;
default:
break;
}
elevator->ceilingdestheight = elevator->floordestheight + sec->ceilingheight - sec->floorheight;
// interpolation
R_CreateInterpolator_SectorPlane(&elevator->thinker, sec, false);
R_CreateInterpolator_SectorPlane(&elevator->thinker, sec, true);
@ -2097,7 +1793,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
fixed_t leftx, rightx, topy, bottomy, topz, bottomz, widthfactor, heightfactor, a, b, c, spacing;
mobjtype_t type;
tic_t lifetime;
INT16 flags;
boolean fromcenter;
sector_t *controlsec = rover->master->frontsector;
mtag_t tag = Tag_FGet(&controlsec->tags);
@ -2127,25 +1823,20 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
spacing = (32<<FRACBITS);
type = MT_ROCKCRUMBLE1;
lifetime = 3*TICRATE;
flags = 0;
fromcenter = false;
if (tag != 0)
{
INT32 tagline = Tag_FindLineSpecial(14, tag);
if (tagline != -1)
{
if (sides[lines[tagline].sidenum[0]].toptexture)
type = (mobjtype_t)sides[lines[tagline].sidenum[0]].toptexture; // Set as object type in p_setup.c...
if (sides[lines[tagline].sidenum[0]].textureoffset)
spacing = sides[lines[tagline].sidenum[0]].textureoffset;
if (sides[lines[tagline].sidenum[0]].rowoffset)
{
if (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS != -1)
lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS);
else
lifetime = 0;
}
flags = lines[tagline].flags;
if (lines[tagline].stringargs[0])
type = get_number(lines[tagline].stringargs[0]);
if (lines[tagline].args[0])
spacing = lines[tagline].args[0] << FRACBITS;
if (lines[tagline].args[1])
lifetime = (lines[tagline].args[1] != -1) ? lines[tagline].args[1] : 0;
fromcenter = !!lines[tagline].args[2];
}
}
@ -2180,7 +1871,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
topz = *rover->topheight-(spacing>>1);
bottomz = *rover->bottomheight;
if (flags & ML_EFFECT1)
if (fromcenter)
{
widthfactor = (rightx + topy - leftx - bottomy)>>3;
heightfactor = (topz - *rover->bottomheight)>>2;
@ -2204,7 +1895,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
spawned = P_SpawnMobj(a, b, c, type);
spawned->angle += P_RandomKey(PR_TERRAIN, 36)*ANG10; // irrelevant for default objects but might make sense for some custom ones
if (flags & ML_EFFECT1)
if (fromcenter)
{
P_InstaThrust(spawned, R_PointToAngle2(sec->soundorg.x, sec->soundorg.y, a, b), FixedDiv(P_AproxDistance(a - sec->soundorg.x, b - sec->soundorg.y), widthfactor));
P_SetObjectMomZ(spawned, FixedDiv((c - bottomz), heightfactor), false);
@ -2217,7 +1908,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
}
// no longer exists (can't collide with again)
rover->flags &= ~FF_EXISTS;
rover->fofflags &= ~FOF_EXISTS;
rover->master->frontsector->moved = true;
P_RecalcPrecipInSector(sec);
}
@ -2284,7 +1975,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
crumble_t *crumble;
sector_t *foundsec;
INT32 i;
mtag_t tag = Tag_FGet(&rover->master->tags);
mtag_t tag = rover->master->args[0];
// If floor is already activated, skip it
if (sec->floordata)
@ -2355,8 +2046,8 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
if (roversec->floordata || roversec->ceilingdata)
return;
if (!(rover->flags & FF_SOLID))
rover->flags |= (FF_SOLID|FF_RENDERALL|FF_CUTLEVEL);
if (!(rover->fofflags & FOF_SOLID))
rover->fofflags |= (FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL);
// Find an item to pop out!
thing = SearchMarioNode(roversec->touching_thinglist);
@ -2380,7 +2071,7 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
block->direction = 1;
block->floorstartheight = block->sector->floorheight;
block->ceilingstartheight = block->sector->ceilingheight;
block->tag = (INT16)Tag_FGet(&sector->tags);
block->tag = (INT16)rover->master->args[0];
// interpolation
R_CreateInterpolator_SectorPlane(&block->thinker, roversec, false);

View file

@ -516,7 +516,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return;
case MT_STARPOST:
P_TouchStarPost(special, player, special->spawnpoint && (special->spawnpoint->options & MTF_OBJECTSPECIAL));
P_TouchStarPost(special, player, special->spawnpoint && special->spawnpoint->args[1]);
return;
case MT_BIGTUMBLEWEED:

View file

@ -30,7 +30,7 @@ void P_RemoveLighting(sector_t *sector)
// The thinker is the first member in all the lighting action structs,
// so just let the thinker get freed, and that will free the whole
// structure.
P_RemoveThinker(&((elevator_t *)sector->lightingdata)->thinker);
P_RemoveThinker(&((thinkerdata_t *)sector->lightingdata)->thinker);
sector->lightingdata = NULL;
}
}
@ -54,43 +54,36 @@ void T_FireFlicker(fireflicker_t *flick)
amount = (INT16)((UINT8)(P_RandomByte(PR_UNDEFINED) & 3) * 16);
if (flick->sector->lightlevel - amount < flick->minlight)
flick->sector->lightlevel = (INT16)flick->minlight;
flick->sector->lightlevel = flick->minlight;
else
flick->sector->lightlevel = (INT16)((INT16)flick->maxlight - amount);
flick->sector->lightlevel = flick->maxlight - amount;
flick->count = flick->resetcount;
}
/** Spawns an adjustable fire flicker effect in a sector.
*
* \param minsector Sector whose light level is used as the darkest.
* \param maxsector Sector whose light level is used as the brightest,
* and also the target sector for the effect.
* \param sector Target sector for the effect.
* \param lighta One of the two light levels to move between.
* \param lightb The other light level.
* \param length Four times the number of tics between flickers.
* \sa T_FireFlicker
*/
fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxsector, INT32 length)
fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *sector, INT16 lighta, INT16 lightb, INT32 length)
{
fireflicker_t *flick;
P_RemoveLighting(maxsector); // out with the old, in with the new
P_RemoveLighting(sector); // out with the old, in with the new
flick = Z_Calloc(sizeof (*flick), PU_LEVSPEC, NULL);
P_AddThinker(THINK_MAIN, &flick->thinker);
flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker;
flick->sector = maxsector;
flick->maxlight = maxsector->lightlevel;
flick->minlight = minsector->lightlevel;
if (flick->minlight > flick->maxlight)
{
// You mixed them up, you dummy.
INT32 oops = flick->minlight;
flick->minlight = flick->maxlight;
flick->maxlight = oops;
}
flick->sector = sector;
flick->maxlight = max(lighta, lightb);
flick->minlight = min(lighta, lightb);
flick->count = flick->resetcount = length/4;
maxsector->lightingdata = flick;
sector->lightingdata = flick;
// input bounds checking and stuff
if (!flick->resetcount)
@ -103,6 +96,9 @@ fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxse
flick->maxlight++;
}
// Make sure the starting light level is in range.
sector->lightlevel = max(flick->minlight, min(flick->maxlight, sector->lightlevel));
return flick;
}
@ -148,7 +144,7 @@ void P_SpawnLightningFlash(sector_t *sector)
minlight = ((lightflash_t *)sector->lightingdata)->minlight;
}
P_RemoveThinker(&((elevator_t *)sector->lightingdata)->thinker);
P_RemoveThinker(&((thinkerdata_t *)sector->lightingdata)->thinker);
}
sector->lightingdata = NULL;
@ -182,21 +178,21 @@ void T_StrobeFlash(strobe_t *flash)
if (flash->sector->lightlevel == flash->minlight)
{
flash->sector->lightlevel = (INT16)flash->maxlight;
flash->sector->lightlevel = flash->maxlight;
flash->count = flash->brighttime;
}
else
{
flash->sector->lightlevel = (INT16)flash->minlight;
flash->sector->lightlevel = flash->minlight;
flash->count = flash->darktime;
}
}
/** Spawns an adjustable strobe light effect in a sector.
*
* \param minsector Sector whose light level is used as the darkest.
* \param maxsector Sector whose light level is used as the brightest,
* and also the target sector for the effect.
* \param sector Target sector for the effect.
* \param lighta One of the two light levels to move between.
* \param lightb The other light level.
* \param darktime Time in tics for the light to be dark.
* \param brighttime Time in tics for the light to be bright.
* \param inSync If true, the effect will be kept in sync
@ -207,29 +203,21 @@ void T_StrobeFlash(strobe_t *flash)
* the strobe flash is random.
* \sa T_StrobeFlash
*/
strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector, INT32 darktime, INT32 brighttime, boolean inSync)
strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *sector, INT16 lighta, INT16 lightb, INT32 darktime, INT32 brighttime, boolean inSync)
{
strobe_t *flash;
P_RemoveLighting(maxsector); // out with the old, in with the new
P_RemoveLighting(sector); // out with the old, in with the new
flash = Z_Calloc(sizeof (*flash), PU_LEVSPEC, NULL);
P_AddThinker(THINK_MAIN, &flash->thinker);
flash->sector = maxsector;
flash->sector = sector;
flash->darktime = darktime;
flash->brighttime = brighttime;
flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
flash->maxlight = maxsector->lightlevel;
flash->minlight = minsector->lightlevel;
if (flash->minlight > flash->maxlight)
{
// You mixed them up, you dummy.
INT32 oops = flash->minlight;
flash->minlight = flash->maxlight;
flash->maxlight = oops;
}
flash->maxlight = max(lighta, lightb);
flash->minlight = min(lighta, lightb);
if (flash->minlight == flash->maxlight)
flash->minlight = 0;
@ -239,7 +227,10 @@ strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector,
else
flash->count = 1;
maxsector->lightingdata = flash;
// Make sure the starting light level is in range.
sector->lightlevel = max(flash->minlight, min(flash->maxlight, sector->lightlevel));
sector->lightingdata = flash;
return flash;
}
@ -254,20 +245,20 @@ void T_Glow(glow_t *g)
{
case -1:
// DOWN
g->sector->lightlevel = (INT16)(g->sector->lightlevel - (INT16)g->speed);
g->sector->lightlevel -= g->speed;
if (g->sector->lightlevel <= g->minlight)
{
g->sector->lightlevel = (INT16)(g->sector->lightlevel + (INT16)g->speed);
g->sector->lightlevel += g->speed;
g->direction = 1;
}
break;
case 1:
// UP
g->sector->lightlevel = (INT16)(g->sector->lightlevel + (INT16)g->speed);
g->sector->lightlevel += g->speed;
if (g->sector->lightlevel >= g->maxlight)
{
g->sector->lightlevel = (INT16)(g->sector->lightlevel - (INT16)g->speed);
g->sector->lightlevel -= g->speed;
g->direction = -1;
}
break;
@ -276,34 +267,27 @@ void T_Glow(glow_t *g)
/** Spawns an adjustable glowing light effect in a sector.
*
* \param minsector Sector whose light level is used as the darkest.
* \param maxsector Sector whose light level is used as the brightest,
* and also the target sector for the effect.
* \param sector Target sector for the effect.
* \param lighta One of the two light levels to move between.
* \param lightb The other light level.
* \param length The speed of the effect.
* \sa T_Glow
*/
glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector, INT32 length)
glow_t *P_SpawnAdjustableGlowingLight(sector_t *sector, INT16 lighta, INT16 lightb, INT32 length)
{
glow_t *g;
P_RemoveLighting(maxsector); // out with the old, in with the new
P_RemoveLighting(sector); // out with the old, in with the new
g = Z_Calloc(sizeof (*g), PU_LEVSPEC, NULL);
P_AddThinker(THINK_MAIN, &g->thinker);
g->sector = maxsector;
g->minlight = minsector->lightlevel;
g->maxlight = maxsector->lightlevel;
if (g->minlight > g->maxlight)
{
// You mixed them up, you dummy.
INT32 oops = g->minlight;
g->minlight = g->maxlight;
g->maxlight = oops;
}
g->sector = sector;
g->minlight = min(lighta, lightb);
g->maxlight = max(lighta, lightb);
g->thinker.function.acp1 = (actionf_p1)T_Glow;
g->direction = 1;
g->speed = length/4;
g->speed = (INT16)(length/4);
if (g->speed > (g->maxlight - g->minlight)/2) // don't make it ridiculous speed
g->speed = (g->maxlight - g->minlight)/2;
@ -317,7 +301,10 @@ glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector,
g->speed = (g->maxlight - g->minlight)/2;
}
maxsector->lightingdata = g;
// Make sure the starting light level is in range.
sector->lightlevel = max(g->minlight, min(g->maxlight, sector->lightlevel));
sector->lightingdata = g;
return g;
}
@ -371,9 +358,10 @@ void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean
}
}
void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force)
void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force, boolean relative)
{
INT32 i;
INT32 realdestvalue;
// search all sectors for ones with tag
TAG_ITER_SECTORS(tag, i)
@ -386,7 +374,9 @@ void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, bool
CONS_Debug(DBG_GAMELOGIC, "Line type 420 Executor: Fade light thinker already exists, timer: %d\n", ((lightlevel_t*)sectors[i].lightingdata)->timer);
continue;
}
P_FadeLightBySector(&sectors[i], destvalue, speed, ticbased);
realdestvalue = relative ? max(0, min(255, sectors[i].lightlevel + destvalue)) : destvalue;
P_FadeLightBySector(&sectors[i], realdestvalue, speed, ticbased);
}
}

View file

@ -371,7 +371,7 @@ void P_NewChaseDir(mobj_t *actor);
boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed_t dist);
mobj_t *P_InternalFlickySpawn(mobj_t *actor, mobjtype_t flickytype, fixed_t momz, boolean lookforplayers, SINT8 moveforward);
void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo);
void P_InternalFlickySetColor(mobj_t *actor, UINT8 color);
#define P_IsFlickyCenter(type) (type > MT_FLICKY_01 && type < MT_SEED && (type - MT_FLICKY_01) % 2 ? 1 : 0)
void P_InternalFlickyBubble(mobj_t *actor);
void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez);
@ -414,7 +414,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam);
boolean P_CheckMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
fixed_t P_BaseStepUp(void);
fixed_t P_GetThingStepUp(mobj_t *thing);
fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY);
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
boolean P_Move(mobj_t *actor, fixed_t speed);
boolean P_SetOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);

View file

@ -481,7 +481,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
switch (spring->type)
{
case MT_FAN: // fan
if (zdist > (spring->health << FRACBITS)) // max z distance determined by health (set by map thing angle)
if (zdist > (spring->health << FRACBITS)) // max z distance determined by health (set by map thing args[0])
break;
if (flipval*object->momz >= FixedMul(speed, spring->scale)) // if object's already moving faster than your best, don't bother
break;
@ -500,7 +500,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (object->eflags & MFE_SPRUNG)
break;
if (spring->spawnpoint && spring->spawnpoint->options & MTF_OBJECTSPECIAL)
if (spring->spawnpoint && spring->spawnpoint->args[1])
{
if (object->player)
{
@ -1620,17 +1620,34 @@ boolean P_IsLineBlocking(const line_t *ld, const mobj_t *thing)
{
// missiles can cross uncrossable lines
if ((thing->flags & MF_MISSILE))
{
return false;
}
else
{
return
(
(ld->flags & ML_IMPASSABLE) || // block objects from moving through this linedef.
(thing->player && !thing->player->spectator &&
ld->flags & ML_BLOCKPLAYERS) || // SRB2Kart: Only block players, not items
((thing->flags & (MF_ENEMY|MF_BOSS)) && ld->special == 81) // case 81: block monsters only
);
if (thing->player && thing->player->spectator)
{
// Allow spectators thru blocking lines.
return false;
}
if (ld->flags & ML_IMPASSABLE)
{
// block objects from moving through this linedef.
return true;
}
if (thing->player)
{
return (ld->flags & ML_BLOCKPLAYERS);
}
else if (thing->flags & (MF_ENEMY|MF_BOSS))
{
return (ld->flags & ML_BLOCKMONSTERS);
}
}
return false;
}
boolean P_IsLineTripWire(const line_t *ld)
@ -1876,13 +1893,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
if ((rover->fofflags & (FOF_SWIMMABLE|FOF_GOOWATER)) == (FOF_SWIMMABLE|FOF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
{
// If you're inside goowater and slowing down
fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale);
@ -1923,14 +1940,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
if (P_CheckSolidFFloorSurface(thing, rover))
;
else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE))
else if (thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE))
;
else if (!((rover->flags & FF_BLOCKPLAYER && thing->player)
|| (rover->flags & FF_BLOCKOTHERS && !thing->player)
|| rover->flags & FF_QUICKSAND))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && thing->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !thing->player)
|| rover->fofflags & FOF_QUICKSAND))
continue;
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (thing->z < topheight && bottomheight < thingtop)
{
@ -1951,7 +1968,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
+ ((topheight - bottomheight)/2));
if (topheight > tmfloorz && abs(delta1) < abs(delta2)
&& !(rover->flags & FF_REVERSEPLATFORM))
&& !(rover->fofflags & FOF_REVERSEPLATFORM))
{
tmfloorz = tmdropoffz = topheight;
tmfloorrover = rover;
@ -1959,8 +1976,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
tmfloorpic = *rover->toppic;
}
if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
&& !(rover->flags & FF_PLATFORM)
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
&& !(rover->fofflags & FOF_PLATFORM)
&& !(thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE)))
{
tmceilingz = tmdrpoffceilz = bottomheight;
tmceilingrover = rover;
@ -2143,7 +2160,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
mapcampointer = thiscam;
if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12)
if (newsubsec->sector->flags & MSF_NOCLIPCAMERA)
{ // Camera noclip on entire sector.
tmfloorz = tmdropoffz = thiscam->z;
tmceilingz = tmdrpoffceilz = thiscam->z + thiscam->height;
@ -2183,7 +2200,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, x, y, NULL);
@ -2255,7 +2272,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
// We're inside it! Yess...
polysec = po->lines[0]->backsector;
if (GETSECSPECIAL(polysec->special, 4) == 12)
if (polysec->flags & MSF_NOCLIPCAMERA)
{ // Camera noclip polyobj.
plink = (polymaplink_t *)(plink->link.next);
continue;
@ -2495,7 +2512,7 @@ BlockItReturn_t PIT_PushableMoved(mobj_t *thing)
static boolean P_WaterRunning(mobj_t *thing)
{
ffloor_t *rover = thing->floorrover;
return rover && (rover->flags & FF_SWIMMABLE) &&
return rover && (rover->fofflags & FOF_SWIMMABLE) &&
P_IsObjectOnGround(thing);
}
@ -2509,7 +2526,7 @@ fixed_t P_BaseStepUp(void)
return FixedMul(MAXSTEPMOVE, mapobjectscale);
}
fixed_t P_GetThingStepUp(mobj_t *thing)
fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY)
{
const fixed_t maxstepmove = P_BaseStepUp();
fixed_t maxstep = maxstepmove;
@ -2520,12 +2537,14 @@ fixed_t P_GetThingStepUp(mobj_t *thing)
maxstep += maxstepmove;
}
if (P_MobjTouchingSectorSpecial(thing, 1, 13, false))
if (P_MobjTouchingSectorSpecialFlag(thing, SSF_DOUBLESTEPUP)
|| (R_PointInSubsector(destX, destY)->sector->specialflags & SSF_DOUBLESTEPUP))
{
// If using type Section1:13, double the maxstep.
maxstep <<= 1;
}
else if (P_MobjTouchingSectorSpecial(thing, 1, 12, false))
else if (P_MobjTouchingSectorSpecialFlag(thing, SSF_NOSTEPUP)
|| (R_PointInSubsector(destX, destY)->sector->specialflags & SSF_NOSTEPUP))
{
// If using type Section1:12, no maxstep. For short walls, like Egg Zeppelin
maxstep = 0;
@ -2599,7 +2618,7 @@ increment_move
if (!(thing->flags & MF_NOCLIP))
{
//All things are affected by their scale.
fixed_t maxstep = P_GetThingStepUp(thing);
fixed_t maxstep = P_GetThingStepUp(thing, x, y);
if (tmceilingz - tmfloorz < thing->height)
{
@ -2651,7 +2670,8 @@ increment_move
}
}
else if (thing->momz * P_MobjFlip(thing) <= 0 // Step down requires moving down.
&& !(P_MobjTouchingSectorSpecial(thing, 1, 14, false)))
&& !(P_MobjTouchingSectorSpecialFlag(thing, SSF_NOSTEPDOWN)
|| (R_PointInSubsector(x, y)->sector->specialflags & SSF_NOSTEPDOWN)))
{
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
@ -3073,9 +3093,9 @@ static boolean P_ThingHeightClip(mobj_t *thing)
{
rover = (thing->eflags & MFE_VERTICALFLIP) ? oldceilingrover : oldfloorrover;
// Match the Thing's old floorz to an FOF and check for FF_EXISTS
// If ~FF_EXISTS, don't set mobj Z.
if (!rover || ((rover->flags & FF_EXISTS) && (rover->flags & FF_SOLID)))
// Match the Thing's old floorz to an FOF and check for FOF_EXISTS
// If ~FOF_EXISTS, don't set mobj Z.
if (!rover || ((rover->fofflags & FOF_EXISTS) && (rover->fofflags & FOF_SOLID)))
{
hitfloor = false;
if (thing->eflags & MFE_VERTICALFLIP)
@ -3150,7 +3170,7 @@ static void P_HitCameraSlideLine(line_t *ld, camera_t *thiscam)
}
side = P_PointOnLineSide(thiscam->x, thiscam->y, ld);
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
lineangle = ld->angle;
if (side == 1)
lineangle += ANGLE_180;
@ -3196,7 +3216,7 @@ static void P_HitSlideLine(line_t *ld)
side = P_PointOnLineSide(slidemo->x, slidemo->y, ld);
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
lineangle = ld->angle;
if (side == 1)
lineangle += ANGLE_180;
@ -3230,7 +3250,7 @@ static void P_PlayerHitBounceLine(line_t *ld)
fixed_t x, y;
side = P_PointOnLineSide(slidemo->x, slidemo->y, ld);
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy)-ANGLE_90;
lineangle = ld->angle - ANGLE_90;
if (side == 1)
lineangle += ANGLE_180;
@ -3279,7 +3299,7 @@ static void P_HitBounceLine(line_t *ld)
return;
}
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
lineangle = ld->angle;
if (lineangle >= ANGLE_180)
lineangle -= ANGLE_180;
@ -3366,7 +3386,7 @@ static boolean PTR_LineIsBlocking(line_t *li)
if (opentop - slidemo->z < slidemo->height)
return true; // mobj is too high
if (openbottom - slidemo->z > P_GetThingStepUp(slidemo))
if (openbottom - slidemo->z > P_GetThingStepUp(slidemo, slidemo->x, slidemo->y))
return true; // too big a step up
return false;
@ -3387,7 +3407,7 @@ static boolean PTR_SlideTraverse(intercept_t *in)
// see if it is closer than best so far
if (li->polyobj && slidemo->player)
{
if ((li->polyobj->lines[0]->backsector->flags & SF_TRIGGERSPECIAL_TOUCH) && !(li->polyobj->flags & POF_NOSPECIALS))
if ((li->polyobj->lines[0]->backsector->flags & MSF_TRIGGERSPECIAL_TOUCH) && !(li->polyobj->flags & POF_NOSPECIALS))
P_ProcessSpecialSector(slidemo->player, slidemo->subsector->sector, li->polyobj->lines[0]->backsector);
}
@ -3508,16 +3528,13 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
for (rover = sec->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_SWIMMABLE))
continue;
if (GETSECSPECIAL(rover->master->frontsector->special, 1) != 3)
continue;
if (rover->master->flags & ML_BLOCKPLAYERS)
if (rover->master->frontsector->damagetype != SD_LAVA)
continue;
topheight = P_GetFFloorTopZAt(rover, mo->x, mo->y);
@ -4217,8 +4234,8 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
for (rover = thing->subsector->sector->ffloors; rover; rover = rover->next)
{
if (!(((rover->flags & FF_BLOCKPLAYER) && thing->player)
|| ((rover->flags & FF_BLOCKOTHERS) && !thing->player)) || !(rover->flags & FF_EXISTS))
if (!(((rover->fofflags & FOF_BLOCKPLAYER) && thing->player)
|| ((rover->fofflags & FOF_BLOCKOTHERS) && !thing->player)) || !(rover->fofflags & FOF_EXISTS))
continue;
topheight = *rover->topheight;
@ -5012,16 +5029,16 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
for (rover = sec->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!((rover->flags & FF_SOLID) || (rover->flags & FF_QUICKSAND)) || (rover->flags & FF_SWIMMABLE))
if (!((rover->fofflags & FOF_SOLID) || (rover->fofflags & FOF_QUICKSAND)) || (rover->fofflags & FOF_SWIMMABLE))
continue;
topheight = P_GetFFloorTopZAt (rover, x, y);
bottomheight = P_GetFFloorBottomZAt(rover, x, y);
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (z < topheight && bottomheight < thingtop)
{
@ -5056,16 +5073,16 @@ fixed_t P_CeilingzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
for (rover = sec->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE)))
if ((!(rover->fofflags & FOF_SOLID || rover->fofflags & FOF_QUICKSAND) || (rover->fofflags & FOF_SWIMMABLE)))
continue;
topheight = P_GetFFloorTopZAt (rover, x, y);
bottomheight = P_GetFFloorBottomZAt(rover, x, y);
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (thingtop > bottomheight && topheight > z)
{

View file

@ -437,7 +437,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = front->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef);
@ -461,7 +461,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = back->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef);
@ -527,27 +527,39 @@ P_GetMidtextureTopBottom
#if 0
// don't remove this code unless solid midtextures
// on non-solid polyobjects should NEVER happen in the future
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
if ((linedef->flags & ML_WRAPMIDTEX) && !side->repeatcnt) // "infinite" repeat
{
texbottom = back->floorheight + side->rowoffset;
textop = back->ceilingheight + side->rowoffset;
} else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) {
}
else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_MIDPEG))
{
texbottom = back->floorheight + side->rowoffset;
textop = texbottom + texheight*(side->repeatcnt+1);
} else {
}
else
{
textop = back->ceilingheight + side->rowoffset;
texbottom = textop - texheight*(side->repeatcnt+1);
}
} else
}
else
#endif
{
if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat
if ((linedef->flags & ML_WRAPMIDTEX) && !side->repeatcnt) // "infinite" repeat
{
texbottom += side->rowoffset;
textop += side->rowoffset;
} else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) {
}
else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_MIDPEG))
{
texbottom += side->rowoffset;
textop = texbottom + texheight*(side->repeatcnt+1);
} else {
}
else
{
textop += side->rowoffset;
texbottom = textop - texheight*(side->repeatcnt+1);
}
@ -562,6 +574,24 @@ P_GetMidtextureTopBottom
return true;
}
static boolean P_MidtextureIsSolid(line_t *linedef, mobj_t *mobj)
{
if (linedef->polyobj)
{
// don't do anything for polyobjects! ...for now
return false;
}
if (P_IsLineTripWire(linedef) == true)
{
// Tripwire behavior.
return (mobj->player != NULL && K_TripwirePass(mobj->player) == false);
}
// Determined solely by the flag.
return ((linedef->flags & ML_MIDSOLID) == ML_MIDSOLID);
}
void P_LineOpening(line_t *linedef, mobj_t *mobj)
{
enum { FRONT, BACK };
@ -670,9 +700,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
if (mobj)
{
// Check for collision with front side's midtexture if Effect 4 is set
if ((linedef->flags & ML_EFFECT4 || (mobj->player && P_IsLineTripWire(linedef) && !K_TripwirePass(mobj->player)))
&& !linedef->polyobj // don't do anything for polyobjects! ...for now
) {
if (P_MidtextureIsSolid(linedef, mobj) == true)
{
fixed_t textop, texbottom;
fixed_t texmid, delta1, delta2;
@ -683,7 +712,9 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
delta1 = abs(mobj->z - texmid);
delta2 = abs(thingtop - texmid);
if (delta1 > delta2) { // Below
if (delta1 > delta2)
{
// Below
if (opentop > texbottom)
{
topedge[lo] -= ( opentop - texbottom );
@ -692,7 +723,10 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
openceilingstep = ( thingtop - topedge[lo] );
openceilingdrop = ( topedge[hi] - topedge[lo] );
}
} else { // Above
}
else
{
// Above
if (openbottom < textop)
{
botedge[hi] += ( textop - openbottom );
@ -704,6 +738,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
}
}
}
if (linedef->polyobj)
{
// Treat polyobj's backsector like a 3D Floor
@ -774,13 +809,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
for (rover = front->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (P_CheckSolidFFloorSurface(mobj, rover))
;
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
continue;
topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef);
@ -789,7 +824,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF
{
if (bottomheight < open[FRONT].top) {
open[FRONT].top = bottomheight;
@ -801,7 +836,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
highceiling = bottomheight;
}
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF
{
if (topheight > open[FRONT].bottom) {
open[FRONT].bottom = topheight;
@ -818,13 +853,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
for (rover = back->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (P_CheckSolidFFloorSurface(mobj, rover))
;
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
continue;
topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef);
@ -833,7 +868,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF
{
if (bottomheight < open[BACK].top) {
open[BACK].top = bottomheight;
@ -845,7 +880,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
highceiling = bottomheight;
}
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF
{
if (topheight > open[BACK].bottom) {
open[BACK].bottom = topheight;

File diff suppressed because it is too large Load diff

View file

@ -118,7 +118,7 @@ typedef enum
// Don't apply gravity (every tic); object will float, keeping current height
// or changing it actively.
MF_NOGRAVITY = 1<<9,
// This object is an ambient sound.
// This object is an ambient sound. Obsolete, but keep this around for backwards compatibility.
MF_AMBIENT = 1<<10,
// Slide this object when it hits a wall.
MF_SLIDEME = 1<<11,

View file

@ -786,7 +786,7 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
vertex_t closest;
// calculate angle of line and subtract 90 degrees to get normal
lineangle = R_PointToAngle2(0, 0, line->dx, line->dy) - ANGLE_90;
lineangle = line->angle - ANGLE_90;
lineangle >>= ANGLETOFINESHIFT;
momx = FixedMul(po->thrust, FINECOSINE(lineangle));
momy = FixedMul(po->thrust, FINESINE(lineangle));
@ -961,7 +961,7 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
else
Polyobj_pushThing(po, line, mo);
if (mo->player && (po->lines[0]->backsector->flags & SF_TRIGGERSPECIAL_TOUCH) && !(po->flags & POF_NOSPECIALS))
if (mo->player && (po->lines[0]->backsector->flags & MSF_TRIGGERSPECIAL_TOUCH) && !(po->flags & POF_NOSPECIALS))
P_ProcessSpecialSector(mo->player, mo->subsector->sector, po->lines[0]->backsector);
hitflags |= 1;
@ -1058,6 +1058,8 @@ static void Polyobj_rotateLine(line_t *ld)
ld->dx = v2->x - v1->x;
ld->dy = v2->y - v1->y;
ld->angle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
// determine slopetype
ld->slopetype = !ld->dx ? ST_VERTICAL : !ld->dy ? ST_HORIZONTAL :
((ld->dy > 0) == (ld->dx > 0)) ? ST_POSITIVE : ST_NEGATIVE;
@ -1087,7 +1089,7 @@ static void Polyobj_rotateLine(line_t *ld)
}
// Causes objects resting on top of the rotating polyobject to 'ride' with its movement.
static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta, UINT8 turnthings)
static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta, boolean turnplayers, boolean turnothers)
{
static INT32 pomovecount = 10000;
INT32 x, y;
@ -1153,7 +1155,7 @@ static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta,
Polyobj_slideThing(mo, newxoff, newyoff);
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
if ((turnplayers && mo->player) || (turnothers && !mo->player)) {
mo->angle += delta;
if (mo->player)
P_SetPlayerAngle(mo->player, mo->player->angleturn + delta);
@ -1165,7 +1167,7 @@ static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta,
}
// Rotates a polyobject around its start point.
boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, boolean checkmobjs)
boolean Polyobj_rotate(polyobj_t *po, angle_t delta, boolean turnplayers, boolean turnothers, boolean checkmobjs)
{
size_t i;
angle_t angle;
@ -1203,7 +1205,7 @@ boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, boolean c
for (i = 0; i < po->numLines; ++i)
hitflags |= Polyobj_clipThings(po, po->lines[i]);
Polyobj_rotateThings(po, origin, delta, turnthings);
Polyobj_rotateThings(po, origin, delta, turnplayers, turnothers);
}
if (hitflags & 2)
@ -1414,7 +1416,7 @@ void Polyobj_MoveOnLoad(polyobj_t *po, angle_t angle, fixed_t x, fixed_t y)
fixed_t dx, dy;
// first, rotate to the saved angle
Polyobj_rotate(po, angle, false, false);
Polyobj_rotate(po, angle, false, false, false);
// determine component distances to translate
dx = x - po->spawnSpot.x;
@ -1457,7 +1459,7 @@ void T_PolyObjRotate(polyrotate_t *th)
// rotate by 'speed' angle per frame
// if distance == -1, this polyobject rotates perpetually
if (Polyobj_rotate(po, th->speed, th->turnobjs, true) && th->distance != -1)
if (Polyobj_rotate(po, th->speed, th->turnobjs & PTF_PLAYERS, th->turnobjs & PTF_OTHERS, true) && th->distance != -1)
{
INT32 avel = abs(th->speed);
@ -1859,7 +1861,7 @@ void T_PolyDoorSwing(polyswingdoor_t *th)
// rotate by 'speed' angle per frame
// if distance == -1, this polyobject rotates perpetually
if (Polyobj_rotate(po, th->speed, false, true) && th->distance != -1)
if (Polyobj_rotate(po, th->speed, false, false, true) && th->distance != -1)
{
INT32 avel = abs(th->speed);
@ -1990,7 +1992,7 @@ void T_PolyObjRotDisplace(polyrotdisplace_t *th)
rotangle = FixedMul(th->rotscale, delta);
if (Polyobj_rotate(po, FixedAngle(rotangle), th->turnobjs, true))
if (Polyobj_rotate(po, FixedAngle(rotangle), th->turnobjs & PTF_PLAYERS, th->turnobjs & PTF_OTHERS, true))
th->oldHeights = newheights;
}
@ -2019,7 +2021,7 @@ boolean EV_DoPolyObjRotate(polyrotdata_t *prdata)
return false;
// check for override if this polyobj already has a thinker
if (po->thinker && !prdata->overRide)
if (po->thinker && !(prdata->flags & TMPR_OVERRIDE))
return false;
// create a new thinker
@ -2034,10 +2036,10 @@ boolean EV_DoPolyObjRotate(polyrotdata_t *prdata)
// use Hexen-style byte angles for speed and distance
th->speed = Polyobj_AngSpeed(prdata->speed * prdata->direction);
if (prdata->distance == 360) // 360 means perpetual
if (prdata->flags & TMPR_CONTINUOUS)
th->distance = -1;
else if (prdata->distance == 0) // 0 means 360 degrees
th->distance = 0xffffffff - 1;
else if (prdata->distance == 360)
th->distance = ANGLE_MAX - 1;
else
th->distance = FixedAngle(prdata->distance*FRACUNIT);
@ -2052,11 +2054,15 @@ boolean EV_DoPolyObjRotate(polyrotdata_t *prdata)
oldpo = po;
th->turnobjs = 0;
if (!(prdata->flags & TMPR_DONTROTATEOTHERS))
th->turnobjs |= PTF_OTHERS;
if (prdata->flags & TMPR_ROTATEPLAYERS)
th->turnobjs |= PTF_PLAYERS;
// interpolation
R_CreateInterpolator_Polyobj(&th->thinker, po);
th->turnobjs = prdata->turnobjs;
// apply action to mirroring polyobjects as well
start = 0;
while ((po = Polyobj_GetChild(oldpo, &start)))

View file

@ -137,7 +137,7 @@ typedef struct polyrotate_s
INT32 polyObjNum; // numeric id of polyobject (avoid C pointers here)
INT32 speed; // speed of movement per frame
INT32 distance; // distance to move
UINT8 turnobjs; // turn objects? 0=no, 1=everything but players, 2=everything
UINT8 turnobjs; // turn objects? PTF_ flags
} polyrotate_t;
typedef struct polymove_s
@ -247,14 +247,27 @@ typedef struct polyfade_s
// Line Activation Data Structures
//
typedef enum
{
TMPR_DONTROTATEOTHERS = 1,
TMPR_ROTATEPLAYERS = 1<<1,
TMPR_CONTINUOUS = 1<<2,
TMPR_OVERRIDE = 1<<3,
} textmappolyrotate_t;
typedef enum
{
PTF_PLAYERS = 1, // Turn players with movement
PTF_OTHERS = 1<<1, // Turn other mobjs with movement
} polyturnflags_e;
typedef struct polyrotdata_s
{
INT32 polyObjNum; // numeric id of polyobject to affect
INT32 direction; // direction of rotation
INT32 speed; // angular speed
INT32 distance; // distance to move
UINT8 turnobjs; // rotate objects being carried?
UINT8 overRide; // if true, will override any action on the object
UINT8 flags; // TMPR_ flags
} polyrotdata_t;
typedef struct polymovedata_s
@ -281,6 +294,20 @@ typedef struct polywaypointdata_s
UINT8 flags; // PWF_ flags
} polywaypointdata_t;
typedef enum
{
TMPV_NOCHANGE = 1,
TMPV_VISIBLE = 1<<1,
TMPV_INVISIBLE = 1<<2,
} textmappolyvisibility_t;
typedef enum
{
TMPT_NOCHANGE = 1,
TMPT_TANGIBLE = 1<<1,
TMPT_INTANGIBLE = 1<<2,
} textmappolytangibility_t;
// polyobject door types
typedef enum
{
@ -322,6 +349,15 @@ typedef struct polyflagdata_s
fixed_t momx;
} polyflagdata_t;
typedef enum
{
TMPF_RELATIVE = 1,
TMPF_OVERRIDE = 1<<1,
TMPF_TICBASED = 1<<2,
TMPF_IGNORECOLLISION = 1<<3,
TMPF_GHOSTFADE = 1<<4,
} textmappolyfade_t;
typedef struct polyfadedata_s
{
INT32 polyObjNum;
@ -337,7 +373,7 @@ typedef struct polyfadedata_s
//
boolean Polyobj_moveXY(polyobj_t *po, fixed_t x, fixed_t y, boolean checkmobjs);
boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings, boolean checkmobjs);
boolean Polyobj_rotate(polyobj_t *po, angle_t delta, boolean turnplayers, boolean turnothers, boolean checkmobjs);
polyobj_t *Polyobj_GetForNum(INT32 id);
void Polyobj_InitLevel(void);
void Polyobj_MoveOnLoad(polyobj_t *po, angle_t angle, fixed_t x, fixed_t y);

View file

@ -999,6 +999,17 @@ static void P_NetUnArchiveTubeWaypoints(void)
#define SD_TAGLIST 0x01
#define SD_COLORMAP 0x02
#define SD_CRUMBLESTATE 0x04
#define SD_FLOORLIGHT 0x08
#define SD_CEILLIGHT 0x10
#define SD_FLAG 0x20
#define SD_SPECIALFLAG 0x40
#define SD_DIFF4 0x80
//diff4 flags
#define SD_DAMAGETYPE 0x01
#define SD_TRIGGERTAG 0x02
#define SD_TRIGGERER 0x04
#define SD_GRAVITY 0x08
#define LD_FLAG 0x01
#define LD_SPECIAL 0x02
@ -1053,7 +1064,7 @@ static boolean CheckFFloorDiff(const sector_t *ss)
for (rover = ss->ffloors; rover; rover = rover->next)
{
if (rover->flags != rover->spawnflags
if (rover->fofflags != rover->spawnflags
|| rover->alpha != rover->spawnalpha)
{
return true; // we found an FOF that changed!
@ -1073,7 +1084,7 @@ static void ArchiveFFloors(const sector_t *ss)
for (rover = ss->ffloors; rover; rover = rover->next)
{
fflr_diff = 0; // reset diff flags
if (rover->flags != rover->spawnflags)
if (rover->fofflags != rover->spawnflags)
fflr_diff |= FD_FLAGS;
if (rover->alpha != rover->spawnalpha)
fflr_diff |= FD_ALPHA;
@ -1083,7 +1094,7 @@ static void ArchiveFFloors(const sector_t *ss)
WRITEUINT16(save_p, j); // save ffloor "number"
WRITEUINT8(save_p, fflr_diff);
if (fflr_diff & FD_FLAGS)
WRITEUINT32(save_p, rover->flags);
WRITEUINT32(save_p, rover->fofflags);
if (fflr_diff & FD_ALPHA)
WRITEINT16(save_p, rover->alpha);
}
@ -1121,7 +1132,7 @@ static void UnArchiveFFloors(const sector_t *ss)
fflr_diff = READUINT8(save_p);
if (fflr_diff & FD_FLAGS)
rover->flags = READUINT32(save_p);
rover->fofflags = READUINT32(save_p);
if (fflr_diff & FD_ALPHA)
rover->alpha = READINT16(save_p);
@ -1137,11 +1148,11 @@ static void ArchiveSectors(void)
size_t i, j;
const sector_t *ss = sectors;
const sector_t *spawnss = spawnsectors;
UINT8 diff, diff2, diff3;
UINT8 diff, diff2, diff3, diff4;
for (i = 0; i < numsectors; i++, ss++, spawnss++)
{
diff = diff2 = diff3 = 0;
diff = diff2 = diff3 = diff4 = 0;
if (ss->floorheight != spawnss->floorheight)
diff |= SD_FLOORHT;
if (ss->ceilingheight != spawnss->ceilingheight)
@ -1180,9 +1191,29 @@ static void ArchiveSectors(void)
if (ss->crumblestate)
diff3 |= SD_CRUMBLESTATE;
if (ss->floorlightlevel != spawnss->floorlightlevel || ss->floorlightabsolute != spawnss->floorlightabsolute)
diff3 |= SD_FLOORLIGHT;
if (ss->ceilinglightlevel != spawnss->ceilinglightlevel || ss->ceilinglightabsolute != spawnss->ceilinglightabsolute)
diff3 |= SD_CEILLIGHT;
if (ss->flags != spawnss->flags)
diff3 |= SD_FLAG;
if (ss->specialflags != spawnss->specialflags)
diff3 |= SD_SPECIALFLAG;
if (ss->damagetype != spawnss->damagetype)
diff4 |= SD_DAMAGETYPE;
if (ss->triggertag != spawnss->triggertag)
diff4 |= SD_TRIGGERTAG;
if (ss->triggerer != spawnss->triggerer)
diff4 |= SD_TRIGGERER;
if (ss->gravity != spawnss->gravity)
diff4 |= SD_GRAVITY;
if (ss->ffloors && CheckFFloorDiff(ss))
diff |= SD_FFLOORS;
if (diff4)
diff3 |= SD_DIFF4;
if (diff3)
diff2 |= SD_DIFF3;
@ -1197,6 +1228,8 @@ static void ArchiveSectors(void)
WRITEUINT8(save_p, diff2);
if (diff2 & SD_DIFF3)
WRITEUINT8(save_p, diff3);
if (diff3 & SD_DIFF4)
WRITEUINT8(save_p, diff4);
if (diff & SD_FLOORHT)
WRITEFIXED(save_p, ss->floorheight);
if (diff & SD_CEILHT)
@ -1233,6 +1266,28 @@ static void ArchiveSectors(void)
// returns existing index if already added, or appends to net_colormaps and returns new index
if (diff3 & SD_CRUMBLESTATE)
WRITEINT32(save_p, ss->crumblestate);
if (diff3 & SD_FLOORLIGHT)
{
WRITEINT16(save_p, ss->floorlightlevel);
WRITEUINT8(save_p, ss->floorlightabsolute);
}
if (diff3 & SD_CEILLIGHT)
{
WRITEINT16(save_p, ss->ceilinglightlevel);
WRITEUINT8(save_p, ss->ceilinglightabsolute);
}
if (diff3 & SD_FLAG)
WRITEUINT32(save_p, ss->flags);
if (diff3 & SD_SPECIALFLAG)
WRITEUINT32(save_p, ss->specialflags);
if (diff4 & SD_DAMAGETYPE)
WRITEUINT8(save_p, ss->damagetype);
if (diff4 & SD_TRIGGERTAG)
WRITEINT16(save_p, ss->triggertag);
if (diff4 & SD_TRIGGERER)
WRITEUINT8(save_p, ss->triggerer);
if (diff4 & SD_GRAVITY)
WRITEFIXED(save_p, ss->gravity);
if (diff & SD_FFLOORS)
ArchiveFFloors(ss);
}
@ -1244,7 +1299,7 @@ static void ArchiveSectors(void)
static void UnArchiveSectors(void)
{
UINT16 i, j;
UINT8 diff, diff2, diff3;
UINT8 diff, diff2, diff3, diff4;
for (;;)
{
i = READUINT16(save_p);
@ -1264,6 +1319,10 @@ static void UnArchiveSectors(void)
diff3 = READUINT8(save_p);
else
diff3 = 0;
if (diff3 & SD_DIFF4)
diff4 = READUINT8(save_p);
else
diff4 = 0;
if (diff & SD_FLOORHT)
sectors[i].floorheight = READFIXED(save_p);
@ -1324,6 +1383,31 @@ static void UnArchiveSectors(void)
sectors[i].extra_colormap = GetNetColormapFromList(READUINT32(save_p));
if (diff3 & SD_CRUMBLESTATE)
sectors[i].crumblestate = READINT32(save_p);
if (diff3 & SD_FLOORLIGHT)
{
sectors[i].floorlightlevel = READINT16(save_p);
sectors[i].floorlightabsolute = READUINT8(save_p);
}
if (diff3 & SD_CEILLIGHT)
{
sectors[i].ceilinglightlevel = READINT16(save_p);
sectors[i].ceilinglightabsolute = READUINT8(save_p);
}
if (diff3 & SD_FLAG)
{
sectors[i].flags = READUINT32(save_p);
CheckForReverseGravity |= (sectors[i].flags & MSF_GRAVITYFLIP);
}
if (diff3 & SD_SPECIALFLAG)
sectors[i].specialflags = READUINT32(save_p);
if (diff4 & SD_DAMAGETYPE)
sectors[i].damagetype = READUINT8(save_p);
if (diff4 & SD_TRIGGERTAG)
sectors[i].triggertag = READINT16(save_p);
if (diff4 & SD_TRIGGERER)
sectors[i].triggerer = READUINT8(save_p);
if (diff4 & SD_GRAVITY)
sectors[i].gravity = READFIXED(save_p);
if (diff & SD_FFLOORS)
UnArchiveFFloors(&sectors[i]);
@ -1396,7 +1480,7 @@ static void ArchiveLines(void)
if (diff & LD_DIFF2)
WRITEUINT8(save_p, diff2);
if (diff & LD_FLAG)
WRITEINT16(save_p, li->flags);
WRITEUINT32(save_p, li->flags);
if (diff & LD_SPECIAL)
WRITEINT16(save_p, li->special);
if (diff & LD_CLLCOUNT)
@ -1478,7 +1562,7 @@ static void UnArchiveLines(void)
diff2 = 0;
if (diff & LD_FLAG)
li->flags = READINT16(save_p);
li->flags = READUINT32(save_p);
if (diff & LD_SPECIAL)
li->special = READINT16(save_p);
if (diff & LD_CLLCOUNT)
@ -2176,6 +2260,7 @@ static void SaveThwompThinker(const thinker_t *th, const UINT8 type)
WRITEINT32(save_p, ht->delay);
WRITEINT16(save_p, ht->tag);
WRITEUINT16(save_p, ht->sound);
WRITEINT32(save_p, ht->initDelay);
}
static void SaveFloatThinker(const thinker_t *th, const UINT8 type)
@ -2196,7 +2281,6 @@ static void SaveEachTimeThinker(const thinker_t *th, const UINT8 type)
for (i = 0; i < MAXPLAYERS; i++)
{
WRITECHAR(save_p, ht->playersInArea[i]);
WRITECHAR(save_p, ht->playersOnArea[i]);
}
WRITECHAR(save_p, ht->triggerOnExit);
}
@ -2224,14 +2308,12 @@ static void SaveCeilingThinker(const thinker_t *th, const UINT8 type)
WRITEFIXED(save_p, ht->bottomheight);
WRITEFIXED(save_p, ht->topheight);
WRITEFIXED(save_p, ht->speed);
WRITEFIXED(save_p, ht->oldspeed);
WRITEFIXED(save_p, ht->delay);
WRITEFIXED(save_p, ht->delaytimer);
WRITEUINT8(save_p, ht->crush);
WRITEINT32(save_p, ht->texture);
WRITEINT32(save_p, ht->direction);
WRITEINT32(save_p, ht->tag);
WRITEINT32(save_p, ht->olddirection);
WRITEINT16(save_p, ht->tag);
WRITEFIXED(save_p, ht->origspeed);
WRITEFIXED(save_p, ht->sourceline);
}
@ -2250,6 +2332,8 @@ static void SaveFloormoveThinker(const thinker_t *th, const UINT8 type)
WRITEFIXED(save_p, ht->origspeed);
WRITEFIXED(save_p, ht->delay);
WRITEFIXED(save_p, ht->delaytimer);
WRITEINT16(save_p, ht->tag);
WRITEFIXED(save_p, ht->sourceline);
}
static void SaveLightflashThinker(const thinker_t *th, const UINT8 type)
@ -2267,8 +2351,8 @@ static void SaveStrobeThinker(const thinker_t *th, const UINT8 type)
WRITEUINT8(save_p, type);
WRITEUINT32(save_p, SaveSector(ht->sector));
WRITEINT32(save_p, ht->count);
WRITEINT32(save_p, ht->minlight);
WRITEINT32(save_p, ht->maxlight);
WRITEINT16(save_p, ht->minlight);
WRITEINT16(save_p, ht->maxlight);
WRITEINT32(save_p, ht->darktime);
WRITEINT32(save_p, ht->brighttime);
}
@ -2278,10 +2362,10 @@ static void SaveGlowThinker(const thinker_t *th, const UINT8 type)
const glow_t *ht = (const void *)th;
WRITEUINT8(save_p, type);
WRITEUINT32(save_p, SaveSector(ht->sector));
WRITEINT32(save_p, ht->minlight);
WRITEINT32(save_p, ht->maxlight);
WRITEINT32(save_p, ht->direction);
WRITEINT32(save_p, ht->speed);
WRITEINT16(save_p, ht->minlight);
WRITEINT16(save_p, ht->maxlight);
WRITEINT16(save_p, ht->direction);
WRITEINT16(save_p, ht->speed);
}
static inline void SaveFireflickerThinker(const thinker_t *th, const UINT8 type)
@ -2291,8 +2375,8 @@ static inline void SaveFireflickerThinker(const thinker_t *th, const UINT8 type)
WRITEUINT32(save_p, SaveSector(ht->sector));
WRITEINT32(save_p, ht->count);
WRITEINT32(save_p, ht->resetcount);
WRITEINT32(save_p, ht->maxlight);
WRITEINT32(save_p, ht->minlight);
WRITEINT16(save_p, ht->maxlight);
WRITEINT16(save_p, ht->minlight);
}
static void SaveElevatorThinker(const thinker_t *th, const UINT8 type)
@ -2366,13 +2450,9 @@ static inline void SavePusherThinker(const thinker_t *th, const UINT8 type)
const pusher_t *ht = (const void *)th;
WRITEUINT8(save_p, type);
WRITEUINT8(save_p, ht->type);
WRITEINT32(save_p, ht->x_mag);
WRITEINT32(save_p, ht->y_mag);
WRITEINT32(save_p, ht->magnitude);
WRITEINT32(save_p, ht->radius);
WRITEINT32(save_p, ht->x);
WRITEINT32(save_p, ht->y);
WRITEINT32(save_p, ht->z);
WRITEFIXED(save_p, ht->x_mag);
WRITEFIXED(save_p, ht->y_mag);
WRITEFIXED(save_p, ht->z_mag);
WRITEINT32(save_p, ht->affectee);
WRITEUINT8(save_p, ht->roverpusher);
WRITEINT32(save_p, ht->referrer);
@ -2470,18 +2550,30 @@ static void SavePlaneDisplaceThinker(const thinker_t *th, const UINT8 type)
WRITEUINT8(save_p, ht->type);
}
static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type)
static inline void SaveDynamicLineSlopeThinker(const thinker_t *th, const UINT8 type)
{
const dynplanethink_t* ht = (const void*)th;
const dynlineplanethink_t* ht = (const void*)th;
WRITEUINT8(save_p, type);
WRITEUINT8(save_p, ht->type);
WRITEUINT32(save_p, SaveSlope(ht->slope));
WRITEUINT32(save_p, SaveLine(ht->sourceline));
WRITEFIXED(save_p, ht->extent);
}
WRITEMEM(save_p, ht->tags, sizeof(ht->tags));
static inline void SaveDynamicVertexSlopeThinker(const thinker_t *th, const UINT8 type)
{
size_t i;
const dynvertexplanethink_t* ht = (const void*)th;
WRITEUINT8(save_p, type);
WRITEUINT32(save_p, SaveSlope(ht->slope));
for (i = 0; i < 3; i++)
WRITEUINT32(save_p, SaveSector(ht->secs[i]));
WRITEMEM(save_p, ht->vex, sizeof(ht->vex));
WRITEMEM(save_p, ht->origsecheights, sizeof(ht->origsecheights));
WRITEMEM(save_p, ht->origvecheights, sizeof(ht->origvecheights));
WRITEUINT8(save_p, ht->relative);
}
static inline void SavePolyrotatetThinker(const thinker_t *th, const UINT8 type)
@ -2806,12 +2898,12 @@ static void P_NetArchiveThinkers(void)
}
else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine)
{
SaveDynamicSlopeThinker(th, tc_dynslopeline);
SaveDynamicLineSlopeThinker(th, tc_dynslopeline);
continue;
}
else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeVert)
{
SaveDynamicSlopeThinker(th, tc_dynslopevert);
SaveDynamicVertexSlopeThinker(th, tc_dynslopevert);
continue;
}
#ifdef PARANOIA
@ -2969,7 +3061,7 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
{
UINT16 spawnpointnum = READUINT16(save_p);
if (mapthings[spawnpointnum].type == 1705 || mapthings[spawnpointnum].type == 1713) // NiGHTS Hoop special case
if (mapthings[spawnpointnum].type == 1713) // NiGHTS Hoop special case
{
P_SpawnHoop(&mapthings[spawnpointnum]);
return NULL;
@ -3380,7 +3472,6 @@ static thinker_t* LoadEachTimeThinker(actionf_p1 thinker)
for (i = 0; i < MAXPLAYERS; i++)
{
ht->playersInArea[i] = READCHAR(save_p);
ht->playersOnArea[i] = READCHAR(save_p);
}
ht->triggerOnExit = READCHAR(save_p);
return &ht->thinker;
@ -3410,14 +3501,12 @@ static thinker_t* LoadCeilingThinker(actionf_p1 thinker)
ht->bottomheight = READFIXED(save_p);
ht->topheight = READFIXED(save_p);
ht->speed = READFIXED(save_p);
ht->oldspeed = READFIXED(save_p);
ht->delay = READFIXED(save_p);
ht->delaytimer = READFIXED(save_p);
ht->crush = READUINT8(save_p);
ht->texture = READINT32(save_p);
ht->direction = READINT32(save_p);
ht->tag = READINT32(save_p);
ht->olddirection = READINT32(save_p);
ht->tag = READINT16(save_p);
ht->origspeed = READFIXED(save_p);
ht->sourceline = READFIXED(save_p);
if (ht->sector)
@ -3439,6 +3528,8 @@ static thinker_t* LoadFloormoveThinker(actionf_p1 thinker)
ht->origspeed = READFIXED(save_p);
ht->delay = READFIXED(save_p);
ht->delaytimer = READFIXED(save_p);
ht->tag = READINT16(save_p);
ht->sourceline = READFIXED(save_p);
if (ht->sector)
ht->sector->floordata = ht;
return &ht->thinker;
@ -3462,8 +3553,8 @@ static thinker_t* LoadStrobeThinker(actionf_p1 thinker)
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save_p));
ht->count = READINT32(save_p);
ht->minlight = READINT32(save_p);
ht->maxlight = READINT32(save_p);
ht->minlight = READINT16(save_p);
ht->maxlight = READINT16(save_p);
ht->darktime = READINT32(save_p);
ht->brighttime = READINT32(save_p);
if (ht->sector)
@ -3476,10 +3567,10 @@ static thinker_t* LoadGlowThinker(actionf_p1 thinker)
glow_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save_p));
ht->minlight = READINT32(save_p);
ht->maxlight = READINT32(save_p);
ht->direction = READINT32(save_p);
ht->speed = READINT32(save_p);
ht->minlight = READINT16(save_p);
ht->maxlight = READINT16(save_p);
ht->direction = READINT16(save_p);
ht->speed = READINT16(save_p);
if (ht->sector)
ht->sector->lightingdata = ht;
return &ht->thinker;
@ -3492,8 +3583,8 @@ static thinker_t* LoadFireflickerThinker(actionf_p1 thinker)
ht->sector = LoadSector(READUINT32(save_p));
ht->count = READINT32(save_p);
ht->resetcount = READINT32(save_p);
ht->maxlight = READINT32(save_p);
ht->minlight = READINT32(save_p);
ht->maxlight = READINT16(save_p);
ht->minlight = READINT16(save_p);
if (ht->sector)
ht->sector->lightingdata = ht;
return &ht->thinker;
@ -3585,19 +3676,14 @@ static thinker_t* LoadPusherThinker(actionf_p1 thinker)
pusher_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save_p);
ht->x_mag = READINT32(save_p);
ht->y_mag = READINT32(save_p);
ht->magnitude = READINT32(save_p);
ht->radius = READINT32(save_p);
ht->x = READINT32(save_p);
ht->y = READINT32(save_p);
ht->z = READINT32(save_p);
ht->x_mag = READFIXED(save_p);
ht->y_mag = READFIXED(save_p);
ht->z_mag = READFIXED(save_p);
ht->affectee = READINT32(save_p);
ht->roverpusher = READUINT8(save_p);
ht->referrer = READINT32(save_p);
ht->exclusive = READINT32(save_p);
ht->slider = READINT32(save_p);
ht->source = P_GetPushThing(ht->affectee);
return &ht->thinker;
}
@ -3721,17 +3807,31 @@ static inline thinker_t* LoadPlaneDisplaceThinker(actionf_p1 thinker)
return &ht->thinker;
}
static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker)
static inline thinker_t* LoadDynamicLineSlopeThinker(actionf_p1 thinker)
{
dynplanethink_t* ht = Z_Malloc(sizeof(*ht), PU_LEVSPEC, NULL);
dynlineplanethink_t* ht = Z_Malloc(sizeof(*ht), PU_LEVSPEC, NULL);
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save_p);
ht->slope = LoadSlope(READUINT32(save_p));
ht->sourceline = LoadLine(READUINT32(save_p));
ht->extent = READFIXED(save_p);
READMEM(save_p, ht->tags, sizeof(ht->tags));
return &ht->thinker;
}
static inline thinker_t* LoadDynamicVertexSlopeThinker(actionf_p1 thinker)
{
size_t i;
dynvertexplanethink_t* ht = Z_Malloc(sizeof(*ht), PU_LEVSPEC, NULL);
ht->thinker.function.acp1 = thinker;
ht->slope = LoadSlope(READUINT32(save_p));
for (i = 0; i < 3; i++)
ht->secs[i] = LoadSector(READUINT32(save_p));
READMEM(save_p, ht->vex, sizeof(ht->vex));
READMEM(save_p, ht->origsecheights, sizeof(ht->origsecheights));
READMEM(save_p, ht->origvecheights, sizeof(ht->origvecheights));
ht->relative = READUINT8(save_p);
return &ht->thinker;
}
@ -4044,11 +4144,11 @@ static void P_NetUnArchiveThinkers(void)
break;
case tc_dynslopeline:
th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine);
th = LoadDynamicLineSlopeThinker((actionf_p1)T_DynamicSlopeLine);
break;
case tc_dynslopevert:
th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeVert);
th = LoadDynamicVertexSlopeThinker((actionf_p1)T_DynamicSlopeVert);
break;
case tc_scroll:

File diff suppressed because it is too large Load diff

View file

@ -116,7 +116,7 @@ extern INT16 wadnamemap;
boolean P_RunSOC(const char *socfilename);
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
void P_LoadMusicsRange(UINT16 wadnum, UINT16 first, UINT16 num);
void P_WriteThings(void);
//void P_WriteThings(void);
void P_UpdateSegLightOffset(seg_t *li);
boolean P_ApplyLightOffset(UINT8 baselightnum);
boolean P_ApplyLightOffsetFine(UINT8 baselightlevel);

View file

@ -309,8 +309,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
// check front sector's FOFs first
for (rover = front->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERSIDES) || rover->flags & FF_TRANSLUCENT)
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
{
continue;
}
@ -326,8 +326,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
// check back sector's FOFs as well
for (rover = back->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERSIDES) || rover->flags & FF_TRANSLUCENT)
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
{
continue;
}
@ -456,8 +456,8 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
// Allow sight through water, fog, etc.
/// \todo Improve by checking fog density/translucency
/// and setting a sight limit.
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERPLANES) /*|| (rover->flags & FF_TRANSLUCENT)*/)
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERPLANES) /*|| (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))*/)
{
continue;
}
@ -475,10 +475,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
return false;
}
if (rover->flags & FF_SOLID)
if (rover->fofflags & FOF_SOLID)
continue; // shortcut since neither mobj can be inside the 3dfloor
if (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))
if (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))
{
if (los.sightzstart >= topz1 && t2->z + t2->height < topz2)
return false; // blocked by upper outside plane
@ -487,7 +487,7 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
return false; // blocked by lower outside plane
}
if (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)
if (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)
{
if (los.sightzstart < topz1 && t2->z >= topz2)
return false; // blocked by upper inside plane
@ -752,7 +752,7 @@ static boolean P_CrossBotTraversalSubsector(size_t num, register traceblocking_t
tmx = tb->compareThing->x;
tmy = tb->compareThing->y;
P_LineOpening(line, tb->compareThing);
maxstep = P_GetThingStepUp(tb->compareThing);
maxstep = P_GetThingStepUp(tb->compareThing, tmx, tmy);
if ((openrange < tb->compareThing->height) // doesn't fit
|| (opentop - tb->compareThing->z < tb->compareThing->height) // mobj is too high

View file

@ -230,7 +230,7 @@ static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fix
}
/// Recalculate dynamic slopes.
void T_DynamicSlopeLine (dynplanethink_t* th)
void T_DynamicSlopeLine (dynlineplanethink_t* th)
{
pslope_t* slope = th->slope;
line_t* srcline = th->sourceline;
@ -270,50 +270,59 @@ void T_DynamicSlopeLine (dynplanethink_t* th)
}
/// Mapthing-defined
void T_DynamicSlopeVert (dynplanethink_t* th)
void T_DynamicSlopeVert (dynvertexplanethink_t* th)
{
pslope_t* slope = th->slope;
size_t i;
INT32 l;
for (i = 0; i < 3; i++) {
l = Tag_FindLineSpecial(799, th->tags[i]);
if (l != -1) {
th->vex[i].z = lines[l].frontsector->floorheight;
}
for (i = 0; i < 3; i++)
{
if (th->relative & (1 << i))
th->vex[i].z = th->origvecheights[i] + (th->secs[i]->floorheight - th->origsecheights[i]);
else
th->vex[i].z = 0;
th->vex[i].z = th->secs[i]->floorheight;
}
P_ReconfigureViaVertexes(slope, th->vex[0], th->vex[1], th->vex[2]);
P_ReconfigureViaVertexes(th->slope, th->vex[0], th->vex[1], th->vex[2]);
}
static inline void P_AddDynSlopeThinker (pslope_t* slope, dynplanetype_t type, line_t* sourceline, fixed_t extent, const INT16 tags[3], const vector3_t vx[3])
static inline void P_AddDynLineSlopeThinker (pslope_t* slope, dynplanetype_t type, line_t* sourceline, fixed_t extent)
{
dynplanethink_t* th = Z_Calloc(sizeof (*th), PU_LEVSPEC, NULL);
switch (type)
{
case DP_VERTEX:
th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeVert;
memcpy(th->tags, tags, sizeof(th->tags));
memcpy(th->vex, vx, sizeof(th->vex));
break;
default:
th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeLine;
th->sourceline = sourceline;
th->extent = extent;
}
dynlineplanethink_t* th = Z_Calloc(sizeof (*th), PU_LEVSPEC, NULL);
th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeLine;
th->slope = slope;
th->type = type;
th->sourceline = sourceline;
th->extent = extent;
P_AddThinker(THINK_DYNSLOPE, &th->thinker);
// interpolation
R_CreateInterpolator_DynSlope(&th->thinker, slope);
}
static inline void P_AddDynVertexSlopeThinker (pslope_t* slope, const INT16 tags[3], const vector3_t vx[3])
{
dynvertexplanethink_t* th = Z_Calloc(sizeof (*th), PU_LEVSPEC, NULL);
size_t i;
INT32 l;
th->thinker.function.acp1 = (actionf_p1)T_DynamicSlopeVert;
th->slope = slope;
for (i = 0; i < 3; i++) {
l = Tag_FindLineSpecial(799, tags[i]);
if (l == -1)
{
Z_Free(th);
return;
}
th->secs[i] = lines[l].frontsector;
th->vex[i] = vx[i];
th->origsecheights[i] = lines[l].frontsector->floorheight;
th->origvecheights[i] = vx[i].z;
if (lines[l].args[0])
th->relative |= 1<<i;
}
P_AddThinker(THINK_DYNSLOPE, &th->thinker);
}
/// Create a new slope and add it to the slope list.
static inline pslope_t* Slope_Add (const UINT8 flags)
@ -380,6 +389,27 @@ static fixed_t GetExtent(sector_t *sector, line_t *line)
return fardist;
}
static boolean P_CopySlope(pslope_t** toslope, pslope_t* fromslope)
{
if (*toslope || !fromslope)
return true;
*toslope = fromslope;
return true;
}
static void P_UpdateHasSlope(sector_t *sec)
{
size_t i;
sec->hasslope = true;
// if this is an FOF control sector, make sure any target sectors also are marked as having slopes
if (sec->numattached)
for (i = 0; i < sec->numattached; i++)
sectors[sec->attached[i]].hasslope = true;
}
/// Creates one or more slopes based on the given line type and front/back sectors.
static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
{
@ -472,7 +502,7 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
P_CalculateSlopeNormal(fslope);
if (spawnthinker && (flags & SL_DYNAMIC))
P_AddDynSlopeThinker(fslope, DP_FRONTFLOOR, line, extent, NULL, NULL);
P_AddDynLineSlopeThinker(fslope, DP_FRONTFLOOR, line, extent);
}
if(frontceil)
{
@ -491,7 +521,7 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
P_CalculateSlopeNormal(cslope);
if (spawnthinker && (flags & SL_DYNAMIC))
P_AddDynSlopeThinker(cslope, DP_FRONTCEIL, line, extent, NULL, NULL);
P_AddDynLineSlopeThinker(cslope, DP_FRONTCEIL, line, extent);
}
}
if(backfloor || backceil)
@ -533,7 +563,7 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
P_CalculateSlopeNormal(fslope);
if (spawnthinker && (flags & SL_DYNAMIC))
P_AddDynSlopeThinker(fslope, DP_BACKFLOOR, line, extent, NULL, NULL);
P_AddDynLineSlopeThinker(fslope, DP_BACKFLOOR, line, extent);
}
if(backceil)
{
@ -552,9 +582,26 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
P_CalculateSlopeNormal(cslope);
if (spawnthinker && (flags & SL_DYNAMIC))
P_AddDynSlopeThinker(cslope, DP_BACKCEIL, line, extent, NULL, NULL);
P_AddDynLineSlopeThinker(cslope, DP_BACKCEIL, line, extent);
}
}
if (line->args[2] & TMSL_COPY)
{
if (frontfloor)
P_CopySlope(&line->backsector->f_slope, line->frontsector->f_slope);
if (backfloor)
P_CopySlope(&line->frontsector->f_slope, line->backsector->f_slope);
if (frontceil)
P_CopySlope(&line->backsector->c_slope, line->frontsector->c_slope);
if (backceil)
P_CopySlope(&line->frontsector->c_slope, line->backsector->c_slope);
if (backfloor || backceil)
P_UpdateHasSlope(line->frontsector);
if (frontfloor || frontceil)
P_UpdateHasSlope(line->backsector);
}
}
/// Creates a new slope from three mapthings with the specified IDs
@ -589,14 +636,14 @@ static pslope_t *MakeViaMapthings(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
vx[i].x = mt->x << FRACBITS;
vx[i].y = mt->y << FRACBITS;
vx[i].z = mt->z << FRACBITS;
if (!mt->extrainfo)
if (!mt->args[0])
vx[i].z += R_PointInSubsector(vx[i].x, vx[i].y)->sector->floorheight;
}
P_ReconfigureViaVertexes(ret, vx[0], vx[1], vx[2]);
if (spawnthinker && (flags & SL_DYNAMIC))
P_AddDynSlopeThinker(ret, DP_VERTEX, NULL, 0, tags, vx);
P_AddDynVertexSlopeThinker(ret, tags, vx);
return ret;
}
@ -712,27 +759,6 @@ static boolean P_SetSlopeFromTag(sector_t *sec, INT32 tag, boolean ceiling)
return false;
}
static boolean P_CopySlope(pslope_t **toslope, pslope_t *fromslope)
{
if (*toslope || !fromslope)
return true;
*toslope = fromslope;
return true;
}
static void P_UpdateHasSlope(sector_t *sec)
{
size_t i;
sec->hasslope = true;
// if this is an FOF control sector, make sure any target sectors also are marked as having slopes
if (sec->numattached)
for (i = 0; i < sec->numattached; i++)
sectors[sec->attached[i]].hasslope = true;
}
//
// P_CopySectorSlope
//

View file

@ -44,9 +44,24 @@ typedef enum
typedef enum
{
TMSL_NOPHYSICS = 1,
TMSL_DYNAMIC = 2,
TMSL_DYNAMIC = 1<<1,
TMSL_COPY = 1<<2,
} textmapslopeflags_t;
typedef enum
{
TMSA_FLOOR = 1,
TMSA_CEILING = 1<<1,
} textmapslopeanchor_t;
typedef enum
{
TMSAF_NOPHYSICS = 1,
TMSAF_DYNAMIC = 1<<1,
TMSAF_BACKSIDE = 1<<2,
TMSAF_MIRROR = 1<<3,
} textmapslopeanchorflags_t;
void P_LinkSlopeThinkers (void);
void P_UpdateSlopeLightOffset(pslope_t *slope);
@ -99,26 +114,29 @@ typedef enum {
DP_FRONTCEIL,
DP_BACKFLOOR,
DP_BACKCEIL,
DP_VERTEX
} dynplanetype_t;
/// Permit slopes to be dynamically altered through a thinker.
typedef struct
{
thinker_t thinker;
pslope_t* slope;
pslope_t *slope;
dynplanetype_t type;
// Used by line slopes.
line_t* sourceline;
line_t *sourceline;
fixed_t extent;
} dynlineplanethink_t;
// Used by mapthing vertex slopes.
INT16 tags[3];
typedef struct
{
thinker_t thinker;
pslope_t *slope;
sector_t *secs[3];
vector3_t vex[3];
} dynplanethink_t;
fixed_t origsecheights[3];
fixed_t origvecheights[3];
UINT8 relative;
} dynvertexplanethink_t;
void T_DynamicSlopeLine (dynplanethink_t* th);
void T_DynamicSlopeVert (dynplanethink_t* th);
void T_DynamicSlopeLine (dynlineplanethink_t* th);
void T_DynamicSlopeVert (dynvertexplanethink_t* th);
#endif // #ifndef P_SLOPES_H__

File diff suppressed because it is too large Load diff

View file

@ -20,9 +20,492 @@
extern mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs
extern mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs
// Something that should've been done long ago???
// We won't be using epicenter or radius anytime soon so I don't think it's worth it yet.
void P_StartQuake(fixed_t intensity, tic_t time);
// Amount (dx, dy) vector linedef is shifted right to get scroll amount
#define SCROLL_SHIFT 5
typedef enum
{
TMM_DOUBLESIZE = 1,
TMM_SILENT = 1<<1,
TMM_ALLOWYAWCONTROL = 1<<2,
TMM_SWING = 1<<3,
TMM_MACELINKS = 1<<4,
TMM_CENTERLINK = 1<<5,
TMM_CLIP = 1<<6,
TMM_ALWAYSTHINK = 1<<7,
} textmapmaceflags_t;
typedef enum
{
TMDA_BOTTOMOFFSET = 1,
TMDA_BOTTOM = 1<<1,
TMDA_MIDDLE = 1<<2,
TMDA_TOP = 1<<3,
} textmapdronealignment_t;
typedef enum
{
TMSF_RETRACTED = 1,
TMSF_INTANGIBLE = 1<<1,
} textmapspikeflags_t;
typedef enum
{
TMFF_AIMLESS = 1,
TMFF_STATIONARY = 1<<1,
TMFF_HOP = 1<<2,
} textmapflickyflags_t;
typedef enum
{
TMFH_NOFLAME = 1,
TMFH_CORONA = 1<<1,
} textmapflameholderflags_t;
typedef enum
{
TMDS_NOGRAVITY = 1,
TMDS_ROTATEEXTRA = 1<<1,
} textmapdiagonalspringflags_t;
typedef enum
{
TMF_INVISIBLE = 1,
TMF_NODISTANCECHECK = 1<<1,
} textmapfanflags_t;
typedef enum
{
TMGD_BACK = 0,
TMGD_RIGHT = 1,
TMGD_LEFT = 2,
} textmapguarddirection_t;
typedef enum
{
TMNI_BONUSONLY = 1,
TMNI_REVEAL = 1<<1,
} textmapnightsitem_t;
typedef enum
{
TMP_NORMAL = 0,
TMP_SLIDE = 1,
TMP_IMMOVABLE = 2,
TMP_CLASSIC = 3,
} textmappushabletype_t;
typedef enum
{
TMED_NONE = 0,
TMED_RIGHT = 1,
TMED_LEFT = 2,
} textmapeggrobodirection_t;
typedef enum
{
TMMR_SAME = 0,
TMMR_WEAK = 1,
TMMR_STRONG = 2,
} textmapmonitorrespawn_t;
typedef enum
{
TMF_GRAYSCALE = 1,
TMF_SKIPINTRO = 1<<1,
} textmapfangflags_t;
typedef enum
{
TMB_NODEATHFLING = 1,
TMB_BARRIER = 1<<1,
} textmapbrakflags_t;
typedef enum
{
TMWPF_DISABLED = 1,
TMWPF_SHORTCUT = 1<<1,
TMWPF_NORESPAWN = 1<<2,
TMWPF_FINISHLINE = 1<<3,
} textmapwaypointflags_t;
typedef enum
{
TMBCF_BACKANDFORTH = 1,
TMBCF_REVERSE = 1<<1,
} textmapbattlecapsuleflags_t;
typedef enum
{
TMICF_INVERTTIMEATTACK = 1,
TMICF_INVERTSIZE = 1<<1,
} textmapitemcapsuleflags_t;
typedef enum
{
TMMA_WARN = 1,
TMMA_FLIP = 2,
} textmapmayarrow_t;
typedef enum
{
TMEF_SKIPTALLY = 1,
TMEF_EMERALDCHECK = 1<<1,
} textmapexitflags_t;
typedef enum
{
TMSP_NOTELEPORT = 1,
TMSP_FORCESPIN = 1<<1,
} textmapspeedpadflags_t;
//FOF flags
typedef enum
{
TMFA_NOPLANES = 1,
TMFA_NOSIDES = 1<<1,
TMFA_INSIDES = 1<<2,
TMFA_ONLYINSIDES = 1<<3,
TMFA_NOSHADE = 1<<4,
TMFA_SPLAT = 1<<5,
} textmapfofappearance_t;
typedef enum
{
TMFT_INTANGIBLETOP = 1,
TMFT_INTANGIBLEBOTTOM = 1<<1,
TMFT_DONTBLOCKPLAYER = 1<<2,
TMFT_VISIBLEFROMINSIDE = (TMFT_INTANGIBLETOP|TMFT_INTANGIBLEBOTTOM|TMFT_DONTBLOCKPLAYER),
TMFT_DONTBLOCKOTHERS = 1<<3,
TMFT_INTANGIBLE = (TMFT_DONTBLOCKPLAYER|TMFT_DONTBLOCKOTHERS),
} textmapfoftangibility_t;
typedef enum
{
TMFW_NOSIDES = 1,
TMFW_DOUBLESHADOW = 1<<1,
TMFW_COLORMAPONLY = 1<<2,
TMFW_NORIPPLE = 1<<3,
TMFW_GOOWATER = 1<<4,
TMFW_SPLAT = 1<<5,
} textmapfofwater_t;
typedef enum
{
TMFB_REVERSE = 1,
TMFB_SPINDASH = 1<<1,
TMFB_DYNAMIC = 1<<2,
} textmapfofbobbing_t;
typedef enum
{
TMFC_NOSHADE = 1,
TMFC_NORETURN = 1<<1,
TMFC_AIRBOB = 1<<2,
TMFC_FLOATBOB = 1<<3,
TMFC_SPLAT = 1<<4,
} textmapfofcrumbling_t;
typedef enum
{
TMFR_REVERSE = 1,
TMFR_SPINDASH = 1<<1,
} textmapfofrising_t;
typedef enum
{
TMFM_BRICK = 1,
TMFM_INVISIBLE = 1<<1,
} textmapfofmario_t;
typedef enum
{
TMFB_TOUCH,
TMFB_SPIN,
TMFB_REGULAR,
TMFB_STRONG,
} textmapfofbusttype_t;
typedef enum
{
TMFB_PUSHABLES = 1,
TMFB_EXECUTOR = 1<<1,
TMFB_ONLYBOTTOM = 1<<2,
TMFB_SPLAT = 1<<3,
} textmapfofbustflags_t;
typedef enum
{
TMFL_NOBOSSES = 1,
TMFL_SPLAT = 1<<1,
} textmapfoflaserflags_t;
typedef enum
{
TMT_CONTINUOUS = 0,
TMT_ONCE = 1,
TMT_EACHTIMEMASK = TMT_ONCE,
TMT_EACHTIMEENTER = 2,
TMT_EACHTIMEENTERANDEXIT = 3,
} textmaptriggertype_t;
typedef enum
{
TMXT_CONTINUOUS = 0,
TMXT_EACHTIMEMASK = TMXT_CONTINUOUS,
TMXT_EACHTIMEENTER = 1,
TMXT_EACHTIMEENTERANDEXIT = 2,
} textmapxtriggertype_t;
typedef enum
{
TMF_HASALL = 0,
TMF_HASANY = 1,
TMF_HASEXACTLY = 2,
TMF_DOESNTHAVEALL = 3,
TMF_DOESNTHAVEANY = 4,
} textmapflagcheck_t;
typedef enum
{
TMT_RED = 0,
TMT_BLUE = 1,
} textmapteam_t;
typedef enum
{
TMC_EQUAL = 0,
TMC_LTE = 1,
TMC_GTE = 2,
} textmapcomparison_t;
typedef enum
{
TMNP_FASTEST = 0,
TMNP_SLOWEST = 1,
TMNP_TRIGGERER = 2,
} textmapnightsplayer_t;
typedef enum
{
TMN_ALWAYS = 0,
TMN_FROMNONIGHTS = 1,
TMN_FROMNIGHTS = 2,
} textmapnighterizeoptions_t;
typedef enum
{
TMN_BONUSLAPS = 1,
TMN_LEVELCOMPLETION = 1<<2,
} textmapnightserizeflags_t;
typedef enum
{
TMD_ALWAYS = 0,
TMD_NOBODYNIGHTS = 1,
TMD_SOMEBODYNIGHTS = 2,
} textmapdenighterizeoptions_t;
typedef enum
{
TMS_IFENOUGH = 0,
TMS_IFNOTENOUGH = 1,
TMS_ALWAYS = 2,
} textmapspherescheck_t;
typedef enum
{
TMI_BONUSLAPS = 1,
TMI_ENTER = 1<<2,
} textmapideyacaptureflags_t;
typedef enum
{
TMP_FLOOR = 0,
TMP_CEILING = 1,
TMP_BOTH = 2,
} textmapplanes_t;
typedef enum
{
TMT_ADD = 0,
TMT_REMOVE = 1,
TMT_REPLACEFIRST = 2,
} textmaptagoptions_t;
typedef enum
{
TMT_SILENT = 1,
TMT_KEEPANGLE = 1<<1,
TMT_KEEPMOMENTUM = 1<<2,
TMT_RELATIVE = 1<<3,
} textmapteleportflags_t;
typedef enum
{
TMM_ALLPLAYERS = 1,
TMM_OFFSET = 1<<1,
TMM_FADE = 1<<2,
TMM_NORELOAD = 1<<3,
TMM_FORCERESET = 1<<4,
TMM_NOLOOP = 1<<5,
TMM_NOCREDIT = 1<<6,
} textmapmusicflags_t;
typedef enum
{
TMSS_TRIGGERMOBJ = 0,
TMSS_TRIGGERSECTOR = 1,
TMSS_NOWHERE = 2,
TMSS_TAGGEDSECTOR = 3,
} textmapsoundsource_t;
typedef enum
{
TMSL_EVERYONE = 0,
TMSL_TRIGGERER = 1,
TMSL_TAGGEDSECTOR = 2,
} textmapsoundlistener_t;
typedef enum
{
TML_SECTOR = 0,
TML_FLOOR = 1,
TML_CEILING = 2,
} textmaplightareas_t;
typedef enum
{
TMLC_NOSECTOR = 1,
TMLC_NOFLOOR = 1<<1,
TMLC_NOCEILING = 1<<2,
} textmaplightcopyflags_t;
typedef enum
{
TMF_RELATIVE = 1,
TMF_OVERRIDE = 1<<1,
TMF_TICBASED = 1<<2,
} textmapfadeflags_t;
typedef enum
{
TMB_USETARGET = 1,
TMB_SYNC = 1<<1,
} textmapblinkinglightflags_t;
typedef enum
{
TMFR_NORETURN = 1,
TMFR_CHECKFLAG = 1<<1,
} textmapfofrespawnflags_t;
typedef enum
{
TMST_RELATIVE = 1,
TMST_DONTDOTRANSLUCENT = 1<<1,
} textmapsettranslucencyflags_t;
typedef enum
{
TMFT_RELATIVE = 1,
TMFT_OVERRIDE = 1<<1,
TMFT_TICBASED = 1<<2,
TMFT_IGNORECOLLISION = 1<<3,
TMFT_GHOSTFADE = 1<<4,
TMFT_DONTDOTRANSLUCENT = 1<<5,
TMFT_DONTDOEXISTS = 1<<6,
TMFT_DONTDOLIGHTING = 1<<7,
TMFT_DONTDOCOLORMAP = 1<<8,
TMFT_USEEXACTALPHA = 1<<9,
} textmapfadetranslucencyflags_t;
typedef enum
{
TMS_VIEWPOINT = 0,
TMS_CENTERPOINT = 1,
TMS_BOTH = 2,
} textmapskybox_t;
typedef enum
{
TMP_CLOSE = 1,
TMP_RUNPOSTEXEC = 1<<1,
TMP_CALLBYNAME = 1<<2,
TMP_KEEPCONTROLS = 1<<3,
TMP_KEEPREALTIME = 1<<4,
//TMP_ALLPLAYERS = 1<<5,
//TMP_FREEZETHINKERS = 1<<6,
} textmappromptflags_t;
typedef enum
{
TMF_NOCHANGE = 0,
TMF_ADD = 1,
TMF_REMOVE = 2,
} textmapsetflagflags_t;
typedef enum
{
TMSD_FRONT = 0,
TMSD_BACK = 1,
TMSD_FRONTBACK = 2,
} textmapsides_t;
typedef enum
{
TMS_SCROLLCARRY = 0,
TMS_SCROLLONLY = 1,
TMS_CARRYONLY = 2,
} textmapscroll_t;
typedef enum
{
TMST_REGULAR = 0,
TMST_ACCELERATIVE = 1,
TMST_DISPLACEMENT = 2,
TMST_TYPEMASK = 3,
TMST_NONEXCLUSIVE = 4,
} textmapscrolltype_t;
typedef enum
{
TMPF_SLIDE = 1,
TMPF_NONEXCLUSIVE = 1<<1,
} textmappusherflags_t;
typedef enum
{
TMPP_NOZFADE = 1,
TMPP_PUSHZ = 1<<1,
TMPP_NONEXCLUSIVE = 1<<2,
} textmappointpushflags_t;
typedef enum
{
TMB_TRANSLUCENT = 0,
TMB_ADD = 1,
TMB_SUBTRACT = 2,
TMB_REVERSESUBTRACT = 3,
TMB_MODULATE = 4,
} textmapblendmodes_t;
typedef enum
{
TMCFF_FLIP = 1,
} textmapcrossfinishflags_t;
typedef enum
{
TMCRF_FRONTONLY = 1,
} textmapcrossrespawnflags_t;
typedef enum
{
TMBOT_NORUBBERBAND = 1,
TMBOT_NOCONTROL = 1<<1,
TMBOT_FORCEDIR = 1<<2,
} textmapbotcontroller_t;
// GETSECSPECIAL (specialval, section)
//
@ -33,6 +516,10 @@ void P_StartQuake(fixed_t intensity, tic_t time);
// This must be updated whenever we up the max flat size - quicker to assume rather than figuring out the sqrt of the specific flat's filesize.
#define MAXFLATSIZE (2048<<FRACBITS)
// Something that should've been done long ago???
// We won't be using epicenter or radius anytime soon so I don't think it's worth it yet.
void P_StartQuake(fixed_t intensity, tic_t time);
// at game start
void P_InitPicAnims(void);
@ -41,13 +528,22 @@ void P_SetupLevelFlatAnims(void);
// at map load
void P_InitSpecials(void);
void P_ApplyFlatAlignment(sector_t* sector, angle_t flatangle, fixed_t xoffs, fixed_t yoffs, boolean floor, boolean ceiling);
fixed_t P_GetSectorGravityFactor(sector_t *sec);
void P_SpawnSpecials(boolean fromnetsave);
void P_SpawnSpecialsThatRequireObjects(boolean fromnetsave);
// every tic
void P_UpdateSpecials(void);
sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number, boolean touchground);
sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number);
sector_t *P_MobjTouchingSectorSpecialFlag(mobj_t *mo, sectorspecialflags_t flag);
sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 number);
sector_t *P_PlayerTouchingSectorSpecialFlag(player_t *player, sectorspecialflags_t flag);
void P_PlayerInSpecialSector(player_t *player);
void P_CheckMobjTrigger(mobj_t *mobj, boolean pushable);
sector_t *P_FindPlayerTrigger(player_t *player, line_t *sourceline);
boolean P_IsPlayerValid(size_t playernum);
boolean P_CanPlayerTrigger(size_t playernum);
void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *roversector);
fixed_t P_FindLowestFloorSurrounding(sector_t *sec);
@ -64,7 +560,10 @@ INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max);
void P_CrossSpecialLine(line_t *ld, INT32 side, mobj_t *thing);
void P_SetupSignExit(player_t *player);
boolean P_IsFlagAtBase(mobjtype_t flag);
boolean P_IsMobjTouchingSectorPlane(mobj_t *mo, sector_t *sec);
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec);
boolean P_IsMobjTouchingPolyobj(mobj_t *mo, polyobj_t *po, sector_t *polysec);
void P_SwitchWeather(preciptype_t newWeather);
@ -78,6 +577,12 @@ void P_RunNightsCapsuleTouchExecutors(mobj_t *actor, boolean entering, boolean e
UINT16 P_GetFFloorID(ffloor_t *fflr);
ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id);
// Use this when you don't know the type of your thinker data struct but need to access its thinker.
typedef struct
{
thinker_t thinker;
} thinkerdata_t;
//
// P_LIGHTS
//
@ -89,8 +594,8 @@ typedef struct
sector_t *sector; ///< The sector where action is taking place.
INT32 count;
INT32 resetcount;
INT32 maxlight; ///< The brightest light level to use.
INT32 minlight; ///< The darkest light level to use.
INT16 maxlight; ///< The brightest light level to use.
INT16 minlight; ///< The darkest light level to use.
} fireflicker_t;
typedef struct
@ -118,8 +623,8 @@ typedef struct
thinker_t thinker; ///< The thinker in use for the effect.
sector_t *sector; ///< The sector where the action is taking place.
INT32 count;
INT32 minlight; ///< The minimum light level to use.
INT32 maxlight; ///< The maximum light level to use.
INT16 minlight; ///< The minimum light level to use.
INT16 maxlight; ///< The maximum light level to use.
INT32 darktime; ///< How INT32 to use minlight.
INT32 brighttime; ///< How INT32 to use maxlight.
} strobe_t;
@ -128,10 +633,10 @@ typedef struct
{
thinker_t thinker;
sector_t *sector;
INT32 minlight;
INT32 maxlight;
INT32 direction;
INT32 speed;
INT16 minlight;
INT16 maxlight;
INT16 direction;
INT16 speed;
} glow_t;
/** Thinker struct for fading lights.
@ -157,18 +662,18 @@ typedef struct
void P_RemoveLighting(sector_t *sector);
void T_FireFlicker(fireflicker_t *flick);
fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxsector, INT32 length);
fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *sector, INT16 lighta, INT16 lightb, INT32 length);
void T_LightningFlash(lightflash_t *flash);
void T_StrobeFlash(strobe_t *flash);
void P_SpawnLightningFlash(sector_t *sector);
strobe_t * P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector, INT32 darktime, INT32 brighttime, boolean inSync);
strobe_t * P_SpawnAdjustableStrobeFlash(sector_t *sector, INT16 lighta, INT16 lightb, INT32 darktime, INT32 brighttime, boolean inSync);
void T_Glow(glow_t *g);
glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector, INT32 length);
glow_t *P_SpawnAdjustableGlowingLight(sector_t *sector, INT16 lighta, INT16 lightb, INT32 length);
void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean ticbased);
void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force);
void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force, boolean relative);
void T_LightFade(lightlevel_t *ll);
typedef enum
@ -184,22 +689,19 @@ typedef enum
typedef enum
{
raiseToHighest,
lowerToLowest,
raiseToLowest,
lowerToLowestFast,
instantRaise, // instant-move for ceilings
lowerAndCrush,
crushAndRaise,
fastCrushAndRaise,
raiseAndCrush,
crushCeilOnce,
crushBothOnce,
moveCeilingByFrontSector,
instantMoveCeilingByFrontSector,
moveCeilingByFrontTexture,
moveCeilingByDistance,
bounceCeiling,
bounceCeilingCrush,
@ -215,7 +717,6 @@ typedef struct
fixed_t bottomheight; ///< The lowest height to move to.
fixed_t topheight; ///< The highest height to move to.
fixed_t speed; ///< Ceiling speed.
fixed_t oldspeed;
fixed_t delay;
fixed_t delaytimer;
UINT8 crush; ///< Whether to crush things or not.
@ -224,17 +725,16 @@ typedef struct
INT32 direction; ///< 1 = up, 0 = waiting, -1 = down.
// ID
INT32 tag;
INT32 olddirection;
INT16 tag; ///< Tag of linedef executor to run when movement is done.
fixed_t origspeed; ///< The original, "real" speed.
INT32 sourceline; ///< Index of the source linedef
} ceiling_t;
#define CEILSPEED (FRACUNIT)
INT32 EV_DoCeiling(line_t *line, ceiling_e type);
INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type);
INT32 EV_DoCrush(line_t *line, ceiling_e type);
INT32 EV_DoCrush(mtag_t tag, line_t *line, ceiling_e type);
void T_CrushCeiling(ceiling_t *ceiling);
void T_MoveCeiling(ceiling_t *ceiling);
@ -244,9 +744,6 @@ void T_MoveCeiling(ceiling_t *ceiling);
//
typedef enum
{
// lower floor to lowest surrounding floor
lowerFloorToLowest,
// raise floor to next highest surrounding floor
raiseFloorToNearestFast,
@ -256,7 +753,7 @@ typedef enum
moveFloorByFrontSector,
instantMoveFloorByFrontSector,
moveFloorByFrontTexture,
moveFloorByDistance,
bounceFloor,
bounceFloorCrush,
@ -268,7 +765,6 @@ typedef enum
{
elevateUp,
elevateDown,
elevateCurrent,
elevateContinuous,
elevateBounce,
elevateHighest,
@ -288,6 +784,8 @@ typedef struct
fixed_t origspeed;
fixed_t delay;
fixed_t delaytimer;
INT16 tag;
INT32 sourceline;
} floormove_t;
typedef struct
@ -394,6 +892,7 @@ typedef struct
INT32 delay;
INT16 tag;
UINT16 sound;
INT32 initDelay;
} thwomp_t;
typedef struct
@ -409,7 +908,6 @@ typedef struct
thinker_t thinker;
line_t *sourceline; // Source line of the thinker
boolean playersInArea[MAXPLAYERS];
boolean playersOnArea[MAXPLAYERS];
boolean triggerOnExit;
} eachtime_t;
@ -445,8 +943,8 @@ typedef enum
result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crush,
boolean ceiling, INT32 direction);
void EV_DoFloor(line_t *line, floor_e floortype);
void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed);
void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype);
void EV_DoElevator(mtag_t tag, line_t *line, elevator_e elevtype);
void EV_CrumbleChain(sector_t *sec, ffloor_t *rover);
void EV_BounceSector(sector_t *sector, fixed_t momz, line_t *sourceline);
@ -530,30 +1028,20 @@ void T_Friction(friction_t *f);
typedef enum
{
p_push, ///< Point pusher or puller.
p_wind, ///< Wind.
p_current, ///< Current.
p_upcurrent, ///< Upwards current.
p_downcurrent, ///< Downwards current.
p_upwind, ///< Upwards wind.
p_downwind ///< Downwards wind.
} pushertype_e;
// Model for pushers for push/pull effects
typedef struct
{
thinker_t thinker; ///< Thinker structure for push/pull effect.
/** Types of push/pull effects.
*/
pushertype_e type; ///< Type of push/pull effect.
mobj_t *source; ///< Point source if point pusher/puller.
INT32 x_mag; ///< X strength.
INT32 y_mag; ///< Y strength.
INT32 magnitude; ///< Vector strength for point pusher/puller.
INT32 radius; ///< Effective radius for point pusher/puller.
INT32 x, y, z; ///< Point source if point pusher/puller.
thinker_t thinker; ///< Thinker structure for pusher effect.
pushertype_e type; ///< Type of pusher effect.
fixed_t x_mag; ///< X strength.
fixed_t y_mag; ///< Y strength.
fixed_t z_mag; ///< Z strength.
INT32 affectee; ///< Number of affected sector.
UINT8 roverpusher; ///< flag for whether pusher originated from a FOF or not
UINT8 roverpusher; ///< flag for whether pusher originated from a FOF or not
INT32 referrer; ///< If roverpusher == true, then this will contain the sector # of the control sector where the effect was applied.
INT32 exclusive; /// < Once this affect has been applied to a mobj, no other pushers may affect it.
INT32 slider; /// < Should the player go into an uncontrollable slide?
@ -589,8 +1077,8 @@ typedef struct
INT16 speed; ///< Speed to fade by
boolean ticbased; ///< Tic-based logic toggle
INT32 timer; ///< Timer for tic-based logic
boolean doexists; ///< Handle FF_EXISTS
boolean dotranslucent; ///< Handle FF_TRANSLUCENT
boolean doexists; ///< Handle FOF_EXISTS
boolean dotranslucent; ///< Handle FOF_TRANSLUCENT
boolean dolighting; ///< Handle shadows and light blocks
boolean docolormap; ///< Handle colormaps
boolean docollision; ///< Handle interactive flags
@ -615,9 +1103,8 @@ typedef struct
void T_FadeColormap(fadecolormap_t *d);
// Prototype functions for pushers
// Prototype function for pushers
void T_Pusher(pusher_t *p);
mobj_t *P_GetPushThing(UINT32 s);
// Plane displacement
typedef struct
@ -642,14 +1129,15 @@ void T_PlaneDisplace(planedisplace_t *pd);
void P_CalcHeight(player_t *player);
sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo);
/* line specials */
enum
{
LT_SLOPE_ANCHORS_FLOOR = 777,
LT_SLOPE_ANCHORS_CEILING = 778,
LT_SLOPE_ANCHORS = 779,
LT_SLOPE_ANCHORS = 777,
// binary converter
LT_SLOPE_ANCHORS_OLD_FLOOR = 777,
LT_SLOPE_ANCHORS_OLD_CEILING = 778,
LT_SLOPE_ANCHORS_OLD = 779,
};
#endif

View file

@ -978,20 +978,20 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
for (rover = sec->ffloors; rover; rover = rover->next)
{
// If the FOF doesn't exist, continue.
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
// If the FOF is configured to let the object through, continue.
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
if (!((rover->fofflags & FOF_BLOCKPLAYER && mo->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mo->player)))
continue;
// If the the platform is intangible from below, continue.
if (rover->flags & FF_PLATFORM)
if (rover->fofflags & FOF_PLATFORM)
continue;
// If the FOF is a water block, continue. (Unnecessary check?)
if (rover->flags & FF_SWIMMABLE)
if (rover->fofflags & FOF_SWIMMABLE)
continue;
// Actually check if the player is on the suitable FOF.
@ -1012,20 +1012,20 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
for (rover = sec->ffloors; rover; rover = rover->next)
{
// If the FOF doesn't exist, continue.
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
// If the FOF is configured to let the object through, continue.
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
if (!((rover->fofflags & FOF_BLOCKPLAYER && mo->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mo->player)))
continue;
// If the the platform is intangible from above, continue.
if (rover->flags & FF_REVERSEPLATFORM)
if (rover->fofflags & FOF_REVERSEPLATFORM)
continue;
// If the FOF is a water block, continue. (Unnecessary check?)
if (rover->flags & FF_SWIMMABLE)
if (rover->fofflags & FOF_SWIMMABLE)
continue;
// Actually check if the player is on the suitable FOF.
@ -1403,10 +1403,10 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_QUICKSAND))
if (!(rover->fofflags & FOF_QUICKSAND))
continue;
topheight = P_GetFFloorTopZAt (rover, mo->x, mo->y);
@ -1425,6 +1425,14 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
return false; // No sand here, Captain!
}
static boolean P_PlayerCanBust(player_t *player, ffloor_t *rover)
{
// TODO: Make these act like the Lua SA2 boxes.
(void)player;
(void)rover;
return false;
}
static void P_CheckBustableBlocks(player_t *player)
{
msecnode_t *node;
@ -1437,8 +1445,6 @@ static void P_CheckBustableBlocks(player_t *player)
oldx = player->mo->x;
oldy = player->mo->y;
// SRB2Kart TODO: make shatter blocks the default behavior, we don't need the hundreds of other types
P_UnsetThingPosition(player->mo);
player->mo->x += player->mo->momx;
player->mo->y += player->mo->momy;
@ -1446,90 +1452,86 @@ static void P_CheckBustableBlocks(player_t *player)
for (node = player->mo->touching_sectorlist; node; node = node->m_sectorlist_next)
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
if (!node->m_sector)
break;
if (node->m_sector->ffloors)
if (!node->m_sector->ffloors)
continue;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
if (!P_PlayerCanBust(player, rover))
continue;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
// Height checks
if (rover->bustflags & FB_ONLYBOTTOM)
{
if (!(rover->flags & FF_EXISTS)) continue;
if (player->mo->z + player->mo->momz + player->mo->height < bottomheight)
continue;
if ((rover->flags & FF_BUSTUP)/* && rover->master->frontsector->crumblestate == CRUMBLE_NONE*/)
if (player->mo->z + player->mo->height > bottomheight)
continue;
}
else
{
switch (rover->busttype)
{
// If it's an FF_SHATTER, you can break it just by touching it.
if (rover->flags & FF_SHATTER)
goto bust;
if (rover->flags & FF_STRONGBUST)
case BT_TOUCH:
if (player->mo->z + player->mo->momz > topheight)
continue;
bust:
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
if (player->mo->z + player->mo->momz + player->mo->height < bottomheight)
continue;
// Height checks
if (rover->flags & FF_SHATTERBOTTOM)
{
if (player->mo->z+player->mo->momz + player->mo->height < bottomheight)
continue;
break;
case BT_SPINBUST:
if (player->mo->z + player->mo->momz > topheight)
continue;
if (player->mo->z+player->mo->height > bottomheight)
continue;
}
else if (rover->flags & FF_SPINBUST)
{
if (player->mo->z+player->mo->momz > topheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
}
else if (rover->flags & FF_SHATTER)
{
if (player->mo->z + player->mo->momz > topheight)
continue;
break;
default:
if (player->mo->z >= topheight)
continue;
if (player->mo->z+player->mo->momz + player->mo->height < bottomheight)
continue;
}
else
{
if (player->mo->z >= topheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
}
// Impede the player's fall a bit
if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= topheight)
player->mo->momz >>= 1;
else if (rover->flags & FF_SHATTER)
{
player->mo->momx >>= 1;
player->mo->momy >>= 1;
}
//if (metalrecording)
// G_RecordBustup(rover);
EV_CrumbleChain(NULL, rover); // node->m_sector
// Run a linedef executor??
if (rover->master->flags & ML_EFFECT5)
P_LinedefExecute((INT16)(P_AproxDistance(rover->master->dx, rover->master->dy)>>FRACBITS), player->mo, node->m_sector);
goto bustupdone;
break;
}
}
// Impede the player's fall a bit
if (((rover->busttype == BT_TOUCH) || (rover->busttype == BT_SPINBUST)) && player->mo->z >= topheight)
player->mo->momz >>= 1;
else if (rover->busttype == BT_TOUCH)
{
player->mo->momx >>= 1;
player->mo->momy >>= 1;
}
//if (metalrecording)
// G_RecordBustup(rover);
EV_CrumbleChain(NULL, rover); // node->m_sector
// Run a linedef executor??
if (rover->bustflags & FB_EXECUTOR)
P_LinedefExecute(rover->busttag, player->mo, node->m_sector);
goto bustupdone;
}
}
bustupdone:
bustupdone:
P_UnsetThingPosition(player->mo);
player->mo->x = oldx;
player->mo->y = oldy;
@ -1556,104 +1558,78 @@ static void P_CheckBouncySectors(player_t *player)
for (node = player->mo->touching_sectorlist; node; node = node->m_sectorlist_next)
{
ffloor_t *rover;
if (!node->m_sector)
break;
if (node->m_sector->ffloors)
if (!node->m_sector->ffloors)
continue;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
ffloor_t *rover;
boolean top = true;
fixed_t topheight, bottomheight;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
if (!(rover->fofflags & FOF_EXISTS))
continue; // FOFs should not be bouncy if they don't even "exist"
// Handle deprecated bouncy FOF sector type
if (!udmf && GETSECSPECIAL(rover->master->frontsector->special, 1) == 15)
{
if (!(rover->flags & FF_EXISTS))
continue; // FOFs should not be bouncy if they don't even "exist"
if (GETSECSPECIAL(rover->master->frontsector->special, 1) != 15)
continue; // this sector type is required for FOFs to be bouncy
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
if (player->mo->z > topheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
if (oldz < P_GetFOFTopZ(player->mo, node->m_sector, rover, oldx, oldy, NULL)
&& oldz + player->mo->height > P_GetFOFBottomZ(player->mo, node->m_sector, rover, oldx, oldy, NULL))
top = false;
{
fixed_t linedist;
linedist = P_AproxDistance(rover->master->v1->x-rover->master->v2->x, rover->master->v1->y-rover->master->v2->y);
linedist = FixedDiv(linedist,100*FRACUNIT);
if (top)
{
fixed_t newmom;
pslope_t *slope;
if (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) { // Hit top
slope = *rover->t_slope;
} else { // Hit bottom
slope = *rover->b_slope;
}
momentum.x = player->mo->momx;
momentum.y = player->mo->momy;
momentum.z = player->mo->momz*2;
if (slope)
P_ReverseQuantizeMomentumToSlope(&momentum, slope);
newmom = momentum.z = -FixedMul(momentum.z,linedist)/2;
if (abs(newmom) < (linedist*2))
{
goto bouncydone;
}
if (!(rover->master->flags & ML_NOTBOUNCY))
{
if (newmom > 0)
{
if (newmom < 8*FRACUNIT)
newmom = 8*FRACUNIT;
}
else if (newmom > -8*FRACUNIT && newmom != 0)
newmom = -8*FRACUNIT;
}
if (newmom > player->mo->height/2)
newmom = player->mo->height/2;
else if (newmom < -player->mo->height/2)
newmom = -player->mo->height/2;
momentum.z = newmom*2;
if (slope)
P_QuantizeMomentumToSlope(&momentum, slope);
player->mo->momx = momentum.x;
player->mo->momy = momentum.y;
player->mo->momz = momentum.z/2;
}
else
{
player->mo->momx = -FixedMul(player->mo->momx,linedist);
player->mo->momy = -FixedMul(player->mo->momy,linedist);
}
goto bouncydone;
}
rover->fofflags |= FOF_BOUNCY;
rover->bouncestrength = P_AproxDistance(rover->master->dx, rover->master->dy)/100;
}
if (!(rover->fofflags & FOF_BOUNCY))
continue;
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
if (player->mo->z > topheight)
continue;
if (player->mo->z + player->mo->height < bottomheight)
continue;
if (oldz < P_GetFOFTopZ(player->mo, node->m_sector, rover, oldx, oldy, NULL)
&& oldz + player->mo->height > P_GetFOFBottomZ(player->mo, node->m_sector, rover, oldx, oldy, NULL))
{
player->mo->momx = -FixedMul(player->mo->momx,rover->bouncestrength);
player->mo->momy = -FixedMul(player->mo->momy,rover->bouncestrength);
}
else
{
pslope_t *slope = (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) ? *rover->t_slope : *rover->b_slope;
momentum.x = player->mo->momx;
momentum.y = player->mo->momy;
momentum.z = player->mo->momz*2;
if (slope)
P_ReverseQuantizeMomentumToSlope(&momentum, slope);
momentum.z = -FixedMul(momentum.z,rover->bouncestrength)/2;
if (abs(momentum.z) < (rover->bouncestrength*2))
goto bouncydone;
if (momentum.z > FixedMul(24*FRACUNIT, player->mo->scale)) //half of the default player height
momentum.z = FixedMul(24*FRACUNIT, player->mo->scale);
else if (momentum.z < -FixedMul(24*FRACUNIT, player->mo->scale))
momentum.z = -FixedMul(24*FRACUNIT, player->mo->scale);
if (slope)
P_QuantizeMomentumToSlope(&momentum, slope);
player->mo->momx = momentum.x;
player->mo->momy = momentum.y;
player->mo->momz = momentum.z;
}
goto bouncydone;
}
}
bouncydone:
P_UnsetThingPosition(player->mo);
player->mo->x = oldx;
@ -1673,9 +1649,9 @@ static void P_CheckQuicksand(player_t *player)
for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)) continue;
if (!(rover->fofflags & FOF_EXISTS)) continue;
if (!(rover->flags & FF_QUICKSAND))
if (!(rover->fofflags & FOF_QUICKSAND))
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
@ -3546,7 +3522,7 @@ static void P_CalcPostImg(player_t *player)
{
size_t j;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
@ -3579,7 +3555,7 @@ static void P_CalcPostImg(player_t *player)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKPLAYER)
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);

View file

@ -41,30 +41,36 @@ drawseg_t *ds_p = NULL;
// indicates doors closed wrt automap bugfix:
INT32 doorclosed;
boolean R_NoEncore(sector_t *sector, boolean ceiling)
boolean R_NoEncore(sector_t *sector, levelflat_t *flat, boolean ceiling)
{
boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15);
#if 0 // perfect implementation
INT32 val = GETSECSPECIAL(sector->special, 3);
//if (val != 1 && val != 3 // spring panel
#else // optimised, see #define GETSECSPECIAL(i,j) ((i >> ((j-1)*4))&15)
if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel
#endif
&& GETSECSPECIAL(sector->special, 4) != 6) // sneaker panel
return invertencore;
const boolean invertEncore = (sector->flags & MSF_INVERTENCORE);
const terrain_t *terrain = (flat != NULL ? flat->terrain : NULL);
if (invertencore)
if ((terrain == NULL)
|| (terrain->trickPanel <= 0
&& terrain->speedPad <= 0
&& !(terrain->flags & TRF_SNEAKERPANEL)))
{
return invertEncore;
}
if (invertEncore)
{
return false;
}
if (ceiling)
return ((boolean)(sector->flags & SF_FLIPSPECIAL_CEILING));
return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR));
{
return ((boolean)(sector->flags & MSF_FLIPSPECIAL_CEILING));
}
return ((boolean)(sector->flags & MSF_FLIPSPECIAL_FLOOR));
}
boolean R_IsRipplePlane(sector_t *sector, ffloor_t *rover, int ceiling)
{
return rover ? rover->flags & FF_RIPPLE :
sector->flags & (SF_RIPPLE_FLOOR << ceiling);
return rover ? (rover->fofflags & FOF_RIPPLE) :
(sector->flags & (MSF_RIPPLE_FLOOR << ceiling));
}
//
@ -265,11 +271,11 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
{
if (floorlightlevel)
*floorlightlevel = sec->floorlightsec == -1 ?
sec->lightlevel : sectors[sec->floorlightsec].lightlevel;
(sec->floorlightabsolute ? sec->floorlightlevel : max(0, min(255, sec->lightlevel + sec->floorlightlevel))) : sectors[sec->floorlightsec].lightlevel;
if (ceilinglightlevel)
*ceilinglightlevel = sec->ceilinglightsec == -1 ?
sec->lightlevel : sectors[sec->ceilinglightsec].lightlevel;
(sec->ceilinglightabsolute ? sec->ceilinglightlevel : max(0, min(255, sec->lightlevel + sec->ceilinglightlevel))) : sectors[sec->ceilinglightsec].lightlevel;
// if (sec->midmap != -1)
// mapnum = sec->midmap;
@ -335,11 +341,11 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
tempsec->lightlevel = s->lightlevel;
if (floorlightlevel)
*floorlightlevel = s->floorlightsec == -1 ? s->lightlevel
*floorlightlevel = s->floorlightsec == -1 ? (s->floorlightabsolute ? s->floorlightlevel : max(0, min(255, s->lightlevel + s->floorlightlevel)))
: sectors[s->floorlightsec].lightlevel;
if (ceilinglightlevel)
*ceilinglightlevel = s->ceilinglightsec == -1 ? s->lightlevel
*ceilinglightlevel = s->ceilinglightsec == -1 ? (s->ceilinglightabsolute ? s->ceilinglightlevel : max(0, min(255, s->lightlevel + s->ceilinglightlevel)))
: sectors[s->ceilinglightsec].lightlevel;
}
else if (heightsec != -1 && viewz >= sectors[heightsec].ceilingheight
@ -373,12 +379,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
tempsec->lightlevel = s->lightlevel;
if (floorlightlevel)
*floorlightlevel = s->floorlightsec == -1 ? s->lightlevel :
sectors[s->floorlightsec].lightlevel;
*floorlightlevel = s->floorlightsec == -1 ? (s->floorlightabsolute ? s->floorlightlevel : max(0, min(255, s->lightlevel + s->floorlightlevel)))
: sectors[s->floorlightsec].lightlevel;
if (ceilinglightlevel)
*ceilinglightlevel = s->ceilinglightsec == -1 ? s->lightlevel :
sectors[s->ceilinglightsec].lightlevel;
*ceilinglightlevel = s->ceilinglightsec == -1 ? (s->ceilinglightabsolute ? s->ceilinglightlevel : max(0, min(255, s->lightlevel + s->ceilinglightlevel)))
: sectors[s->ceilinglightsec].lightlevel;
}
sec = tempsec;
}
@ -404,6 +410,10 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
&& back->ceiling_yoffs == front->ceiling_yoffs
&& back->ceilingpic_angle == front->ceilingpic_angle
// Consider altered lighting.
&& back->floorlightlevel == front->floorlightlevel
&& back->floorlightabsolute == front->floorlightabsolute
&& back->ceilinglightlevel == front->ceilinglightlevel
&& back->ceilinglightabsolute == front->ceilinglightabsolute
&& back->floorlightsec == front->floorlightsec
&& back->ceilinglightsec == front->ceilinglightsec
// Consider colormaps
@ -923,12 +933,12 @@ static void R_Subsector(size_t num)
}
light = R_GetPlaneLight(frontsector, floorcenterz, false);
if (frontsector->floorlightsec == -1)
floorlightlevel = *frontsector->lightlist[light].lightlevel;
if (frontsector->floorlightsec == -1 && !frontsector->floorlightabsolute)
floorlightlevel = max(0, min(255, *frontsector->lightlist[light].lightlevel + frontsector->floorlightlevel));
floorcolormap = *frontsector->lightlist[light].extra_colormap;
light = R_GetPlaneLight(frontsector, ceilingcenterz, false);
if (frontsector->ceilinglightsec == -1)
ceilinglightlevel = *frontsector->lightlist[light].lightlevel;
if (frontsector->ceilinglightsec == -1 && !frontsector->ceilinglightabsolute)
ceilinglightlevel = max(0, min(255, *frontsector->lightlist[light].lightlevel + frontsector->ceilinglightlevel));
ceilingcolormap = *frontsector->lightlist[light].extra_colormap;
}
@ -942,7 +952,7 @@ static void R_Subsector(size_t num)
frontsector->floorheight, frontsector->floorpic, floorlightlevel,
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle,
floorcolormap, NULL, NULL, frontsector->f_slope,
R_NoEncore(frontsector, false),
R_NoEncore(frontsector, &levelflats[frontsector->floorpic], false),
R_IsRipplePlane(frontsector, NULL, false),
false
);
@ -958,7 +968,7 @@ static void R_Subsector(size_t num)
frontsector->ceilingheight, frontsector->ceilingpic, ceilinglightlevel,
frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
ceilingcolormap, NULL, NULL, frontsector->c_slope,
R_NoEncore(frontsector, true),
R_NoEncore(frontsector, &levelflats[frontsector->ceilingpic], true),
R_IsRipplePlane(frontsector, NULL, true),
true
);
@ -976,7 +986,7 @@ static void R_Subsector(size_t num)
for (rover = frontsector->ffloors; rover && numffloors < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (frontsector->cullheight)
@ -996,8 +1006,8 @@ static void R_Subsector(size_t num)
planecenterz = P_GetFFloorBottomZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y);
if (planecenterz <= ceilingcenterz
&& planecenterz >= floorcenterz
&& ((viewz < heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz > heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
&& ((viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES)))
|| (viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
light = R_GetPlaneLight(frontsector, planecenterz,
viewz < heightcheck);
@ -1006,7 +1016,7 @@ static void R_Subsector(size_t num)
*rover->bottomheight, *rover->bottompic,
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->b_slope,
R_NoEncore(rover->master->frontsector, true),
R_NoEncore(rover->master->frontsector, &levelflats[*rover->bottompic], true),
R_IsRipplePlane(rover->master->frontsector, rover, true),
true
);
@ -1031,8 +1041,8 @@ static void R_Subsector(size_t num)
planecenterz = P_GetFFloorTopZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y);
if (planecenterz >= floorcenterz
&& planecenterz <= ceilingcenterz
&& ((viewz > heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz < heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
&& ((viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES)))
|| (viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
light = R_GetPlaneLight(frontsector, planecenterz, viewz < heightcheck);
@ -1040,7 +1050,7 @@ static void R_Subsector(size_t num)
*rover->topheight, *rover->toppic,
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
*frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->t_slope,
R_NoEncore(rover->master->frontsector, false),
R_NoEncore(rover->master->frontsector, &levelflats[*rover->toppic], false),
R_IsRipplePlane(rover->master->frontsector, rover, false),
false
);
@ -1090,7 +1100,7 @@ static void R_Subsector(size_t num)
polysec->floorpic_angle-po->angle,
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
NULL, // will ffloors be slopable eventually?
R_NoEncore(polysec, false),
R_NoEncore(polysec, &levelflats[polysec->floorpic], false),
false, /* TODO: wet polyobjects? */
true
);
@ -1119,7 +1129,7 @@ static void R_Subsector(size_t num)
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
NULL, // will ffloors be slopable eventually?
R_NoEncore(polysec, true),
R_NoEncore(polysec, &levelflats[polysec->ceilingpic], true),
false, /* TODO: wet polyobjects? */
false
);
@ -1185,11 +1195,11 @@ void R_Prep3DFloors(sector_t *sector)
count = 1;
for (rover = sector->ffloors; rover; rover = rover->next)
{
if ((rover->flags & FF_EXISTS) && (!(rover->flags & FF_NOSHADE)
|| (rover->flags & FF_CUTLEVEL) || (rover->flags & FF_CUTSPRITES)))
if ((rover->fofflags & FOF_EXISTS) && (!(rover->fofflags & FOF_NOSHADE)
|| (rover->fofflags & FOF_CUTLEVEL) || (rover->fofflags & FOF_CUTSPRITES)))
{
count++;
if (rover->flags & FF_DOUBLESHADOW)
if (rover->fofflags & FOF_DOUBLESHADOW)
count++;
}
}
@ -1220,8 +1230,8 @@ void R_Prep3DFloors(sector_t *sector)
for (rover = sector->ffloors; rover; rover = rover->next)
{
rover->lastlight = 0;
if (!(rover->flags & FF_EXISTS) || (rover->flags & FF_NOSHADE
&& !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES)))
if (!(rover->fofflags & FOF_EXISTS) || (rover->fofflags & FOF_NOSHADE
&& !(rover->fofflags & FOF_CUTLEVEL) && !(rover->fofflags & FOF_CUTSPRITES)))
continue;
heighttest = P_GetFFloorTopZAt(rover, sector->soundorg.x, sector->soundorg.y);
@ -1233,7 +1243,7 @@ void R_Prep3DFloors(sector_t *sector)
bestslope = *rover->t_slope;
continue;
}
if (rover->flags & FF_DOUBLESHADOW) {
if (rover->fofflags & FOF_DOUBLESHADOW) {
heighttest = P_GetFFloorBottomZAt(rover, sector->soundorg.x, sector->soundorg.y);
if (heighttest > bestheight
@ -1254,16 +1264,16 @@ void R_Prep3DFloors(sector_t *sector)
sector->lightlist[i].height = maxheight = bestheight;
sector->lightlist[i].caster = best;
sector->lightlist[i].flags = best->flags;
sector->lightlist[i].flags = best->fofflags;
sector->lightlist[i].slope = bestslope;
sec = &sectors[best->secnum];
if (best->flags & FF_NOSHADE)
if (best->fofflags & FOF_NOSHADE)
{
sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel;
sector->lightlist[i].extra_colormap = sector->lightlist[i-1].extra_colormap;
}
else if (best->flags & FF_COLORMAPONLY)
else if (best->fofflags & FOF_COLORMAPONLY)
{
sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel;
sector->lightlist[i].extra_colormap = &sec->extra_colormap;
@ -1274,7 +1284,7 @@ void R_Prep3DFloors(sector_t *sector)
sector->lightlist[i].extra_colormap = &sec->extra_colormap;
}
if (best->flags & FF_DOUBLESHADOW)
if (best->fofflags & FOF_DOUBLESHADOW)
{
heighttest = P_GetFFloorBottomZAt(best, sector->soundorg.x, sector->soundorg.y);
if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red

View file

@ -42,7 +42,7 @@ void R_RenderBSPNode(INT32 bspnum);
// determines when a given sector shouldn't abide by the encoremap's palette.
// no longer a static since this is used for encore in hw_main.c as well now:
boolean R_NoEncore(sector_t *sector, boolean ceiling);
boolean R_NoEncore(sector_t *sector, levelflat_t *flat, boolean ceiling);
boolean R_IsRipplePlane(sector_t *sector, ffloor_t *rover, int ceiling);

View file

@ -115,45 +115,99 @@ typedef struct
*/
typedef enum
{
FF_EXISTS = 0x1, ///< Always set, to check for validity.
FF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else
FF_BLOCKOTHERS = 0x4, ///< Solid to everything but player
FF_SOLID = 0x6, ///< Clips things.
FF_RENDERSIDES = 0x8, ///< Renders the sides.
FF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling.
FF_RENDERALL = 0x18, ///< Renders everything.
FF_SWIMMABLE = 0x20, ///< Is a water block.
FF_NOSHADE = 0x40, ///< Messes with the lighting?
FF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels.
FF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels.
FF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels.
FF_CUTSPRITES = 0x200, ///< Final step in making 3D water.
FF_BOTHPLANES = 0x400, ///< Render inside and outside planes.
FF_EXTRA = 0x800, ///< Gets cut by ::FF_CUTEXTRA.
FF_TRANSLUCENT = 0x1000, ///< See through!
FF_FOG = 0x2000, ///< Fog "brush."
FF_INVERTPLANES = 0x4000, ///< Only render inside planes.
FF_ALLSIDES = 0x8000, ///< Render inside and outside sides.
FF_INVERTSIDES = 0x10000, ///< Only render inside sides.
FF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light?
FF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it.
FF_NORETURN = 0x80000, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling.
FF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
FF_SHATTERBOTTOM = 0x200000, ///< Used with ::FF_BUSTUP. Like FF_SHATTER, but only breaks from the bottom. Good for springing up through rubble.
FF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
FF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble!
FF_QUICKSAND = 0x1000000, ///< Quicksand!
FF_PLATFORM = 0x2000000, ///< You can jump up through this to the top.
FF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
FF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid.
FF_SHATTER = 0x8000000, ///< Used with ::FF_BUSTUP. Bustable on mere touch.
FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames.
FF_STRONGBUST = 0x20000000, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee).
FF_RIPPLE = 0x40000000, ///< Ripple the flats
FF_COLORMAPONLY = (INT32)0x80000000, ///< Only copy the colormap, not the lightlevel
FF_GOOWATER = FF_SHATTERBOTTOM, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
FOF_EXISTS = 0x1, ///< Always set, to check for validity.
FOF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else
FOF_BLOCKOTHERS = 0x4, ///< Solid to everything but player
FOF_SOLID = 0x6, ///< Clips things.
FOF_RENDERSIDES = 0x8, ///< Renders the sides.
FOF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling.
FOF_RENDERALL = 0x18, ///< Renders everything.
FOF_SWIMMABLE = 0x20, ///< Is a water block.
FOF_NOSHADE = 0x40, ///< Messes with the lighting?
FOF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels.
FOF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels.
FOF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels.
FOF_CUTSPRITES = 0x200, ///< Final step in making 3D water.
FOF_BOTHPLANES = 0x400, ///< Render inside and outside planes.
FOF_EXTRA = 0x800, ///< Gets cut by ::FOF_CUTEXTRA.
FOF_TRANSLUCENT = 0x1000, ///< See through!
FOF_FOG = 0x2000, ///< Fog "brush."
FOF_INVERTPLANES = 0x4000, ///< Only render inside planes.
FOF_ALLSIDES = 0x8000, ///< Render inside and outside sides.
FOF_INVERTSIDES = 0x10000, ///< Only render inside sides.
FOF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light?
FOF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it.
FOF_NORETURN = 0x80000, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling.
FOF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
FOF_GOOWATER = 0x200000, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop.
FOF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
FOF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble!
FOF_QUICKSAND = 0x1000000, ///< Quicksand!
FOF_PLATFORM = 0x2000000, ///< You can jump up through this to the top.
FOF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
FOF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid.
FOF_RIPPLE = 0x8000000, ///< Ripple the flats
FOF_COLORMAPONLY = 0x10000000, ///< Only copy the colormap, not the lightlevel
FOF_BOUNCY = 0x20000000, ///< Bounces players
FOF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible)
} ffloortype_e;
typedef enum
{
FF_OLD_EXISTS = 0x1,
FF_OLD_BLOCKPLAYER = 0x2,
FF_OLD_BLOCKOTHERS = 0x4,
FF_OLD_SOLID = 0x6,
FF_OLD_RENDERSIDES = 0x8,
FF_OLD_RENDERPLANES = 0x10,
FF_OLD_RENDERALL = 0x18,
FF_OLD_SWIMMABLE = 0x20,
FF_OLD_NOSHADE = 0x40,
FF_OLD_CUTSOLIDS = 0x80,
FF_OLD_CUTEXTRA = 0x100,
FF_OLD_CUTLEVEL = 0x180,
FF_OLD_CUTSPRITES = 0x200,
FF_OLD_BOTHPLANES = 0x400,
FF_OLD_EXTRA = 0x800,
FF_OLD_TRANSLUCENT = 0x1000,
FF_OLD_FOG = 0x2000,
FF_OLD_INVERTPLANES = 0x4000,
FF_OLD_ALLSIDES = 0x8000,
FF_OLD_INVERTSIDES = 0x10000,
FF_OLD_DOUBLESHADOW = 0x20000,
FF_OLD_FLOATBOB = 0x40000,
FF_OLD_NORETURN = 0x80000,
FF_OLD_CRUMBLE = 0x100000,
FF_OLD_SHATTERBOTTOM = 0x200000,
FF_OLD_GOOWATER = 0x200000,
FF_OLD_MARIO = 0x400000,
FF_OLD_BUSTUP = 0x800000,
FF_OLD_QUICKSAND = 0x1000000,
FF_OLD_PLATFORM = 0x2000000,
FF_OLD_REVERSEPLATFORM = 0x4000000,
FF_OLD_INTANGIBLEFLATS = 0x6000000,
FF_OLD_SHATTER = 0x8000000,
FF_OLD_SPINBUST = 0x10000000,
FF_OLD_STRONGBUST = 0x20000000,
FF_OLD_RIPPLE = 0x40000000,
FF_OLD_COLORMAPONLY = (INT32)0x80000000,
} oldffloortype_e;
typedef enum
{
FB_PUSHABLES = 0x1, // Bustable by pushables
FB_EXECUTOR = 0x2, // Trigger linedef executor
FB_ONLYBOTTOM = 0x4, // Only bustable from below
} ffloorbustflags_e;
typedef enum
{
BT_TOUCH,
BT_SPINBUST,
BT_REGULAR,
BT_STRONG,
} busttype_e;
typedef struct ffloor_s
{
fixed_t *topheight;
@ -174,7 +228,7 @@ typedef struct ffloor_s
struct pslope_s **b_slope;
size_t secnum;
ffloortype_e flags;
ffloortype_e fofflags;
struct line_s *master;
struct sector_s *target;
@ -187,6 +241,18 @@ typedef struct ffloor_s
UINT8 blend;
tic_t norender; // for culling
// Only relevant for FOF_BUSTUP
ffloorbustflags_e bustflags;
UINT8 busttype;
INT16 busttag;
// Only relevant for FOF_QUICKSAND
fixed_t sinkspeed;
fixed_t friction;
// Only relevant for FOF_BOUNCY
fixed_t bouncestrength;
// these are saved for netgames, so do not let Lua touch these!
ffloortype_e spawnflags; // flags the 3D floor spawned with
INT32 spawnalpha; // alpha the 3D floor spawned with
@ -205,7 +271,7 @@ typedef struct lightlist_s
extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes
INT32 flags;
ffloor_t *caster;
struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
struct pslope_s *slope; // FOF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
} lightlist_t;
@ -262,19 +328,63 @@ typedef struct pslope_s
typedef enum
{
// flipspecial - planes with effect
SF_FLIPSPECIAL_FLOOR = 1,
SF_FLIPSPECIAL_CEILING = 1<<1,
SF_FLIPSPECIAL_BOTH = (SF_FLIPSPECIAL_FLOOR|SF_FLIPSPECIAL_CEILING),
MSF_FLIPSPECIAL_FLOOR = 1,
MSF_FLIPSPECIAL_CEILING = 1<<1,
MSF_FLIPSPECIAL_BOTH = (MSF_FLIPSPECIAL_FLOOR|MSF_FLIPSPECIAL_CEILING),
// triggerspecial - conditions under which plane touch causes effect
SF_TRIGGERSPECIAL_TOUCH = 1<<2,
SF_TRIGGERSPECIAL_HEADBUMP = 1<<3,
MSF_TRIGGERSPECIAL_TOUCH = 1<<2,
MSF_TRIGGERSPECIAL_HEADBUMP = 1<<3,
// triggerline - conditions for linedef executor triggering
MSF_TRIGGERLINE_PLANE = 1<<4, // require plane touch
MSF_TRIGGERLINE_MOBJ = 1<<5, // allow non-pushable mobjs to trigger
// invertprecip - inverts presence of precipitation
SF_INVERTPRECIP = 1<<4,
MSF_INVERTPRECIP = 1<<6,
MSF_GRAVITYFLIP = 1<<7,
MSF_HEATWAVE = 1<<8,
MSF_NOCLIPCAMERA = 1<<9,
// water ripple
SF_RIPPLE_FLOOR = 1<<5,
SF_RIPPLE_CEILING = 1<<6,
MSF_RIPPLE_FLOOR = 1<<10,
MSF_RIPPLE_CEILING = 1<<11,
// invert encore color remap status
MSF_INVERTENCORE = 1<<12,
} sectorflags_t;
typedef enum
{
SSF_NOSTEPUP = 1,
SSF_DOUBLESTEPUP = 1<<1,
SSF_NOSTEPDOWN = 1<<2,
SSF_WINDCURRENT = 1<<3,
SSF_CONVEYOR = 1<<4,
// free: 1<<5,
SSF_STARPOSTACTIVATOR = 1<<6,
SSF_EXIT = 1<<7,
SSF_DELETEITEMS = 1<<8,
// free: 1<<9,
// free: 1<<10,
// free: 1<<11,
SSF_FAN = 1<<12,
// free: 1<<13,
// free: 1<<14,
SSF_ZOOMTUBESTART = 1<<15,
SSF_ZOOMTUBEEND = 1<<16,
} sectorspecialflags_t;
typedef enum
{
SD_NONE = 0,
SD_GENERIC = 1,
SD_LAVA = 2,
SD_DEATHPIT = 3,
SD_INSTAKILL = 4,
} sectordamage_t;
typedef enum
{
TO_PLAYER = 0,
TO_ALLPLAYERS = 1,
TO_MOBJ = 2,
} triggerobject_t;
typedef enum
{
@ -326,7 +436,11 @@ typedef struct sector_s
INT32 heightsec; // other sector, or -1 if no other sector
INT32 camsec; // used for camera clipping
INT32 floorlightsec, ceilinglightsec;
// floor and ceiling lighting
INT16 floorlightlevel, ceilinglightlevel;
boolean floorlightabsolute, ceilinglightabsolute; // absolute or relative to sector's light level?
INT32 floorlightsec, ceilinglightsec; // take floor/ceiling light level from another sector
INT32 crumblestate; // used for crumbling and bobbing
// list of mobjs that are at least partially in the sector
@ -350,10 +464,20 @@ typedef struct sector_s
extracolormap_t *extra_colormap;
boolean colormap_protected;
// This points to the master's floorheight, so it can be changed in realtime!
fixed_t *gravity; // per-sector gravity
boolean verticalflip; // If gravity < 0, then allow flipped physics
fixed_t gravity; // per-sector gravity factor
fixed_t *gravityptr; // For binary format: Read gravity from floor height of master sector
sectorflags_t flags;
sectorspecialflags_t specialflags;
UINT8 damagetype;
fixed_t offroad; // Ring Racers
// Linedef executor triggering
mtag_t triggertag; // tag to call upon triggering
UINT8 triggerer; // who can trigger?
fixed_t friction;
// Sprite culling feature
struct line_s *cullheight;
@ -390,7 +514,7 @@ typedef enum
#define HORIZONSPECIAL 41
#define NUMLINEARGS 6
#define NUMLINEARGS 10
#define NUMLINESTRINGARGS 2
typedef struct line_s
@ -400,9 +524,10 @@ typedef struct line_s
vertex_t *v2;
fixed_t dx, dy; // Precalculated v2 - v1 for side checking.
angle_t angle; // Precalculated angle between dx and dy
// Animation related.
INT16 flags;
UINT32 flags;
INT16 special;
taglist_t tags;
INT32 args[NUMLINEARGS];
@ -411,6 +536,7 @@ typedef struct line_s
// Visual appearance: sidedefs.
UINT16 sidenum[2]; // sidenum[1] will be 0xffff if one-sided
fixed_t alpha; // translucency
UINT8 blendmode; // blendmode
INT32 executordelay;
fixed_t bbox[4]; // bounding box for the extent of the linedef
@ -739,7 +865,7 @@ typedef struct
#endif
// Possible alpha types for a patch.
typedef enum {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY} patchalphastyle_t;
typedef enum {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY, AST_FOG} patchalphastyle_t;
typedef enum
{

View file

@ -2485,7 +2485,7 @@ void R_DrawColumnShadowed_8(void)
{
// If the height of the light is above the column, get the colormap
// anyway because the lighting of the top should be affected.
solid = dc_lightlist[i].flags & FF_CUTSOLIDS;
solid = dc_lightlist[i].flags & FOF_CUTSOLIDS;
height = dc_lightlist[i].height >> LIGHTSCALESHIFT;
if (solid)

View file

@ -452,7 +452,7 @@ fixed_t R_ScaleFromGlobalAngle(angle_t visangle)
// R_DoCulling
// Checks viewz and top/bottom heights of an item against culling planes
// Returns true if the item is to be culled, i.e it shouldn't be drawn!
// if ML_NOCLIMB is set, the camera view is required to be in the same area for culling to occur
// if args[1] is set, the camera view is required to be in the same area for culling to occur
boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixed_t bottomh, fixed_t toph)
{
fixed_t cullplane;
@ -461,7 +461,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
return false;
cullplane = cullheight->frontsector->floorheight;
if (cullheight->flags & ML_NOCLIMB) // Group culling
if (cullheight->args[1]) // Group culling
{
if (!viewcullheight)
return false;

View file

@ -872,13 +872,13 @@ void R_DrawSinglePlane(visplane_t *pl)
// Don't draw planes that shouldn't be drawn.
for (rover = pl->ffloor->target->ffloors; rover; rover = rover->next)
{
if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA))
if ((pl->ffloor->fofflags & FOF_CUTEXTRA) && (rover->fofflags & FOF_EXTRA))
{
if (pl->ffloor->flags & FF_EXTRA)
if (pl->ffloor->fofflags & FOF_EXTRA)
{
// The plane is from an extra 3D floor... Check the flags so
// there are no undesired cuts.
if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE)))
if (((pl->ffloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)) == (rover->fofflags & (FOF_FOG|FOF_SWIMMABLE)))
&& pl->height < *rover->topheight
&& pl->height > *rover->bottomheight)
return;
@ -886,9 +886,9 @@ void R_DrawSinglePlane(visplane_t *pl)
}
}
if (pl->ffloor->flags & FF_TRANSLUCENT)
if (pl->ffloor->fofflags & FOF_TRANSLUCENT)
{
spanfunctype = (pl->ffloor->master->flags & ML_EFFECT6) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS;
spanfunctype = (pl->ffloor->fofflags & FOF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS;
// Hacked up support for alpha value in software mode Tails 09-24-2002
// ...unhacked by toaster 04-01-2021
@ -905,7 +905,7 @@ void R_DrawSinglePlane(visplane_t *pl)
else
light = LIGHTLEVELS-1;
}
else if (pl->ffloor->flags & FF_FOG)
else if (pl->ffloor->fofflags & FOF_FOG)
{
spanfunctype = SPANDRAWFUNC_FOG;
light = (pl->lightlevel >> LIGHTSEGSHIFT);

View file

@ -130,12 +130,15 @@ static void R_Render2sidedMultiPatchColumn(column_t *column, column_t *brightmap
}
}
transnum_t R_GetLinedefTransTable(line_t *ldef)
transnum_t R_GetLinedefTransTable(fixed_t alpha)
{
transnum_t transnum = NUMTRANSMAPS; // Send back NUMTRANSMAPS for none
fixed_t alpha = ldef->alpha;
if (alpha > 0 && alpha < FRACUNIT)
{
transnum = (20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1);
}
return transnum;
}
@ -172,41 +175,27 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (!ldef->alpha)
return;
transtable = R_GetLinedefTransTable(ldef);
if (ldef->special == 910 || P_IsLineTripWire(ldef))
{
if (transtable == NUMTRANSMAPS)
transtable = 0;
blendmode = AST_ADD;
}
else if (ldef->special == 911)
{
if (transtable == NUMTRANSMAPS)
transtable = 0;
blendmode = AST_SUBTRACT;
}
else if (ldef->special == 912)
{
if (transtable == NUMTRANSMAPS)
transtable = 0;
blendmode = AST_REVERSESUBTRACT;
}
else if (ldef->special == 913)
transtable = R_GetLinedefTransTable(ldef->alpha);
blendmode = ldef->blendmode;
if (transtable == NUMTRANSMAPS
|| blendmode == AST_MODULATE
|| blendmode == AST_FOG)
{
transtable = 0;
blendmode = AST_MODULATE;
}
if (transtable != NUMTRANSMAPS && (blendmode || transtable))
{
dc_transmap = R_GetBlendTable(blendmode, transtable);
R_SetColumnFunc(COLDRAWFUNC_FUZZY, bmnum != 0);
}
else if (ldef->special == 909)
if (blendmode == AST_FOG)
{
R_SetColumnFunc(COLDRAWFUNC_FOG, bmnum != 0);
windowtop = frontsector->ceilingheight;
windowbottom = frontsector->floorheight;
}
else if (transtable != NUMTRANSMAPS && (blendmode || transtable))
{
dc_transmap = R_GetBlendTable(blendmode, transtable);
R_SetColumnFunc(COLDRAWFUNC_FUZZY, bmnum != 0);
}
else
{
R_SetColumnFunc(BASEDRAWFUNC, bmnum != 0);
@ -281,7 +270,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
rlight->flags = light->flags;
if ((R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == false)
|| (rlight->flags & FF_FOG)
|| (rlight->flags & FOF_FOG)
|| (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
else
@ -334,7 +323,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (ds->curline->sidedef->repeatcnt)
repeats = 1 + ds->curline->sidedef->repeatcnt;
else if (ldef->flags & ML_EFFECT5)
else if (ldef->flags & ML_WRAPMIDTEX)
{
fixed_t high, low;
@ -378,7 +367,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
{
dc_texturemid = ds->maskedtextureheight[dc_x];
if (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3))
if (curline->linedef->flags & ML_MIDPEG)
dc_texturemid += (textureheight[texnum])*times + textureheight[texnum];
else
dc_texturemid -= (textureheight[texnum])*times;
@ -421,7 +410,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
{
rlight = &dc_lightlist[i];
if ((rlight->flags & FF_NOSHADE))
if ((rlight->flags & FOF_NOSHADE))
continue;
if (rlight->lightnum < 0)
@ -602,7 +591,7 @@ static boolean R_IsFFloorTranslucent(visffloor_t *pfloor)
// Polyobjects have no ffloors, and they're handled in the conditional above.
if (pfloor->ffloor != NULL)
return (pfloor->ffloor->flags & (FF_TRANSLUCENT|FF_FOG));
return (pfloor->ffloor->fofflags & (FOF_TRANSLUCENT|FOF_FOG));
return false;
}
@ -659,7 +648,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
bmnum = R_GetTextureBrightmap(texnum);
}
if (pfloor->flags & FF_TRANSLUCENT)
if (pfloor->fofflags & FOF_TRANSLUCENT)
{
boolean fuzzy = true;
@ -678,7 +667,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
R_SetColumnFunc(COLDRAWFUNC_FUZZY, bmnum != 0);
}
}
else if (pfloor->flags & FF_FOG)
else if (pfloor->fofflags & FOF_FOG)
{
R_SetColumnFunc(COLDRAWFUNC_FOG, bmnum != 0);
}
@ -743,7 +732,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
else rlight->heightstep = CLAMPMIN;
rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
rlight->flags = light->flags;
if (light->flags & FF_CUTLEVEL)
if (light->flags & FOF_CUTLEVEL)
{
SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight)
#undef SLOPEPARAMS
@ -767,12 +756,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
rlight->extra_colormap = *light->extra_colormap;
// Check if the current light effects the colormap/lightlevel
if (pfloor->flags & FF_FOG)
if (pfloor->fofflags & FOF_FOG)
rlight->lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
else
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
if (pfloor->fofflags & FOF_FOG || rlight->flags & FOF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
;
else if (P_ApplyLightOffset(rlight->lightnum))
rlight->lightnum += curline->lightOffset;
@ -787,7 +776,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
// Get correct light level!
if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
else if (pfloor->flags & FF_FOG)
else if (pfloor->fofflags & FOF_FOG)
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
else if (R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == true)
lightnum = LIGHTLEVELS-1;
@ -795,7 +784,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
->lightlevel >> LIGHTSEGSHIFT;
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
if (pfloor->fofflags & FOF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
;
else if (P_ApplyLightOffset(lightnum))
lightnum += curline->lightOffset;
@ -821,10 +810,10 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
skewslope = *pfloor->t_slope; // skew using top slope by default
if (newline)
{
if (newline->flags & ML_DONTPEGTOP)
if (newline->flags & ML_SKEWTD)
slopeskew = true;
}
else if (pfloor->master->flags & ML_DONTPEGTOP)
else if (pfloor->master->flags & ML_SKEWTD)
slopeskew = true;
if (slopeskew)
@ -859,7 +848,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (slopeskew)
{
angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y);
angle_t lineangle = curline->angle;
if (skewslope)
ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT));
@ -943,7 +932,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
rlight = &dc_lightlist[i];
rlight->height += rlight->heightstep;
if (rlight->flags & FF_CUTLEVEL)
if (rlight->flags & FOF_CUTLEVEL)
rlight->botheight += rlight->botheightstep;
}
}
@ -971,7 +960,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
// Check if the current light effects the colormap/lightlevel
rlight = &dc_lightlist[i];
lighteffect = !(dc_lightlist[i].flags & FF_NOSHADE);
lighteffect = !(dc_lightlist[i].flags & FOF_NOSHADE);
if (lighteffect)
{
lightnum = rlight->lightnum;
@ -988,7 +977,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE-1;
if (pfloor->flags & FF_FOG)
if (pfloor->fofflags & FOF_FOG)
{
if (pfloor->master->frontsector->extra_colormap)
rlight->rcolormap = pfloor->master->frontsector->extra_colormap->colormap + (xwalllights[pindex] - colormaps);
@ -1007,15 +996,15 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
solid = 0; // don't carry over solid-cutting flag from the previous light
// Check if the current light can cut the current 3D floor.
if (rlight->flags & FF_CUTSOLIDS && !(pfloor->flags & FF_EXTRA))
if (rlight->flags & FOF_CUTSOLIDS && !(pfloor->fofflags & FOF_EXTRA))
solid = 1;
else if (rlight->flags & FF_CUTEXTRA && pfloor->flags & FF_EXTRA)
else if (rlight->flags & FOF_CUTEXTRA && pfloor->fofflags & FOF_EXTRA)
{
if (rlight->flags & FF_EXTRA)
if (rlight->flags & FOF_EXTRA)
{
// The light is from an extra 3D floor... Check the flags so
// there are no undesired cuts.
if ((rlight->flags & (FF_FOG|FF_SWIMMABLE)) == (pfloor->flags & (FF_FOG|FF_SWIMMABLE)))
if ((rlight->flags & (FOF_FOG|FOF_SWIMMABLE)) == (pfloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)))
solid = 1;
}
else
@ -1060,7 +1049,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
rlight = &dc_lightlist[i];
rlight->height += rlight->heightstep;
if (rlight->flags & FF_CUTLEVEL)
if (rlight->flags & FOF_CUTLEVEL)
rlight->botheight += rlight->botheightstep;
}
continue;
@ -1106,7 +1095,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
dc_fullbright += COLORMAP_REMAPOFFSET;
}
if (pfloor->flags & FF_FOG && pfloor->master->frontsector->extra_colormap)
if (pfloor->fofflags & FOF_FOG && pfloor->master->frontsector->extra_colormap)
dc_colormap = pfloor->master->frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
else if (frontsector->extra_colormap)
dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
@ -1548,9 +1537,9 @@ static void R_RenderSegLoop (void)
maskedtexturecol[rw_x] = (INT16)texturecolumn;
if (maskedtextureheight != NULL) {
maskedtextureheight[rw_x] = (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3) ?
maskedtextureheight[rw_x] = (curline->linedef->flags & ML_MIDPEG) ?
max(rw_midtexturemid, rw_midtextureback) :
min(rw_midtexturemid, rw_midtextureback));
min(rw_midtexturemid, rw_midtextureback);
}
}
@ -1559,7 +1548,7 @@ static void R_RenderSegLoop (void)
for (i = 0; i < dc_numlights; i++)
{
dc_lightlist[i].height += dc_lightlist[i].heightstep;
if (dc_lightlist[i].flags & FF_CUTSOLIDS)
if (dc_lightlist[i].flags & FOF_CUTSOLIDS)
dc_lightlist[i].botheight += dc_lightlist[i].botheightstep;
}
}
@ -1837,7 +1826,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ceilingfrontslide = floorfrontslide = ceilingbackslide = floorbackslide = 0;
{
angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y);
angle_t lineangle = curline->angle;
if (frontsector->f_slope)
floorfrontslide = FixedMul(frontsector->f_slope->zdelta, FINECOSINE((lineangle-frontsector->f_slope->xydirection)>>ANGLETOFINESHIFT));
@ -1861,7 +1850,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
texheight = textureheight[midtexture];
// a single sided line is terminal, so it must mark ends
markfloor = markceiling = true;
if (linedef->flags & ML_EFFECT2) {
if (linedef->flags & ML_NOSKEW) {
if (linedef->flags & ML_DONTPEGBOTTOM)
rw_midtexturemid = frontsector->floorheight + texheight - viewz;
else
@ -2017,18 +2006,20 @@ void R_StoreWallRange(INT32 start, INT32 stop)
else if (worldlow != worldbottom
|| worldlowslope != worldbottomslope
|| backsector->f_slope != frontsector->f_slope
|| backsector->floorpic != frontsector->floorpic
|| backsector->lightlevel != frontsector->lightlevel
//SoM: 3/22/2000: Check floor x and y offsets.
|| backsector->floor_xoffs != frontsector->floor_xoffs
|| backsector->floor_yoffs != frontsector->floor_yoffs
|| backsector->floorpic_angle != frontsector->floorpic_angle
//SoM: 3/22/2000: Prevents bleeding.
|| (frontsector->heightsec != -1 && frontsector->floorpic != skyflatnum)
|| backsector->floorlightsec != frontsector->floorlightsec
//SoM: 4/3/2000: Check for colormaps
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags)))
|| backsector->floorpic != frontsector->floorpic
|| backsector->lightlevel != frontsector->lightlevel
//SoM: 3/22/2000: Check floor x and y offsets.
|| backsector->floor_xoffs != frontsector->floor_xoffs
|| backsector->floor_yoffs != frontsector->floor_yoffs
|| backsector->floorpic_angle != frontsector->floorpic_angle
//SoM: 3/22/2000: Prevents bleeding.
|| (frontsector->heightsec != -1 && frontsector->floorpic != skyflatnum)
|| backsector->floorlightlevel != frontsector->floorlightlevel
|| backsector->floorlightabsolute != frontsector->floorlightabsolute
|| backsector->floorlightsec != frontsector->floorlightsec
//SoM: 4/3/2000: Check for colormaps
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags)))
{
markfloor = true;
}
@ -2048,18 +2039,20 @@ void R_StoreWallRange(INT32 start, INT32 stop)
else if (worldhigh != worldtop
|| worldhighslope != worldtopslope
|| backsector->c_slope != frontsector->c_slope
|| backsector->ceilingpic != frontsector->ceilingpic
|| backsector->lightlevel != frontsector->lightlevel
//SoM: 3/22/2000: Check floor x and y offsets.
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|| backsector->ceiling_yoffs != frontsector->ceiling_yoffs
|| backsector->ceilingpic_angle != frontsector->ceilingpic_angle
//SoM: 3/22/2000: Prevents bleeding.
|| (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum)
|| backsector->ceilinglightsec != frontsector->ceilinglightsec
//SoM: 4/3/2000: Check for colormaps
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags)))
|| backsector->ceilingpic != frontsector->ceilingpic
|| backsector->lightlevel != frontsector->lightlevel
//SoM: 3/22/2000: Check floor x and y offsets.
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|| backsector->ceiling_yoffs != frontsector->ceiling_yoffs
|| backsector->ceilingpic_angle != frontsector->ceilingpic_angle
//SoM: 3/22/2000: Prevents bleeding.
|| (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum)
|| backsector->ceilinglightlevel != frontsector->ceilinglightlevel
|| backsector->ceilinglightabsolute != frontsector->ceilinglightabsolute
|| backsector->ceilinglightsec != frontsector->ceilinglightsec
//SoM: 4/3/2000: Check for colormaps
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags)))
{
markceiling = true;
}
@ -2085,26 +2078,13 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
fixed_t texheight;
// top texture
if ((linedef->flags & (ML_DONTPEGTOP) && (linedef->flags & ML_DONTPEGBOTTOM))
&& linedef->sidenum[1] != 0xffff)
{
// Special case... use offsets from 2nd side but only if it has a texture.
side_t *def = &sides[linedef->sidenum[1]];
toptexture = R_GetTextureNum(def->toptexture);
toptexture = R_GetTextureNum(sidedef->toptexture);
topbrightmap = R_GetTextureBrightmap(toptexture);
texheight = textureheight[toptexture];
if (!toptexture) //Second side has no texture, use the first side's instead.
toptexture = R_GetTextureNum(sidedef->toptexture);
topbrightmap = R_GetTextureBrightmap(toptexture);
texheight = textureheight[toptexture];
}
else
if (!(linedef->flags & ML_SKEWTD))
{
toptexture = R_GetTextureNum(sidedef->toptexture);
topbrightmap = R_GetTextureBrightmap(toptexture);
texheight = textureheight[toptexture];
}
if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked
// Ignore slopes for lower/upper textures unless flag is checked
if (linedef->flags & ML_DONTPEGTOP)
rw_toptexturemid = frontsector->ceilingheight - viewz;
else
@ -2130,7 +2110,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
bottomtexture = R_GetTextureNum(sidedef->bottomtexture);
bottombrightmap = R_GetTextureBrightmap(bottomtexture);
if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked
if (!(linedef->flags & ML_SKEWTD))
{
// Ignore slopes for lower/upper textures unless flag is checked
if (linedef->flags & ML_DONTPEGBOTTOM)
rw_bottomtexturemid = frontsector->floorheight - viewz;
else
@ -2179,9 +2161,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
i = 0;
for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
if (rover->norender == leveltime)
@ -2198,23 +2180,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (r2->master == rover->master) // Skip if same control line.
break;
if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES))
if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES))
continue;
if (r2->norender == leveltime)
continue;
if (rover->flags & FF_EXTRA)
if (rover->fofflags & FOF_EXTRA)
{
if (!(r2->flags & FF_CUTEXTRA))
if (!(r2->fofflags & FOF_CUTEXTRA))
continue;
if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
continue;
}
else
{
if (!(r2->flags & FF_CUTSOLIDS))
if (!(r2->fofflags & FOF_CUTSOLIDS))
continue;
}
@ -2237,9 +2219,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
if (rover->norender == leveltime)
@ -2256,23 +2238,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (r2->master == rover->master) // Skip if same control line.
break;
if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES))
if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES))
continue;
if (r2->norender == leveltime)
continue;
if (rover->flags & FF_EXTRA)
if (rover->fofflags & FOF_EXTRA)
{
if (!(r2->flags & FF_CUTEXTRA))
if (!(r2->fofflags & FOF_CUTEXTRA))
continue;
if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
continue;
}
else
{
if (!(r2->flags & FF_CUTSOLIDS))
if (!(r2->fofflags & FOF_CUTSOLIDS))
continue;
}
@ -2297,9 +2279,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = backsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
if (rover->norender == leveltime)
continue;
@ -2319,9 +2301,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = frontsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
if (rover->norender == leveltime)
continue;
@ -2361,7 +2343,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (curline->polyseg)
{ // use REAL front and back floors please, so midtexture rendering isn't mucked up
rw_midtextureslide = rw_midtexturebackslide = 0;
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
if (linedef->flags & ML_MIDPEG)
rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz;
else
rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz;
@ -2369,16 +2351,16 @@ void R_StoreWallRange(INT32 start, INT32 stop)
else
{
// Set midtexture starting height
if (linedef->flags & ML_EFFECT2)
if (linedef->flags & ML_NOSKEW)
{ // Ignore slopes when texturing
rw_midtextureslide = rw_midtexturebackslide = 0;
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
if (linedef->flags & ML_MIDPEG)
rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz;
else
rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz;
}
else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
else if (linedef->flags & ML_MIDPEG)
{
rw_midtexturemid = worldbottom;
rw_midtextureslide = floorfrontslide;
@ -2541,7 +2523,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
rlight->flags = light->flags;
if (light->caster && light->caster->flags & FF_CUTSOLIDS)
if (light->caster && light->caster->fofflags & FOF_CUTSOLIDS)
{
leftheight = P_GetFFloorBottomZAt(light->caster, segleft.x, segleft.y);
rightheight = P_GetFFloorBottomZAt(light->caster, segright.x, segright.y);
@ -2628,7 +2610,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (rover->norender == leveltime)
continue;
@ -2643,8 +2625,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->b_slope;
ffloor[i].b_pos = roverleft;
@ -2666,8 +2648,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->t_slope;
ffloor[i].b_pos = roverleft;
@ -2685,7 +2667,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (rover->norender == leveltime)
continue;
@ -2700,8 +2682,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->b_slope;
ffloor[i].b_pos = roverleft;
@ -2723,8 +2705,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->t_slope;
ffloor[i].b_pos = roverleft;

View file

@ -18,7 +18,7 @@
#pragma interface
#endif
transnum_t R_GetLinedefTransTable(line_t *line);
transnum_t R_GetLinedefTransTable(fixed_t alpha);
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2);
void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pffloor);
void R_StoreWallRange(INT32 start, INT32 stop);

View file

@ -1160,7 +1160,7 @@ static void R_SplitSprite(vissprite_t *sprite)
{
fixed_t testheight;
if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES))
if (!(sector->lightlist[i].caster->fofflags & FOF_CUTSPRITES))
continue;
testheight = P_GetLightZAt(&sector->lightlist[i], sprite->gx, sprite->gy);
@ -1193,7 +1193,7 @@ static void R_SplitSprite(vissprite_t *sprite)
newsprite->szt -= 8;
newsprite->cut |= SC_TOP;
if (!(sector->lightlist[i].caster->flags & FF_NOSHADE))
if (!(sector->lightlist[i].caster->fofflags & FOF_NOSHADE))
{
lightnum = (*sector->lightlist[i].lightlevel >> LIGHTSEGSHIFT);
@ -1280,7 +1280,7 @@ fixed_t R_GetShadowZ(
if (sector->ffloors)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES) || (rover->alpha < 90 && !(rover->flags & FF_SWIMMABLE)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES) || (rover->alpha < 90 && !(rover->fofflags & FOF_SWIMMABLE)))
continue;
z = isflipped ? P_GetFFloorBottomZAt(rover, interp.x, interp.y) : P_GetFFloorTopZAt(rover, interp.x, interp.y);

View file

@ -199,7 +199,7 @@ get_anchor
for (i = 0; i < list->count; ++i)
{
if (list->points[i] == v && list->anchors[i]->extrainfo == tag)
if (list->points[i] == v && Tag_FGet(&list->anchors[i]->tags) == tag)
{
for (k = 0; k < 3; ++k)
{
@ -347,12 +347,12 @@ new_vertex_slope
{anchors[2]->x << FRACBITS, anchors[2]->y << FRACBITS, anchors[2]->z << FRACBITS}
};
if (flags & ML_NETONLY)
if (flags & TMSAF_NOPHYSICS)
{
slope->flags |= SL_NOPHYSICS;
}
if (flags & ML_NONET)
if (flags & TMSAF_DYNAMIC)
{
slope->flags |= SL_DYNAMIC;
}
@ -410,8 +410,8 @@ slope_sector
{
(*slope) = new_vertex_slope(anchors, flags);
/* Effect 6 - invert slope to opposite side */
if (flags & ML_EFFECT6)
/* invert slope to opposite side */
if (flags & TMSAF_MIRROR)
{
(*alt) = new_vertex_slope(flip_slope(anchors, sector), flags);
}
@ -426,36 +426,30 @@ make_anchored_slope
const line_t * line,
const int plane
){
enum
{
FLOOR = 0x1,
CEILING = 0x2,
};
INT16 flags = line->args[1];
INT16 flags = line->flags;
const int side = ( flags & ML_NOCLIMB ) != 0;
const int side = ( flags & TMSAF_BACKSIDE ) != 0;
sector_t * s;
mtag_t tag = Tag_FGet(&line->tags);
if (side == 0 || flags & ML_TWOSIDED)
if (side == 0 || (line->flags & ML_TWOSIDED))
{
s = sides[line->sidenum[side]].sector;
if (plane == (FLOOR|CEILING))
if (plane == (TMSA_FLOOR|TMSA_CEILING))
{
flags &= ~ML_EFFECT6;
flags &= ~TMSAF_MIRROR;
}
if (plane & FLOOR)
if (plane & TMSA_FLOOR)
{
slope_sector
(&s->f_slope, &s->c_slope, s, flags, &floor_anchors, tag);
}
if (plane & CEILING)
if (plane & TMSA_CEILING)
{
slope_sector
(&s->c_slope, &s->f_slope, s, flags, &ceiling_anchors, tag);
@ -469,27 +463,21 @@ static void P_BuildSlopeAnchorList (void) {
}
static void P_SetupAnchoredSlopes (void) {
enum
{
FLOOR = 0x1,
CEILING = 0x2,
};
size_t i;
for (i = 0; i < numlines; ++i)
{
if (lines[i].special == LT_SLOPE_ANCHORS_FLOOR)
if (lines[i].special == LT_SLOPE_ANCHORS)
{
make_anchored_slope(&lines[i], FLOOR);
}
else if (lines[i].special == LT_SLOPE_ANCHORS_CEILING)
{
make_anchored_slope(&lines[i], CEILING);
}
else if (lines[i].special == LT_SLOPE_ANCHORS)
{
make_anchored_slope(&lines[i], FLOOR|CEILING);
int plane = (lines[i].args[0] & (TMSA_FLOOR|TMSA_CEILING));
if (plane == 0)
{
CONS_Alert(CONS_WARNING, "Slope anchor linedef %s has no planes set.\n", sizeu1(i));
continue;
}
make_anchored_slope(&lines[i], plane);
}
}
}

View file

@ -37,6 +37,25 @@ void Tag_Add (taglist_t* list, const mtag_t tag)
list->tags[list->count++] = tag;
}
/// Removes a tag from a given element's taglist.
/// \warning This does not rebuild the global taggroups, which are used for iteration.
void Tag_Remove(taglist_t* list, const mtag_t tag)
{
UINT16 i;
for (i = 0; i < list->count; i++)
{
if (list->tags[i] != tag)
continue;
for (; i+1 < list->count; i++)
list->tags[i] = list->tags[i+1];
list->tags = Z_Realloc(list->tags, (list->count - 1) * sizeof(mtag_t), PU_LEVEL, NULL);
return;
}
}
/// Sets the first tag entry in a taglist.
/// Replicates the old way of accessing element->tag.
void Tag_FSet (taglist_t* list, const mtag_t tag)
@ -408,6 +427,22 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
// Ingame list manipulation.
/// Adds the tag to the given sector, and updates the global taggroups.
void Tag_SectorAdd (const size_t id, const mtag_t tag)
{
sector_t* sec = &sectors[id];
Tag_Add(&sec->tags, tag);
Taggroup_Add(tags_sectors, tag, id);
}
/// Removes the tag from the given sector, and updates the global taggroups.
void Tag_SectorRemove (const size_t id, const mtag_t tag)
{
sector_t* sec = &sectors[id];
Tag_Remove(&sec->tags, tag);
Taggroup_Remove(tags_sectors, tag, id);
}
/// Changes the first tag for a given sector, and updates the global taggroups.
void Tag_SectorFSet (const size_t id, const mtag_t tag)
{
@ -420,3 +455,16 @@ void Tag_SectorFSet (const size_t id, const mtag_t tag)
Taggroup_Add(tags_sectors, tag, id);
Tag_FSet(&sec->tags, tag);
}
mtag_t Tag_NextUnused(mtag_t start)
{
while ((UINT16)start < MAXTAGS)
{
if (!in_bit_array(tags_available, (UINT16)start))
return start;
start++;
}
return (mtag_t)MAXTAGS;
}

View file

@ -28,12 +28,15 @@ typedef struct
} taglist_t;
void Tag_Add (taglist_t* list, const mtag_t tag);
void Tag_Remove (taglist_t* list, const mtag_t tag);
void Tag_FSet (taglist_t* list, const mtag_t tag);
mtag_t Tag_FGet (const taglist_t* list);
boolean Tag_Find (const taglist_t* list, const mtag_t tag);
boolean Tag_Share (const taglist_t* list1, const taglist_t* list2);
boolean Tag_Compare (const taglist_t* list1, const taglist_t* list2);
void Tag_SectorAdd (const size_t id, const mtag_t tag);
void Tag_SectorRemove (const size_t id, const mtag_t tag);
void Tag_SectorFSet (const size_t id, const mtag_t tag);
/// Taggroup list. It is essentially just an element id list.
@ -46,6 +49,8 @@ typedef struct
extern bitarray_t tags_available[];
extern mtag_t Tag_NextUnused(mtag_t start);
extern size_t num_tags;
extern taggroup_t* tags_sectors[];