Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model 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
SSNTails
SRB2
Commits
6145442a
Commit
6145442a
authored
4 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Fix rotated flipped patches
parent
b2f45986
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/r_patchrotation.c
+5
-7
5 additions, 7 deletions
src/r_patchrotation.c
with
5 additions
and
7 deletions
src/r_patchrotation.c
+
5
−
7
View file @
6145442a
...
@@ -127,17 +127,15 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
...
@@ -127,17 +127,15 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
#define ROTSPRITE_YCENTER (newheight / 2)
#define ROTSPRITE_YCENTER (newheight / 2)
if
(
flip
)
if
(
flip
)
idx
+=
rotsprite
->
angles
;
if
(
rotsprite
->
patches
[
idx
])
return
;
if
(
bflip
)
{
{
idx
+=
rotsprite
->
angles
;
xpivot
=
width
-
xpivot
;
xpivot
=
width
-
xpivot
;
leftoffset
=
width
-
leftoffset
;
leftoffset
=
width
-
leftoffset
;
}
}
if
(
rotsprite
->
patches
[
idx
])
return
;
// Find the dimensions of the rotated patch.
// Find the dimensions of the rotated patch.
{
{
INT32
w1
=
abs
(
FixedMul
(
width
<<
FRACBITS
,
ca
)
-
FixedMul
(
height
<<
FRACBITS
,
sa
));
INT32
w1
=
abs
(
FixedMul
(
width
<<
FRACBITS
,
ca
)
-
FixedMul
(
height
<<
FRACBITS
,
sa
));
...
@@ -226,7 +224,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
...
@@ -226,7 +224,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
rotated
=
(
patch_t
*
)
Picture_Convert
(
PICFMT_FLAT16
,
rawdst
,
PICFMT_PATCH
,
0
,
&
size
,
newwidth
,
newheight
,
0
,
0
,
0
);
rotated
=
(
patch_t
*
)
Picture_Convert
(
PICFMT_FLAT16
,
rawdst
,
PICFMT_PATCH
,
0
,
&
size
,
newwidth
,
newheight
,
0
,
0
,
0
);
Z_ChangeTag
(
rotated
,
PU_PATCH_ROTATED
);
Z_ChangeTag
(
rotated
,
PU_PATCH_ROTATED
);
Z_SetUser
(
rotated
,
(
void
**
)(
&
rotsprite
->
patches
[
angle
]));
Z_SetUser
(
rotated
,
(
void
**
)(
&
rotsprite
->
patches
[
idx
]));
rotated
->
leftoffset
=
(
rotated
->
width
/
2
)
+
(
leftoffset
-
xpivot
);
rotated
->
leftoffset
=
(
rotated
->
width
/
2
)
+
(
leftoffset
-
xpivot
);
rotated
->
topoffset
=
(
rotated
->
height
/
2
)
+
(
patch
->
topoffset
-
ypivot
);
rotated
->
topoffset
=
(
rotated
->
height
/
2
)
+
(
patch
->
topoffset
-
ypivot
);
...
...
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