Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
SRB2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
264
Issues
264
List
Board
Labels
Milestones
Merge Requests
74
Merge Requests
74
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
STJr
SRB2
Commits
a06c4a8c
Commit
a06c4a8c
authored
May 18, 2020
by
LJ Sonic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename P_GetZAt to P_GetSlopeZAt and P_GetZAt2 to P_GetZAt
parent
6ffbc89f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
75 additions
and
71 deletions
+75
-71
am_map.c
src/am_map.c
+2
-2
hw_main.c
src/hardware/hw_main.c
+12
-12
lua_baselib.c
src/lua_baselib.c
+8
-4
m_cheat.c
src/m_cheat.c
+1
-1
p_floor.c
src/p_floor.c
+2
-2
p_mobj.c
src/p_mobj.c
+16
-16
p_slopes.c
src/p_slopes.c
+9
-9
p_slopes.h
src/p_slopes.h
+3
-3
p_user.c
src/p_user.c
+3
-3
r_bsp.c
src/r_bsp.c
+2
-2
r_plane.c
src/r_plane.c
+7
-7
r_segs.c
src/r_segs.c
+8
-8
r_things.c
src/r_things.c
+2
-2
No files found.
src/am_map.c
View file @
a06c4a8c
...
...
@@ -931,8 +931,8 @@ static inline void AM_drawWalls(void)
l
.
b
.
y
=
lines
[
i
].
v2
->
y
>>
FRACTOMAPBITS
;
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, lines[i].v1->x, lines[i].v1->y, normalheight); \
end2 = P_GetZAt
2
(slope, lines[i].v2->x, lines[i].v2->y, normalheight);
end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y, normalheight); \
end2 = P_GetZAt(slope, lines[i].v2->x, lines[i].v2->y, normalheight);
SLOPEPARAMS
(
lines
[
i
].
frontsector
->
f_slope
,
frontf1
,
frontf2
,
lines
[
i
].
frontsector
->
floorheight
)
SLOPEPARAMS
(
lines
[
i
].
frontsector
->
c_slope
,
frontc1
,
frontc2
,
lines
[
i
].
frontsector
->
ceilingheight
)
...
...
src/hardware/hw_main.c
View file @
a06c4a8c
...
...
@@ -513,7 +513,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
// Set fixedheight to the slope's height from our viewpoint, if we have a slope
if
(
slope
)
fixedheight
=
P_GetZAt
(
slope
,
viewx
,
viewy
);
fixedheight
=
P_Get
Slope
ZAt
(
slope
,
viewx
,
viewy
);
height
=
FIXED_TO_FLOAT
(
fixedheight
);
...
...
@@ -665,7 +665,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
if
(
slope
)
{
fixedheight
=
P_GetZAt
(
slope
,
FLOAT_TO_FIXED
(
pv
->
x
),
FLOAT_TO_FIXED
(
pv
->
y
));
fixedheight
=
P_Get
Slope
ZAt
(
slope
,
FLOAT_TO_FIXED
(
pv
->
x
),
FLOAT_TO_FIXED
(
pv
->
y
));
v3d
->
y
=
FIXED_TO_FLOAT
(
fixedheight
);
}
}
...
...
@@ -686,7 +686,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
sector_t *psector = gr_frontsector;
if (slope)
fixedheight = P_GetZAt(slope, psector->soundorg.x, psector->soundorg.y);
fixedheight = P_Get
Slope
ZAt(slope, psector->soundorg.x, psector->soundorg.y);
if (psector->ffloors)
{
...
...
@@ -1062,8 +1062,8 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
float
endpegt
,
endpegb
,
endpegmul
;
float
endheight
=
0
.
0
f
,
endbheight
=
0
.
0
f
;
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_GetZAt's return value each time
// compiler complains when P_Get
Slope
ZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_Get
Slope
ZAt's return value each time
fixed_t
temp
;
fixed_t
v1x
=
FLOAT_TO_FIXED
(
wallVerts
[
0
].
x
);
...
...
@@ -1290,8 +1290,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
v2y
=
FLOAT_TO_FIXED
(
ve
.
y
);
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt
2
(slope, v2x, v2y, normalheight);
end1 = P_GetZAt(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt(slope, v2x, v2y, normalheight);
SLOPEPARAMS
(
gr_frontsector
->
c_slope
,
worldtop
,
worldtopslope
,
gr_frontsector
->
ceilingheight
)
SLOPEPARAMS
(
gr_frontsector
->
f_slope
,
worldbottom
,
worldbottomslope
,
gr_frontsector
->
floorheight
)
...
...
@@ -2158,8 +2158,8 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks
v2x
=
FLOAT_TO_FIXED
(((
polyvertex_t
*
)
gr_curline
->
pv2
)
->
x
);
v2y
=
FLOAT_TO_FIXED
(((
polyvertex_t
*
)
gr_curline
->
pv2
)
->
y
);
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt
2
(slope, v2x, v2y, normalheight);
end1 = P_GetZAt(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt(slope, v2x, v2y, normalheight);
SLOPEPARAMS
(
afrontsector
->
f_slope
,
frontf1
,
frontf2
,
afrontsector
->
floorheight
)
SLOPEPARAMS
(
afrontsector
->
c_slope
,
frontc1
,
frontc2
,
afrontsector
->
ceilingheight
)
...
...
@@ -2714,8 +2714,8 @@ static void HWR_AddLine(seg_t * line)
fixed_t
backf1
,
backf2
,
backc1
,
backc2
;
// back floor ceiling ends
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt
2
(slope, v2x, v2y, normalheight);
end1 = P_GetZAt(slope, v1x, v1y, normalheight); \
end2 = P_GetZAt(slope, v2x, v2y, normalheight);
SLOPEPARAMS
(
gr_frontsector
->
f_slope
,
frontf1
,
frontf2
,
gr_frontsector
->
floorheight
)
SLOPEPARAMS
(
gr_frontsector
->
c_slope
,
frontc1
,
frontc2
,
gr_frontsector
->
ceilingheight
)
...
...
@@ -3898,7 +3898,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
slopez
=
P_GetZAt
(
floorslope
,
FLOAT_TO_FIXED
(
shadowVerts
[
i
].
x
),
FLOAT_TO_FIXED
(
shadowVerts
[
i
].
z
));
slopez
=
P_Get
Slope
ZAt
(
floorslope
,
FLOAT_TO_FIXED
(
shadowVerts
[
i
].
x
),
FLOAT_TO_FIXED
(
shadowVerts
[
i
].
z
));
shadowVerts
[
i
].
y
=
FIXED_TO_FLOAT
(
slopez
)
+
0
.
05
f
;
}
}
...
...
src/lua_baselib.c
View file @
a06c4a8c
...
...
@@ -14,7 +14,7 @@
#include "fastcmp.h"
#include "p_local.h"
#include "p_setup.h" // So we can have P_SetupLevelSky
#include "p_slopes.h" // P_GetZAt
#include "p_slopes.h" // P_Get
Slope
ZAt
#include "z_zone.h"
#include "r_main.h"
#include "r_draw.h"
...
...
@@ -2182,10 +2182,14 @@ static int lib_pGetZAt(lua_State *L)
fixed_t
x
=
luaL_checkfixed
(
L
,
2
);
fixed_t
y
=
luaL_checkfixed
(
L
,
3
);
//HUDSAFE
if
(
!
slope
)
return
LUA_ErrInvalid
(
L
,
"pslope_t"
);
if
(
slope
)
lua_pushfixed
(
L
,
P_GetSlopeZAt
(
slope
,
x
,
y
));
else
{
fixed_t
z
=
luaL_checkfixed
(
L
,
4
);
lua_pushfixed
(
L
,
P_GetZAt
(
slope
,
x
,
y
,
z
));
}
lua_pushfixed
(
L
,
P_GetZAt
(
slope
,
x
,
y
));
return
1
;
}
...
...
src/m_cheat.c
View file @
a06c4a8c
...
...
@@ -1026,7 +1026,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
if
(
ceiling
)
{
// Truncate position to match where mapthing would be when spawned
// (this applies to every further P_GetZAt call as well)
// (this applies to every further P_Get
Slope
ZAt call as well)
fixed_t
cheight
=
P_GetSectorCeilingZAt
(
sec
,
player
->
mo
->
x
&
0xFFFF0000
,
player
->
mo
->
y
&
0xFFFF0000
);
if
(((
cheight
-
player
->
mo
->
z
-
player
->
mo
->
height
)
>>
FRACBITS
)
>=
(
1
<<
(
16
-
ZSHIFT
)))
...
...
src/p_floor.c
View file @
a06c4a8c
...
...
@@ -3177,9 +3177,9 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
{
mobj_t
*
spawned
=
NULL
;
if
(
*
rover
->
t_slope
)
topz
=
P_GetZAt
(
*
rover
->
t_slope
,
a
,
b
)
-
(
spacing
>>
1
);
topz
=
P_Get
Slope
ZAt
(
*
rover
->
t_slope
,
a
,
b
)
-
(
spacing
>>
1
);
if
(
*
rover
->
b_slope
)
bottomz
=
P_GetZAt
(
*
rover
->
b_slope
,
a
,
b
);
bottomz
=
P_Get
Slope
ZAt
(
*
rover
->
b_slope
,
a
,
b
);
for
(
c
=
topz
;
c
>
bottomz
;
c
-=
spacing
)
{
...
...
src/p_mobj.c
View file @
a06c4a8c
...
...
@@ -958,12 +958,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line,
/*CONS_Printf("BEFORE: v1 = %f %f %f\n",
FIXED_TO_FLOAT(v1.x),
FIXED_TO_FLOAT(v1.y),
FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y))
FIXED_TO_FLOAT(P_Get
Slope
ZAt(slope, v1.x, v1.y))
);
CONS_Printf(" v2 = %f %f %f\n",
FIXED_TO_FLOAT(v2.x),
FIXED_TO_FLOAT(v2.y),
FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y))
FIXED_TO_FLOAT(P_Get
Slope
ZAt(slope, v2.x, v2.y))
);*/
if
(
abs
(
v1
.
x
-
x
)
>
radius
)
{
...
...
@@ -1021,24 +1021,24 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line,
/*CONS_Printf("AFTER: v1 = %f %f %f\n",
FIXED_TO_FLOAT(v1.x),
FIXED_TO_FLOAT(v1.y),
FIXED_TO_FLOAT(P_GetZAt(slope, v1.x, v1.y))
FIXED_TO_FLOAT(P_Get
Slope
ZAt(slope, v1.x, v1.y))
);
CONS_Printf(" v2 = %f %f %f\n",
FIXED_TO_FLOAT(v2.x),
FIXED_TO_FLOAT(v2.y),
FIXED_TO_FLOAT(P_GetZAt(slope, v2.x, v2.y))
FIXED_TO_FLOAT(P_Get
Slope
ZAt(slope, v2.x, v2.y))
);*/
// Return the higher of the two points
if
(
actuallylowest
)
return
min
(
P_GetZAt
(
slope
,
v1
.
x
,
v1
.
y
),
P_GetZAt
(
slope
,
v2
.
x
,
v2
.
y
)
P_Get
Slope
ZAt
(
slope
,
v1
.
x
,
v1
.
y
),
P_Get
Slope
ZAt
(
slope
,
v2
.
x
,
v2
.
y
)
);
else
return
max
(
P_GetZAt
(
slope
,
v1
.
x
,
v1
.
y
),
P_GetZAt
(
slope
,
v2
.
x
,
v2
.
y
)
P_Get
Slope
ZAt
(
slope
,
v1
.
x
,
v1
.
y
),
P_Get
Slope
ZAt
(
slope
,
v2
.
x
,
v2
.
y
)
);
}
...
...
@@ -1072,7 +1072,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if
(
R_PointInSubsector
(
testx
,
testy
)
->
sector
==
(
boundsec
?
boundsec
:
sector
))
return
P_GetZAt
(
slope
,
testx
,
testy
);
return
P_Get
Slope
ZAt
(
slope
,
testx
,
testy
);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if
(
perfect
)
{
...
...
@@ -1112,7 +1112,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
// If we're just testing for base sector location (no collision line), just go for the center's spot...
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
if
(
line
==
NULL
)
return
P_GetZAt
(
slope
,
x
,
y
);
return
P_Get
Slope
ZAt
(
slope
,
x
,
y
);
return
HighestOnLine
(
mobj
->
radius
,
x
,
y
,
line
,
slope
,
lowest
);
}
else
// Well, that makes it easy. Just get the floor height
...
...
@@ -1149,7 +1149,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if
(
R_PointInSubsector
(
testx
,
testy
)
->
sector
==
(
boundsec
?
boundsec
:
sector
))
return
P_GetZAt
(
slope
,
testx
,
testy
);
return
P_Get
Slope
ZAt
(
slope
,
testx
,
testy
);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if
(
perfect
)
{
...
...
@@ -1189,7 +1189,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
// If we're just testing for base sector location (no collision line), just go for the center's spot...
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
if
(
line
==
NULL
)
return
P_GetZAt
(
slope
,
x
,
y
);
return
P_Get
Slope
ZAt
(
slope
,
x
,
y
);
return
HighestOnLine
(
mobj
->
radius
,
x
,
y
,
line
,
slope
,
lowest
);
}
else
// Well, that makes it easy. Just get the ceiling height
...
...
@@ -1227,7 +1227,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if
(
R_PointInSubsector
(
testx
,
testy
)
->
sector
==
(
boundsec
?
boundsec
:
sector
))
return
P_GetZAt
(
slope
,
testx
,
testy
);
return
P_Get
Slope
ZAt
(
slope
,
testx
,
testy
);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if
(
perfect
)
{
...
...
@@ -1267,7 +1267,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
// If we're just testing for base sector location (no collision line), just go for the center's spot...
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
if
(
line
==
NULL
)
return
P_GetZAt
(
slope
,
x
,
y
);
return
P_Get
Slope
ZAt
(
slope
,
x
,
y
);
return
HighestOnLine
(
mobj
->
radius
,
x
,
y
,
line
,
slope
,
lowest
);
}
else
// Well, that makes it easy. Just get the floor height
...
...
@@ -1304,7 +1304,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
// If the highest point is in the sector, then we have it easy! Just get the Z at that point
if
(
R_PointInSubsector
(
testx
,
testy
)
->
sector
==
(
boundsec
?
boundsec
:
sector
))
return
P_GetZAt
(
slope
,
testx
,
testy
);
return
P_Get
Slope
ZAt
(
slope
,
testx
,
testy
);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if
(
perfect
)
{
...
...
@@ -1344,7 +1344,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
// If we're just testing for base sector location (no collision line), just go for the center's spot...
// It'll get fixed when we test for collision anyway, and the final result can't be lower than this
if
(
line
==
NULL
)
return
P_GetZAt
(
slope
,
x
,
y
);
return
P_Get
Slope
ZAt
(
slope
,
x
,
y
);
return
HighestOnLine
(
mobj
->
radius
,
x
,
y
,
line
,
slope
,
lowest
);
}
else
// Well, that makes it easy. Just get the ceiling height
...
...
src/p_slopes.c
View file @
a06c4a8c
...
...
@@ -656,7 +656,7 @@ void P_SpawnSlopes(const boolean fromsave) {
//
// Returns the height of the sloped plane at (x, y) as a fixed_t
fixed_t
P_GetZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
)
fixed_t
P_Get
Slope
ZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
)
{
fixed_t
dist
=
FixedMul
(
x
-
slope
->
o
.
x
,
slope
->
d
.
x
)
+
FixedMul
(
y
-
slope
->
o
.
y
,
slope
->
d
.
y
);
...
...
@@ -664,40 +664,40 @@ fixed_t P_GetZAt(const pslope_t *slope, fixed_t x, fixed_t y)
return
slope
->
o
.
z
+
FixedMul
(
dist
,
slope
->
zdelta
);
}
// Like P_GetZAt but falls back to z if slope is NULL
fixed_t
P_GetZAt
2
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
,
fixed_t
z
)
// Like P_Get
Slope
ZAt but falls back to z if slope is NULL
fixed_t
P_GetZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
,
fixed_t
z
)
{
return
slope
?
P_GetZAt
(
slope
,
x
,
y
)
:
z
;
return
slope
?
P_Get
Slope
ZAt
(
slope
,
x
,
y
)
:
z
;
}
// Returns the height of the sector floor at (x, y)
fixed_t
P_GetSectorFloorZAt
(
const
sector_t
*
sector
,
fixed_t
x
,
fixed_t
y
)
{
return
sector
->
f_slope
?
P_GetZAt
(
sector
->
f_slope
,
x
,
y
)
:
sector
->
floorheight
;
return
sector
->
f_slope
?
P_Get
Slope
ZAt
(
sector
->
f_slope
,
x
,
y
)
:
sector
->
floorheight
;
}
// Returns the height of the sector ceiling at (x, y)
fixed_t
P_GetSectorCeilingZAt
(
const
sector_t
*
sector
,
fixed_t
x
,
fixed_t
y
)
{
return
sector
->
c_slope
?
P_GetZAt
(
sector
->
c_slope
,
x
,
y
)
:
sector
->
ceilingheight
;
return
sector
->
c_slope
?
P_Get
Slope
ZAt
(
sector
->
c_slope
,
x
,
y
)
:
sector
->
ceilingheight
;
}
// Returns the height of the FOF top at (x, y)
fixed_t
P_GetFFloorTopZAt
(
const
ffloor_t
*
ffloor
,
fixed_t
x
,
fixed_t
y
)
{
return
*
ffloor
->
t_slope
?
P_GetZAt
(
*
ffloor
->
t_slope
,
x
,
y
)
:
*
ffloor
->
topheight
;
return
*
ffloor
->
t_slope
?
P_Get
Slope
ZAt
(
*
ffloor
->
t_slope
,
x
,
y
)
:
*
ffloor
->
topheight
;
}
// Returns the height of the FOF bottom at (x, y)
fixed_t
P_GetFFloorBottomZAt
(
const
ffloor_t
*
ffloor
,
fixed_t
x
,
fixed_t
y
)
{
return
*
ffloor
->
b_slope
?
P_GetZAt
(
*
ffloor
->
b_slope
,
x
,
y
)
:
*
ffloor
->
bottomheight
;
return
*
ffloor
->
b_slope
?
P_Get
Slope
ZAt
(
*
ffloor
->
b_slope
,
x
,
y
)
:
*
ffloor
->
bottomheight
;
}
// Returns the height of the light list at (x, y)
fixed_t
P_GetLightZAt
(
const
lightlist_t
*
light
,
fixed_t
x
,
fixed_t
y
)
{
return
light
->
slope
?
P_GetZAt
(
light
->
slope
,
x
,
y
)
:
light
->
height
;
return
light
->
slope
?
P_Get
Slope
ZAt
(
light
->
slope
,
x
,
y
)
:
light
->
height
;
}
...
...
src/p_slopes.h
View file @
a06c4a8c
...
...
@@ -33,10 +33,10 @@ void P_CopySectorSlope(line_t *line);
pslope_t
*
P_SlopeById
(
UINT16
id
);
// Returns the height of the sloped plane at (x, y) as a fixed_t
fixed_t
P_GetZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
);
fixed_t
P_Get
Slope
ZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
);
// Like P_GetZAt but falls back to z if slope is NULL
fixed_t
P_GetZAt
2
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
,
fixed_t
z
);
// Like P_Get
Slope
ZAt but falls back to z if slope is NULL
fixed_t
P_GetZAt
(
const
pslope_t
*
slope
,
fixed_t
x
,
fixed_t
y
,
fixed_t
z
);
// Returns the height of the sector at (x, y)
fixed_t
P_GetSectorFloorZAt
(
const
sector_t
*
sector
,
fixed_t
x
,
fixed_t
y
);
...
...
src/p_user.c
View file @
a06c4a8c
...
...
@@ -7748,7 +7748,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle)
if
(
player
->
mo
->
standingslope
)
{
ground
=
P_GetZAt
(
player
->
mo
->
standingslope
,
newx
,
newy
);
ground
=
P_Get
Slope
ZAt
(
player
->
mo
->
standingslope
,
newx
,
newy
);
if
(
player
->
mo
->
eflags
&
MFE_VERTICALFLIP
)
ground
-=
FixedMul
(
mobjinfo
[
MT_SPINFIRE
].
height
,
player
->
mo
->
scale
);
}
...
...
@@ -11103,8 +11103,8 @@ static void P_MinecartThink(player_t *player)
if
(
minecart
->
standingslope
)
{
fixed_t
fa2
=
(
minecart
->
angle
>>
ANGLETOFINESHIFT
)
&
FINEMASK
;
fixed_t
front
=
P_GetZAt
(
minecart
->
standingslope
,
minecart
->
x
,
minecart
->
y
);
fixed_t
back
=
P_GetZAt
(
minecart
->
standingslope
,
minecart
->
x
-
FINECOSINE
(
fa2
),
minecart
->
y
-
FINESINE
(
fa2
));
fixed_t
front
=
P_Get
Slope
ZAt
(
minecart
->
standingslope
,
minecart
->
x
,
minecart
->
y
);
fixed_t
back
=
P_Get
Slope
ZAt
(
minecart
->
standingslope
,
minecart
->
x
-
FINECOSINE
(
fa2
),
minecart
->
y
-
FINESINE
(
fa2
));
if
(
abs
(
front
-
back
)
<
3
*
FRACUNIT
)
currentSpeed
+=
(
back
-
front
)
/
3
;
...
...
src/r_bsp.c
View file @
a06c4a8c
...
...
@@ -500,8 +500,8 @@ static void R_AddLine(seg_t *line)
fixed_t
frontf1
,
frontf2
,
frontc1
,
frontc2
;
// front floor/ceiling ends
fixed_t
backf1
,
backf2
,
backc1
,
backc2
;
// back floor ceiling ends
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, line->v1->x, line->v1->y, normalheight); \
end2 = P_GetZAt
2
(slope, line->v2->x, line->v2->y, normalheight);
end1 = P_GetZAt(slope, line->v1->x, line->v1->y, normalheight); \
end2 = P_GetZAt(slope, line->v2->x, line->v2->y, normalheight);
SLOPEPARAMS
(
frontsector
->
f_slope
,
frontf1
,
frontf2
,
frontsector
->
floorheight
)
SLOPEPARAMS
(
frontsector
->
c_slope
,
frontc1
,
frontc2
,
frontsector
->
ceilingheight
)
...
...
src/r_plane.c
View file @
a06c4a8c
...
...
@@ -851,15 +851,15 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge)
floatv3_t
p
,
m
,
n
;
float
ang
;
float
vx
,
vy
,
vz
;
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_GetZAt's return value each time
// compiler complains when P_Get
Slope
ZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_Get
Slope
ZAt's return value each time
fixed_t
temp
;
vx
=
FIXED_TO_FLOAT
(
pl
->
viewx
+
xoffs
);
vy
=
FIXED_TO_FLOAT
(
pl
->
viewy
-
yoffs
);
vz
=
FIXED_TO_FLOAT
(
pl
->
viewz
);
temp
=
P_GetZAt
(
pl
->
slope
,
pl
->
viewx
,
pl
->
viewy
);
temp
=
P_Get
Slope
ZAt
(
pl
->
slope
,
pl
->
viewx
,
pl
->
viewy
);
zeroheight
=
FIXED_TO_FLOAT
(
temp
);
// p is the texture origin in view space
...
...
@@ -868,7 +868,7 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge)
ang
=
ANG2RAD
(
ANGLE_270
-
pl
->
viewangle
);
p
.
x
=
vx
*
cos
(
ang
)
-
vy
*
sin
(
ang
);
p
.
z
=
vx
*
sin
(
ang
)
+
vy
*
cos
(
ang
);
temp
=
P_GetZAt
(
pl
->
slope
,
-
xoffs
,
yoffs
);
temp
=
P_Get
Slope
ZAt
(
pl
->
slope
,
-
xoffs
,
yoffs
);
p
.
y
=
FIXED_TO_FLOAT
(
temp
)
-
vz
;
// m is the v direction vector in view space
...
...
@@ -881,9 +881,9 @@ static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge)
n
.
z
=
-
cos
(
ang
);
ang
=
ANG2RAD
(
pl
->
plangle
);
temp
=
P_GetZAt
(
pl
->
slope
,
pl
->
viewx
+
FLOAT_TO_FIXED
(
sin
(
ang
)),
pl
->
viewy
+
FLOAT_TO_FIXED
(
cos
(
ang
)));
temp
=
P_Get
Slope
ZAt
(
pl
->
slope
,
pl
->
viewx
+
FLOAT_TO_FIXED
(
sin
(
ang
)),
pl
->
viewy
+
FLOAT_TO_FIXED
(
cos
(
ang
)));
m
.
y
=
FIXED_TO_FLOAT
(
temp
)
-
zeroheight
;
temp
=
P_GetZAt
(
pl
->
slope
,
pl
->
viewx
+
FLOAT_TO_FIXED
(
cos
(
ang
)),
pl
->
viewy
-
FLOAT_TO_FIXED
(
sin
(
ang
)));
temp
=
P_Get
Slope
ZAt
(
pl
->
slope
,
pl
->
viewx
+
FLOAT_TO_FIXED
(
cos
(
ang
)),
pl
->
viewy
-
FLOAT_TO_FIXED
(
sin
(
ang
)));
n
.
y
=
FIXED_TO_FLOAT
(
temp
)
-
zeroheight
;
if
(
ds_powersoftwo
)
...
...
@@ -1193,7 +1193,7 @@ void R_DrawSinglePlane(visplane_t *pl)
if
(
itswater
)
{
INT32
i
;
fixed_t
plheight
=
abs
(
P_GetZAt
(
pl
->
slope
,
pl
->
viewx
,
pl
->
viewy
)
-
pl
->
viewz
);
fixed_t
plheight
=
abs
(
P_Get
Slope
ZAt
(
pl
->
slope
,
pl
->
viewx
,
pl
->
viewy
)
-
pl
->
viewz
);
fixed_t
rxoffs
=
xoffs
;
fixed_t
ryoffs
=
yoffs
;
...
...
src/r_segs.c
View file @
a06c4a8c
...
...
@@ -805,8 +805,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
rlight
=
&
dc_lightlist
[
p
];
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, ds-> leftpos.x, ds-> leftpos.y, normalheight); \
end2 = P_GetZAt
2
(slope, ds->rightpos.x, ds->rightpos.y, normalheight);
end1 = P_GetZAt(slope, ds-> leftpos.x, ds-> leftpos.y, normalheight); \
end2 = P_GetZAt(slope, ds->rightpos.x, ds->rightpos.y, normalheight);
SLOPEPARAMS
(
light
->
slope
,
leftheight
,
rightheight
,
light
->
height
)
SLOPEPARAMS
(
*
pfloor
->
b_slope
,
pfloorleft
,
pfloorright
,
*
pfloor
->
bottomheight
)
...
...
@@ -819,8 +819,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if
(
leftheight
>
pfloorleft
&&
rightheight
>
pfloorright
&&
i
+
1
<
dc_numlights
)
{
lightlist_t
*
nextlight
=
&
frontsector
->
lightlist
[
i
+
1
];
if
(
P_GetZAt
2
(
nextlight
->
slope
,
ds
->
leftpos
.
x
,
ds
->
leftpos
.
y
,
nextlight
->
height
)
>
pfloorleft
&&
P_GetZAt
2
(
nextlight
->
slope
,
ds
->
rightpos
.
x
,
ds
->
rightpos
.
y
,
nextlight
->
height
)
>
pfloorright
)
if
(
P_GetZAt
(
nextlight
->
slope
,
ds
->
leftpos
.
x
,
ds
->
leftpos
.
y
,
nextlight
->
height
)
>
pfloorleft
&&
P_GetZAt
(
nextlight
->
slope
,
ds
->
rightpos
.
x
,
ds
->
rightpos
.
y
,
nextlight
->
height
)
>
pfloorright
)
continue
;
}
...
...
@@ -1777,8 +1777,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
end1 = P_GetZAt
2
(slope, segleft.x, segleft.y, normalheight); \
end2 = P_GetZAt
2
(slope, segright.x, segright.y, normalheight);
end1 = P_GetZAt(slope, segleft.x, segleft.y, normalheight); \
end2 = P_GetZAt(slope, segright.x, segright.y, normalheight);
SLOPEPARAMS
(
frontsector
->
c_slope
,
worldtop
,
worldtopslope
,
frontsector
->
ceilingheight
)
SLOPEPARAMS
(
frontsector
->
f_slope
,
worldbottom
,
worldbottomslope
,
frontsector
->
floorheight
)
...
...
@@ -1809,8 +1809,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
continue
;
#endif
ffloor
[
i
].
f_pos
=
P_GetZAt
2
(
ffloor
[
i
].
slope
,
segleft
.
x
,
segleft
.
y
,
ffloor
[
i
].
height
)
-
viewz
;
ffloor
[
i
].
f_pos_slope
=
P_GetZAt
2
(
ffloor
[
i
].
slope
,
segright
.
x
,
segright
.
y
,
ffloor
[
i
].
height
)
-
viewz
;
ffloor
[
i
].
f_pos
=
P_GetZAt
(
ffloor
[
i
].
slope
,
segleft
.
x
,
segleft
.
y
,
ffloor
[
i
].
height
)
-
viewz
;
ffloor
[
i
].
f_pos_slope
=
P_GetZAt
(
ffloor
[
i
].
slope
,
segright
.
x
,
segright
.
y
,
ffloor
[
i
].
height
)
-
viewz
;
}
}
...
...
src/r_things.c
View file @
a06c4a8c
...
...
@@ -2387,8 +2387,8 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
continue
;
// Effective height may be different for each comparison in the case of slopes
planeobjectz
=
P_GetZAt
2
(
r2
->
plane
->
slope
,
rover
->
gx
,
rover
->
gy
,
r2
->
plane
->
height
);
planecameraz
=
P_GetZAt
2
(
r2
->
plane
->
slope
,
viewx
,
viewy
,
r2
->
plane
->
height
);
planeobjectz
=
P_GetZAt
(
r2
->
plane
->
slope
,
rover
->
gx
,
rover
->
gy
,
r2
->
plane
->
height
);
planecameraz
=
P_GetZAt
(
r2
->
plane
->
slope
,
viewx
,
viewy
,
r2
->
plane
->
height
);
if
(
rover
->
mobjflags
&
MF_NOCLIPHEIGHT
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment