Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
fff0b3e6
Commit
fff0b3e6
authored
5 years ago
by
MascaraSnake
Browse files
Options
Downloads
Patches
Plain Diff
Adapt setup of copy slope linedef to UDMF
parent
ddb1a194
No related branches found
No related tags found
2 merge requests
!1075
Merge udmf-next into next
,
!643
Add UDMF linedef arguments and make slope specials use them
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/p_setup.c
+9
-0
9 additions, 0 deletions
src/p_setup.c
src/p_slopes.c
+61
-17
61 additions, 17 deletions
src/p_slopes.c
with
70 additions
and
17 deletions
src/p_setup.c
+
9
−
0
View file @
fff0b3e6
...
...
@@ -2720,6 +2720,15 @@ static void P_ConvertBinaryMap(void)
lines
[
i
].
special
=
704
;
break
;
}
case
720
:
//Copy front side floor slope
case
721
:
//Copy front side ceiling slope
case
722
:
//Copy front side floor and ceiling slope
if
(
lines
[
i
].
special
!=
721
)
lines
[
i
].
args
[
0
]
=
lines
[
i
].
tag
;
if
(
lines
[
i
].
special
!=
720
)
lines
[
i
].
args
[
1
]
=
lines
[
i
].
tag
;
lines
[
i
].
special
=
720
;
break
;
default:
break
;
}
...
...
This diff is collapsed.
Click to expand it.
src/p_slopes.c
+
61
−
17
View file @
fff0b3e6
...
...
@@ -489,6 +489,46 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
side
->
sector
->
hasslope
=
true
;
}
static
boolean
P_SetSlopeFromTag
(
sector_t
*
sec
,
INT32
tag
,
boolean
ceiling
)
{
INT32
i
;
pslope_t
**
secslope
=
ceiling
?
&
sec
->
c_slope
:
&
sec
->
f_slope
;
if
(
!
tag
||
*
secslope
)
return
false
;
for
(
i
=
-
1
;
(
i
=
P_FindSectorFromTag
(
tag
,
i
))
>=
0
;)
{
pslope_t
*
srcslope
=
ceiling
?
sectors
[
i
].
c_slope
:
sectors
[
i
].
f_slope
;
if
(
srcslope
)
{
*
secslope
=
srcslope
;
return
true
;
}
}
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
...
...
@@ -498,25 +538,31 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
void
P_CopySectorSlope
(
line_t
*
line
)
{
sector_t
*
fsec
=
line
->
frontsector
;
int
i
,
special
=
line
->
special
;
sector_t
*
bsec
=
line
->
backsector
;
boolean
setfront
=
false
;
boolean
setback
=
false
;
// Check for copy linedefs
for
(
i
=
-
1
;
(
i
=
P_FindSectorFromLineTag
(
line
,
i
))
>=
0
;)
setfront
|=
P_SetSlopeFromTag
(
fsec
,
line
->
args
[
0
],
false
);
setfront
|=
P_SetSlopeFromTag
(
fsec
,
line
->
args
[
1
],
true
);
if
(
bsec
)
{
sector_t
*
srcsec
=
sectors
+
i
;
if
((
special
-
719
)
&
1
&&
!
fsec
->
f_slope
&&
srcsec
->
f_slope
)
fsec
->
f_slope
=
srcsec
->
f_slope
;
//P_CopySlope(srcsec->f_slope);
if
((
special
-
719
)
&
2
&&
!
fsec
->
c_slope
&&
srcsec
->
c_slope
)
fsec
->
c_slope
=
srcsec
->
c_slope
;
//P_CopySlope(srcsec->c_slope);
setback
|=
P_SetSlopeFromTag
(
bsec
,
line
->
args
[
2
],
false
);
setback
|=
P_SetSlopeFromTag
(
bsec
,
line
->
args
[
3
],
true
);
if
(
line
->
args
[
4
]
&
1
)
setback
|=
P_CopySlope
(
&
bsec
->
f_slope
,
fsec
->
f_slope
);
if
(
line
->
args
[
4
]
&
2
)
setfront
|=
P_CopySlope
(
&
fsec
->
f_slope
,
bsec
->
f_slope
);
if
(
line
->
args
[
4
]
&
4
)
setback
|=
P_CopySlope
(
&
bsec
->
c_slope
,
fsec
->
c_slope
);
if
(
line
->
args
[
4
]
&
8
)
setfront
|=
P_CopySlope
(
&
fsec
->
c_slope
,
bsec
->
c_slope
);
}
fsec
->
hasslope
=
true
;
// if this is an FOF control sector, make sure any target sectors also are marked as having slopes
if
(
fsec
->
numattached
)
for
(
i
=
0
;
i
<
(
int
)
fsec
->
numattached
;
i
++
)
sectors
[
fsec
->
attached
[
i
]].
hasslope
=
true
;
if
(
setfront
)
P_UpdateHasSlope
(
fsec
);
if
(
setback
)
P_UpdateHasSlope
(
bsec
);
line
->
special
=
0
;
// Linedef was use to set slopes, it finished its job, so now make it a normal linedef
}
...
...
@@ -563,8 +609,6 @@ void P_ResetDynamicSlopes(const boolean fromsave) {
switch
(
lines
[
i
].
special
)
{
case
720
:
case
721
:
case
722
:
P_CopySectorSlope
(
&
lines
[
i
]);
default:
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment