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
e3b17cd8
Commit
e3b17cd8
authored
5 years ago
by
fickleheart
Browse files
Options
Downloads
Patches
Plain Diff
Use po2 patches to fix mipmaps
parent
b9d7b3e5
No related branches found
No related tags found
2 merge requests
!848
shaders master merge and mipmap fix
,
!724
OpenGL shaders
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/hw_cache.c
+12
-9
12 additions, 9 deletions
src/hardware/hw_cache.c
with
12 additions
and
9 deletions
src/hardware/hw_cache.c
+
12
−
9
View file @
e3b17cd8
...
@@ -298,13 +298,13 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
...
@@ -298,13 +298,13 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
if
(
pwidth
<=
0
||
pheight
<=
0
)
if
(
pwidth
<=
0
||
pheight
<=
0
)
return
;
return
;
ncols
=
(
pwidth
*
pblockwidth
)
/
pwidth
;
ncols
=
pwidth
;
// source advance
// source advance
xfrac
=
0
;
xfrac
=
0
;
xfracstep
=
(
pwidth
<<
FRACBITS
)
/
pblockwidth
;
xfracstep
=
FRACUNIT
;
yfracstep
=
(
pheight
<<
FRACBITS
)
/
pblockheight
;
yfracstep
=
FRACUNIT
;
scale_y
=
(
pblockheight
<<
FRACBITS
)
/
pheight
;
scale_y
=
FRACUNIT
;
bpp
=
format2bpp
[
mipmap
->
grInfo
.
format
];
bpp
=
format2bpp
[
mipmap
->
grInfo
.
format
];
...
@@ -573,13 +573,18 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
...
@@ -573,13 +573,18 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
grPatch
->
leftoffset
=
SHORT
(
patch
->
leftoffset
);
grPatch
->
leftoffset
=
SHORT
(
patch
->
leftoffset
);
grPatch
->
topoffset
=
SHORT
(
patch
->
topoffset
);
grPatch
->
topoffset
=
SHORT
(
patch
->
topoffset
);
grMipmap
->
width
=
(
UINT16
)
SHORT
(
patch
->
width
);
grMipmap
->
width
=
grMipmap
->
height
=
1
;
grMipmap
->
height
=
(
UINT16
)
SHORT
(
patch
->
height
);
while
(
grMipmap
->
width
<
grPatch
->
width
)
grMipmap
->
width
<<=
1
;
while
(
grMipmap
->
height
<
grPatch
->
height
)
grMipmap
->
height
<<=
1
;
// no wrap around, no chroma key
// no wrap around, no chroma key
grMipmap
->
flags
=
0
;
grMipmap
->
flags
=
0
;
// setup the texture info
// setup the texture info
grMipmap
->
grInfo
.
format
=
patchformat
;
grMipmap
->
grInfo
.
format
=
patchformat
;
//grPatch->max_s = grPatch->max_t = 1.0f;
grPatch
->
max_s
=
(
float
)
grPatch
->
width
/
(
float
)
grMipmap
->
width
;
grPatch
->
max_t
=
(
float
)
grPatch
->
height
/
(
float
)
grMipmap
->
height
;
}
}
Z_Free
(
grMipmap
->
grInfo
.
data
);
Z_Free
(
grMipmap
->
grInfo
.
data
);
...
@@ -590,12 +595,10 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
...
@@ -590,12 +595,10 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
MakeBlock
(
grMipmap
);
MakeBlock
(
grMipmap
);
HWR_DrawPatchInCache
(
grMipmap
,
HWR_DrawPatchInCache
(
grMipmap
,
gr
Patch
->
width
,
gr
Patch
->
height
,
gr
Mipmap
->
width
,
gr
Mipmap
->
height
,
grPatch
->
width
,
grPatch
->
height
,
grPatch
->
width
,
grPatch
->
height
,
patch
);
patch
);
}
}
grPatch
->
max_s
=
grPatch
->
max_t
=
1
.
0
f
;
}
}
...
...
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