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
1c02badd
Commit
1c02badd
authored
5 months ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Set r_viewmobj when rendering type 8 sector portals
parent
05d9b59f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2545
Fix sector portal heights
Pipeline
#6214
passed
5 months ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/r_main.c
+3
-0
3 additions, 0 deletions
src/r_main.c
src/r_portal.c
+4
-17
4 additions, 17 deletions
src/r_portal.c
src/r_portal.h
+2
-0
2 additions, 0 deletions
src/r_portal.h
with
9 additions
and
17 deletions
src/r_main.c
+
3
−
0
View file @
1c02badd
...
@@ -1434,6 +1434,9 @@ static void R_PortalFrame(portal_t *portal)
...
@@ -1434,6 +1434,9 @@ static void R_PortalFrame(portal_t *portal)
viewsin
=
FINESINE
(
viewangle
>>
ANGLETOFINESHIFT
);
viewsin
=
FINESINE
(
viewangle
>>
ANGLETOFINESHIFT
);
viewcos
=
FINECOSINE
(
viewangle
>>
ANGLETOFINESHIFT
);
viewcos
=
FINECOSINE
(
viewangle
>>
ANGLETOFINESHIFT
);
if
(
!
P_MobjWasRemoved
(
portal
->
viewmobj
))
r_viewmobj
=
portal
->
viewmobj
;
portalclipstart
=
portal
->
start
;
portalclipstart
=
portal
->
start
;
portalclipend
=
portal
->
end
;
portalclipend
=
portal
->
end
;
...
...
This diff is collapsed.
Click to expand it.
src/r_portal.c
+
4
−
17
View file @
1c02badd
...
@@ -101,7 +101,7 @@ void Portal_ClipApply (const portal_t* portal)
...
@@ -101,7 +101,7 @@ void Portal_ClipApply (const portal_t* portal)
static
portal_t
*
Portal_Add
(
const
INT16
x1
,
const
INT16
x2
)
static
portal_t
*
Portal_Add
(
const
INT16
x1
,
const
INT16
x2
)
{
{
portal_t
*
portal
=
Z_
M
alloc
(
sizeof
(
portal_t
),
PU_LEVEL
,
NULL
);
portal_t
*
portal
=
Z_
C
alloc
(
sizeof
(
portal_t
),
PU_LEVEL
,
NULL
);
INT16
*
ceilingclipsave
=
Z_Malloc
(
sizeof
(
INT16
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
INT16
*
ceilingclipsave
=
Z_Malloc
(
sizeof
(
INT16
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
INT16
*
floorclipsave
=
Z_Malloc
(
sizeof
(
INT16
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
INT16
*
floorclipsave
=
Z_Malloc
(
sizeof
(
INT16
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
fixed_t
*
frontscalesave
=
Z_Malloc
(
sizeof
(
fixed_t
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
fixed_t
*
frontscalesave
=
Z_Malloc
(
sizeof
(
fixed_t
)
*
(
x2
-
x1
+
1
),
PU_LEVEL
,
NULL
);
...
@@ -117,7 +117,7 @@ static portal_t* Portal_Add (const INT16 x1, const INT16 x2)
...
@@ -117,7 +117,7 @@ static portal_t* Portal_Add (const INT16 x1, const INT16 x2)
portal_cap
->
next
=
portal
;
portal_cap
->
next
=
portal
;
portal_cap
=
portal
;
portal_cap
=
portal
;
}
}
portal
->
next
=
NULL
;
portal
->
clipline
=
-
1
;
// Store clipping values so they can be restored once the portal is rendered.
// Store clipping values so they can be restored once the portal is rendered.
portal
->
ceilingclip
=
ceilingclipsave
;
portal
->
ceilingclip
=
ceilingclipsave
;
...
@@ -193,9 +193,6 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con
...
@@ -193,9 +193,6 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con
portal
->
viewz
=
viewz
+
dest
->
frontsector
->
floorheight
-
start
->
frontsector
->
floorheight
;
portal
->
viewz
=
viewz
+
dest
->
frontsector
->
floorheight
-
start
->
frontsector
->
floorheight
;
portal
->
clipline
=
line2
;
portal
->
clipline
=
line2
;
portal
->
is_skybox
=
false
;
portal
->
is_horizon
=
false
;
portal
->
horizon_sector
=
NULL
;
Portal_ClipRange
(
portal
);
Portal_ClipRange
(
portal
);
...
@@ -318,10 +315,7 @@ static boolean Portal_AddSkybox (const visplane_t* plane)
...
@@ -318,10 +315,7 @@ static boolean Portal_AddSkybox (const visplane_t* plane)
Portal_ClipVisplane
(
plane
,
portal
);
Portal_ClipVisplane
(
plane
,
portal
);
portal
->
clipline
=
-
1
;
portal
->
is_skybox
=
true
;
portal
->
is_skybox
=
true
;
portal
->
is_horizon
=
false
;
portal
->
horizon_sector
=
NULL
;
Portal_GetViewpointForSkybox
(
portal
);
Portal_GetViewpointForSkybox
(
portal
);
...
@@ -352,8 +346,9 @@ static void Portal_GetViewpointForSecPortal(portal_t *portal, sectorportal_t *se
...
@@ -352,8 +346,9 @@ static void Portal_GetViewpointForSecPortal(portal_t *portal, sectorportal_t *se
portal
->
viewz
=
viewz
;
// Apparently it just works like that. Not going to question it.
portal
->
viewz
=
viewz
;
// Apparently it just works like that. Not going to question it.
return
;
return
;
case
SECPORTAL_OBJECT
:
case
SECPORTAL_OBJECT
:
if
(
!
secportal
->
mobj
||
P_MobjWasRemoved
(
secportal
->
mobj
))
if
(
P_MobjWasRemoved
(
secportal
->
mobj
))
return
;
return
;
portal
->
viewmobj
=
secportal
->
mobj
;
x
=
secportal
->
mobj
->
x
;
x
=
secportal
->
mobj
->
x
;
y
=
secportal
->
mobj
->
y
;
y
=
secportal
->
mobj
->
y
;
z
=
secportal
->
mobj
->
z
;
z
=
secportal
->
mobj
->
z
;
...
@@ -428,11 +423,6 @@ static boolean Portal_AddSectorPortal (const visplane_t* plane)
...
@@ -428,11 +423,6 @@ static boolean Portal_AddSectorPortal (const visplane_t* plane)
Portal_ClipVisplane
(
plane
,
portal
);
Portal_ClipVisplane
(
plane
,
portal
);
portal
->
clipline
=
-
1
;
portal
->
is_horizon
=
false
;
portal
->
is_skybox
=
false
;
portal
->
horizon_sector
=
NULL
;
Portal_GetViewpointForSecPortal
(
portal
,
secportal
);
Portal_GetViewpointForSecPortal
(
portal
,
secportal
);
return
true
;
return
true
;
...
@@ -450,9 +440,6 @@ void Portal_AddTransferred (const UINT32 secportalnum, const INT32 x1, const INT
...
@@ -450,9 +440,6 @@ void Portal_AddTransferred (const UINT32 secportalnum, const INT32 x1, const INT
return
;
return
;
portal_t
*
portal
=
Portal_Add
(
x1
,
x2
);
portal_t
*
portal
=
Portal_Add
(
x1
,
x2
);
portal
->
is_skybox
=
false
;
portal
->
is_horizon
=
false
;
portal
->
horizon_sector
=
NULL
;
if
(
secportal
->
type
==
SECPORTAL_SKYBOX
)
if
(
secportal
->
type
==
SECPORTAL_SKYBOX
)
Portal_GetViewpointForSkybox
(
portal
);
Portal_GetViewpointForSkybox
(
portal
);
...
...
This diff is collapsed.
Click to expand it.
src/r_portal.h
+
2
−
0
View file @
1c02badd
...
@@ -36,6 +36,8 @@ typedef struct portal_s
...
@@ -36,6 +36,8 @@ typedef struct portal_s
boolean
is_skybox
;
boolean
is_skybox
;
mobj_t
*
viewmobj
;
UINT8
pass
;
/**< Keeps track of the portal's recursion depth. */
UINT8
pass
;
/**< Keeps track of the portal's recursion depth. */
INT32
clipline
;
/**< Optional clipline for line-based portals. */
INT32
clipline
;
/**< Optional clipline for line-based portals. */
...
...
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