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
1cf2ce63
Commit
1cf2ce63
authored
7 years ago
by
Monster Iestyn
Browse files
Options
Downloads
Patches
Plain Diff
More optimising and otherwise fixing bizarre formatting in hw_trick.c
parent
2107aab6
Branches
Branches containing commit
No related tags found
2 merge requests
!488
Merge in next and don't billboard papersprites in GL
,
!304
Opengl improvements backport
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/hw_trick.c
+23
-33
23 additions, 33 deletions
src/hardware/hw_trick.c
with
23 additions
and
33 deletions
src/hardware/hw_trick.c
+
23
−
33
View file @
1cf2ce63
...
@@ -107,17 +107,17 @@ static void releaseLineChains(void)
...
@@ -107,17 +107,17 @@ static void releaseLineChains(void)
for
(
i
=
0
;
i
<
numsectors
;
i
++
)
for
(
i
=
0
;
i
<
numsectors
;
i
++
)
{
{
sector
=
&
sectors
[
i
];
sector
=
&
sectors
[
i
];
nextElem
=
sector
->
sectorLines
;
nextElem
=
sector
->
sectorLines
;
while
(
nextElem
)
while
(
nextElem
)
{
{
thisElem
=
nextElem
;
thisElem
=
nextElem
;
nextElem
=
thisElem
->
next
;
nextElem
=
thisElem
->
next
;
free
(
thisElem
);
free
(
thisElem
);
}
}
sector
->
sectorLines
=
NULL
;
sector
->
sectorLines
=
NULL
;
}
}
}
}
...
@@ -397,7 +397,7 @@ static void sortStacklist(sector_t *sector)
...
@@ -397,7 +397,7 @@ static void sortStacklist(sector_t *sector)
i
=
0
;
i
=
0
;
finished
=
true
;
finished
=
true
;
while
(
NULL
!=
*
(
list
+
i
+
1
))
while
(
*
(
list
+
i
+
1
))
{
{
sec1
=
*
(
list
+
i
);
sec1
=
*
(
list
+
i
);
sec2
=
*
(
list
+
i
+
1
);
sec2
=
*
(
list
+
i
+
1
);
...
@@ -438,7 +438,7 @@ static double calcLineoutLength(sector_t *sector)
...
@@ -438,7 +438,7 @@ static double calcLineoutLength(sector_t *sector)
double
length
=
0
.
0L
;
double
length
=
0
.
0L
;
chain
=
sector
->
sectorLines
;
chain
=
sector
->
sectorLines
;
while
(
NULL
!=
chain
)
// sum up lengths of all lines
while
(
chain
)
// sum up lengths of all lines
{
{
length
+=
lineLength
(
chain
->
line
);
length
+=
lineLength
(
chain
->
line
);
chain
=
chain
->
next
;
chain
=
chain
->
next
;
...
@@ -454,7 +454,7 @@ static void calcLineouts(sector_t *sector)
...
@@ -454,7 +454,7 @@ static void calcLineouts(sector_t *sector)
size_t
secCount
=
0
;
size_t
secCount
=
0
;
sector_t
*
encSector
=
*
(
sector
->
stackList
);
sector_t
*
encSector
=
*
(
sector
->
stackList
);
while
(
NULL
!=
encSector
)
while
(
encSector
)
{
{
if
(
encSector
->
lineoutLength
<
0
.
0L
)
// if length has not yet been calculated
if
(
encSector
->
lineoutLength
<
0
.
0L
)
// if length has not yet been calculated
{
{
...
@@ -552,7 +552,7 @@ static boolean areBottomtexturesMissing(sector_t *thisSector)
...
@@ -552,7 +552,7 @@ static boolean areBottomtexturesMissing(sector_t *thisSector)
if
(
frontSector
==
backSector
)
// skip damn renderer tricks here
if
(
frontSector
==
backSector
)
// skip damn renderer tricks here
continue
;
continue
;
if
(
frontSector
==
NULL
||
backSector
==
NULL
)
if
(
!
frontSector
||
!
backSector
)
continue
;
continue
;
sider
=
&
sides
[
thisElem
->
line
->
sidenum
[
0
]];
sider
=
&
sides
[
thisElem
->
line
->
sidenum
[
0
]];
...
@@ -645,7 +645,7 @@ static boolean isFloorFloating(sector_t *thisSector)
...
@@ -645,7 +645,7 @@ static boolean isFloorFloating(sector_t *thisSector)
if
(
!
thisSector
)
if
(
!
thisSector
)
return
false
;
return
false
;
nextElem
=
thisSector
->
sectorLines
;
nextElem
=
thisSector
->
sectorLines
;
while
(
nextElem
)
// walk through chain
while
(
nextElem
)
// walk through chain
{
{
...
@@ -693,14 +693,12 @@ static fixed_t estimateCeilHeight(sector_t *thisSector)
...
@@ -693,14 +693,12 @@ static fixed_t estimateCeilHeight(sector_t *thisSector)
{
{
sector_t
*
adjSector
;
sector_t
*
adjSector
;
if
(
!
thisSector
||
if
(
!
thisSector
||
!
thisSector
->
sectorLines
||
!
thisSector
->
sectorLines
->
line
)
!
thisSector
->
sectorLines
||
!
thisSector
->
sectorLines
->
line
)
return
0
;
return
0
;
adjSector
=
thisSector
->
sectorLines
->
line
->
frontsector
;
adjSector
=
thisSector
->
sectorLines
->
line
->
frontsector
;
if
(
adjSector
==
thisSector
)
if
(
adjSector
==
thisSector
)
adjSector
=
thisSector
->
sectorLines
->
line
->
backsector
;
adjSector
=
thisSector
->
sectorLines
->
line
->
backsector
;
if
(
!
adjSector
)
if
(
!
adjSector
)
return
0
;
return
0
;
...
@@ -715,17 +713,15 @@ static fixed_t estimateFloorHeight(sector_t *thisSector)
...
@@ -715,17 +713,15 @@ static fixed_t estimateFloorHeight(sector_t *thisSector)
{
{
sector_t
*
adjSector
;
sector_t
*
adjSector
;
if
(
!
thisSector
||
if
(
!
thisSector
||
!
thisSector
->
sectorLines
||
!
thisSector
->
sectorLines
->
line
)
!
thisSector
->
sectorLines
||
return
0
;
!
thisSector
->
sectorLines
->
line
)
return
0
;
adjSector
=
thisSector
->
sectorLines
->
line
->
frontsector
;
adjSector
=
thisSector
->
sectorLines
->
line
->
frontsector
;
if
(
adjSector
==
thisSector
)
if
(
adjSector
==
thisSector
)
adjSector
=
thisSector
->
sectorLines
->
line
->
backsector
;
adjSector
=
thisSector
->
sectorLines
->
line
->
backsector
;
if
(
NULL
==
adjSector
)
if
(
!
adjSector
)
return
0
;
return
0
;
return
adjSector
->
floorheight
;
return
adjSector
->
floorheight
;
}
}
...
@@ -831,18 +827,12 @@ void HWR_CorrectSWTricks(void)
...
@@ -831,18 +827,12 @@ void HWR_CorrectSWTricks(void)
// correct height of floating sectors
// correct height of floating sectors
if
(
isCeilingFloating
(
floatSector
))
if
(
isCeilingFloating
(
floatSector
))
{
{
fixed_t
corrheight
;
floatSector
->
virtualCeilingheight
=
estimateCeilHeight
(
floatSector
);
corrheight
=
estimateCeilHeight
(
floatSector
);
floatSector
->
virtualCeilingheight
=
corrheight
;
floatSector
->
virtualCeiling
=
true
;
floatSector
->
virtualCeiling
=
true
;
}
}
if
(
isFloorFloating
(
floatSector
))
if
(
isFloorFloating
(
floatSector
))
{
{
fixed_t
corrheight
;
floatSector
->
virtualFloorheight
=
estimateFloorHeight
(
floatSector
);
corrheight
=
estimateFloorHeight
(
floatSector
);
floatSector
->
virtualFloorheight
=
corrheight
;
floatSector
->
virtualFloor
=
true
;
floatSector
->
virtualFloor
=
true
;
}
}
}
}
...
...
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