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
801f7547
Commit
801f7547
authored
7 years ago
by
Sryder
Browse files
Options
Downloads
Patches
Plain Diff
Add the full-screen drawfill functionality to HWR_DrawFixedPatch
parent
7830c031
No related branches found
No related tags found
2 merge requests
!252
OpenGL: Public flatsprite: The Fixening
,
!237
Opengl Quick Fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/hw_draw.c
+12
-8
12 additions, 8 deletions
src/hardware/hw_draw.c
with
12 additions
and
8 deletions
src/hardware/hw_draw.c
+
12
−
8
View file @
801f7547
...
...
@@ -203,6 +203,18 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
if
(
!
(
option
&
V_SCALEPATCHMASK
))
{
// if it's meant to cover the whole screen, black out the rest
// cx and cy are possibly *slightly* off from float maths
// This is done before here compared to software because we directly alter cx and cy to centre
if
(
cx
>=
-
0
.
1
f
&&
cx
<=
0
.
1
f
&&
SHORT
(
gpatch
->
width
)
==
BASEVIDWIDTH
&&
cy
>=
-
0
.
1
f
&&
cy
<=
0
.
1
f
&&
SHORT
(
gpatch
->
height
)
==
BASEVIDHEIGHT
)
{
// Need to temporarily cache the real patch to get the colour of the top left pixel
patch_t
*
realpatch
=
W_CacheLumpNumPwad
(
gpatch
->
wadnum
,
gpatch
->
lumpnum
,
PU_STATIC
);
const
column_t
*
column
=
(
const
column_t
*
)((
const
UINT8
*
)(
realpatch
)
+
LONG
((
realpatch
)
->
columnofs
[
0
]));
const
UINT8
*
source
=
(
const
UINT8
*
)(
column
)
+
3
;
HWR_DrawFill
(
0
,
0
,
BASEVIDWIDTH
,
BASEVIDHEIGHT
,
(
column
->
topdelta
==
0xff
?
31
:
source
[
0
]));
Z_Free
(
realpatch
);
}
// centre screen
if
(
vid
.
width
!=
BASEVIDWIDTH
*
vid
.
dupx
)
{
...
...
@@ -220,14 +232,6 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
else
if
(
!
(
option
&
V_SNAPTOTOP
))
cy
+=
((
float
)
vid
.
height
-
((
float
)
BASEVIDHEIGHT
*
dupy
))
/
2
;
}
// if it's meant to cover the whole screen, black out the rest
// TODO
/*if (x == 0 && SHORT(gpatch->width) == BASEVIDWIDTH && y == 0 && SHORT(gpatch->height) == BASEVIDHEIGHT)
{
const column_t *column = (const column_t *)((const UINT8 *)((patch_t *)gpatch) + LONG(((patch_t *)gpatch)->columnofs[0]));
const UINT8 *source = (const UINT8 *)(column) + 3;
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}*/
}
}
...
...
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