Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2Classic
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
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PAS
SRB2Classic
Commits
494b4d64
Commit
494b4d64
authored
2 weeks ago
by
Hanicef
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'luigi/drawflatfill-gl-fix' into next
parents
64aa5cd9
b3097b71
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/hw_draw.c
+52
-19
52 additions, 19 deletions
src/hardware/hw_draw.c
with
52 additions
and
19 deletions
src/hardware/hw_draw.c
+
52
−
19
View file @
494b4d64
...
...
@@ -599,43 +599,76 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
// --------------------------------------------------------------------------
// Fills a box of pixels using a flat texture as a pattern
// Fixed to properly align like the other draw functions -luigi budd
// --------------------------------------------------------------------------
void
HWR_DrawFlatFill
(
INT32
x
,
INT32
y
,
INT32
w
,
INT32
h
,
lumpnum_t
flatlumpnum
)
void
HWR_DrawFlatFill
(
INT32
x
,
INT32
y
,
INT32
w
,
INT32
h
,
lumpnum_t
flatlumpnum
)
{
FOutVector
v
[
4
];
const
size_t
len
=
W_LumpLength
(
flatlumpnum
);
UINT16
flatflag
=
R_GetFlatSize
(
len
)
-
1
;
double
dflatsize
=
(
double
)(
flatflag
+
1
);
UINT16
flatflag
=
R_GetFlatSize
(
len
);
double
dflatsize
=
(
double
)(
flatflag
);
// compilers are COOL!
float
dup
=
(
float
)
vid
.
dup
;
float
fx
=
(
float
)
x
*
dup
;
float
fy
=
(
float
)
y
*
dup
;
float
fw
=
(
float
)
w
*
dup
;
float
fh
=
(
float
)
h
*
dup
;
/*
fx *= dup;
fy *= dup;
fw *= dup;
fh *= dup;
*/
if
(
fw
<=
0
||
fh
<=
0
)
return
;
if
(
fabsf
((
float
)
vid
.
width
-
(
float
)
BASEVIDWIDTH
*
vid
.
dup
)
>
1.0E-36
f
)
{
fx
+=
((
float
)
vid
.
width
-
((
float
)
BASEVIDWIDTH
*
vid
.
dup
))
/
2
;
}
if
(
fabsf
((
float
)
vid
.
height
-
(
float
)
BASEVIDHEIGHT
*
vid
.
dup
)
>
1.0E-36
f
)
{
fy
+=
((
float
)
vid
.
height
-
((
float
)
BASEVIDHEIGHT
*
vid
.
dup
))
/
2
;
}
if
(
fx
>=
vid
.
width
||
fy
>=
vid
.
height
)
return
;
fx
=
-
1
.
0
f
+
(
fx
/
(
vid
.
width
/
2
.
0
f
));
fy
=
1
.
0
f
-
(
fy
/
(
vid
.
height
/
2
.
0
f
));
fw
/=
vid
.
width
/
2
;
fh
/=
vid
.
height
/
2
;
// 3--2
// | /|
// |/ |
// 0--1
// position vertices
v
[
0
].
x
=
v
[
3
].
x
=
fx
;
v
[
2
].
x
=
v
[
1
].
x
=
fx
+
fw
;
v
[
0
].
x
=
v
[
3
].
x
=
(
x
-
160
.
0
f
)
/
160
.
0
f
;
v
[
2
].
x
=
v
[
1
].
x
=
((
x
+
w
)
-
160
.
0
f
)
/
160
.
0
f
;
v
[
0
].
y
=
v
[
1
].
y
=
-
(
y
-
100
.
0
f
)
/
100
.
0
f
;
v
[
2
].
y
=
v
[
3
].
y
=
-
((
y
+
h
)
-
100
.
0
f
)
/
100
.
0
f
;
v
[
0
].
y
=
v
[
1
].
y
=
fy
;
v
[
2
].
y
=
v
[
3
].
y
=
fy
-
fh
;
v
[
0
].
z
=
v
[
1
].
z
=
v
[
2
].
z
=
v
[
3
].
z
=
1
.
0
f
;
v
[
0
].
s
=
v
[
3
].
s
=
(
float
)((
x
&
flatflag
)
/
dflatsize
);
v
[
2
].
s
=
v
[
1
].
s
=
(
float
)(
v
[
0
].
s
+
w
/
dflatsize
);
v
[
0
].
t
=
v
[
1
].
t
=
(
float
)((
y
&
flatflag
)
/
dflatsize
);
v
[
2
].
t
=
v
[
3
].
t
=
(
float
)(
v
[
0
].
t
+
h
/
dflatsize
);
// sides
v
[
0
].
s
=
v
[
3
].
s
=
(
float
)(
flatflag
/
dflatsize
)
*
2
;
v
[
2
].
s
=
v
[
1
].
s
=
(
float
)(
v
[
0
].
s
+
w
/
dflatsize
)
*
2
;
HWR_GetRawFlat
(
flatlumpnum
);
// top/bottom
v
[
0
].
t
=
v
[
1
].
t
=
(
float
)(
flatflag
/
dflatsize
)
*
2
;
v
[
2
].
t
=
v
[
3
].
t
=
(
float
)(
v
[
0
].
t
+
h
/
dflatsize
)
*
2
;
//Hurdler: Boris, the same comment as above... but maybe for pics
// it not a problem since they don't have any transparent pixel
// if I'm right !?
// BTW, I see we put 0 for PFs, and If I'm right, that
// means we take the previous PFs as default
// how can we be sure they are ok?
// needed to texture the poly
HWR_GetRawFlat
(
flatlumpnum
);
HWD
.
pfnDrawPolygon
(
NULL
,
v
,
4
,
PF_NoDepthTest
);
//PF_Translucent);
}
// --------------------------------------------------------------------------
// Fade down the screen so that the menu drawn on top of it looks brighter
// --------------------------------------------------------------------------
...
...
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