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
a4a529bd
Commit
a4a529bd
authored
6 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Hardware renderer: Disable Glide-specific texture handling
parent
dfd8beae
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/hardware/hw_cache.c
+15
-0
15 additions, 0 deletions
src/hardware/hw_cache.c
src/hardware/hw_glide.h
+2
-0
2 additions, 0 deletions
src/hardware/hw_glide.h
src/hardware/hw_light.c
+2
-0
2 additions, 0 deletions
src/hardware/hw_light.c
src/hardware/hw_md2.c
+4
-0
4 additions, 0 deletions
src/hardware/hw_md2.c
with
23 additions
and
0 deletions
src/hardware/hw_cache.c
+
15
−
0
View file @
a4a529bd
...
@@ -190,6 +190,7 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
...
@@ -190,6 +190,7 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
static
void
HWR_ResizeBlock
(
INT32
originalwidth
,
INT32
originalheight
,
static
void
HWR_ResizeBlock
(
INT32
originalwidth
,
INT32
originalheight
,
GrTexInfo
*
grInfo
)
GrTexInfo
*
grInfo
)
{
{
#ifdef GLIDE_API_COMPATIBILITY
// Build the full textures from patches.
// Build the full textures from patches.
static
const
GrLOD_t
gr_lods
[
9
]
=
static
const
GrLOD_t
gr_lods
[
9
]
=
{
{
...
@@ -226,6 +227,9 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
...
@@ -226,6 +227,9 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
INT32
j
,
k
;
INT32
j
,
k
;
INT32
max
,
min
;
INT32
max
,
min
;
#else
(
void
)
grInfo
;
#endif
// find a power of 2 width/height
// find a power of 2 width/height
if
(
cv_grrounddown
.
value
)
if
(
cv_grrounddown
.
value
)
...
@@ -281,6 +285,7 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
...
@@ -281,6 +285,7 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
}
}
else
else
{
{
#ifdef GLIDE_API_COMPATIBILITY
//size up to nearest power of 2
//size up to nearest power of 2
blockwidth
=
1
;
blockwidth
=
1
;
while
(
blockwidth
<
originalwidth
)
while
(
blockwidth
<
originalwidth
)
...
@@ -298,9 +303,14 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
...
@@ -298,9 +303,14 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
if
(
blockheight
>
2048
)
if
(
blockheight
>
2048
)
blockheight
=
2048
;
blockheight
=
2048
;
//I_Error("3D GenerateTexture : too big");
//I_Error("3D GenerateTexture : too big");
#else
blockwidth
=
originalwidth
;
blockheight
=
originalheight
;
#endif
}
}
// do the boring LOD stuff.. blech!
// do the boring LOD stuff.. blech!
#ifdef GLIDE_API_COMPATIBILITY
if
(
blockwidth
>=
blockheight
)
if
(
blockwidth
>=
blockheight
)
{
{
max
=
blockwidth
;
max
=
blockwidth
;
...
@@ -332,6 +342,7 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
...
@@ -332,6 +342,7 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
if
(
blockwidth
<
blockheight
)
if
(
blockwidth
<
blockheight
)
j
+=
4
;
j
+=
4
;
grInfo
->
aspectRatioLog2
=
gr_aspects
[
j
].
aspect
;
grInfo
->
aspectRatioLog2
=
gr_aspects
[
j
].
aspect
;
#endif
blocksize
=
blockwidth
*
blockheight
;
blocksize
=
blockwidth
*
blockheight
;
...
@@ -684,9 +695,11 @@ static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum)
...
@@ -684,9 +695,11 @@ static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum)
size_t
size
,
pflatsize
;
size_t
size
,
pflatsize
;
// setup the texture info
// setup the texture info
#ifdef GLIDE_API_COMPATIBILITY
grMipmap
->
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
grMipmap
->
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
#endif
grMipmap
->
grInfo
.
format
=
GR_TEXFMT_P_8
;
grMipmap
->
grInfo
.
format
=
GR_TEXFMT_P_8
;
grMipmap
->
flags
=
TF_WRAPXY
|
TF_CHROMAKEYED
;
grMipmap
->
flags
=
TF_WRAPXY
|
TF_CHROMAKEYED
;
...
@@ -753,9 +766,11 @@ void HWR_GetFlat(lumpnum_t flatlumpnum)
...
@@ -753,9 +766,11 @@ void HWR_GetFlat(lumpnum_t flatlumpnum)
static
void
HWR_LoadTextureFlat
(
GLMipmap_t
*
grMipmap
,
INT32
texturenum
)
static
void
HWR_LoadTextureFlat
(
GLMipmap_t
*
grMipmap
,
INT32
texturenum
)
{
{
// setup the texture info
// setup the texture info
#ifdef GLIDE_API_COMPATIBILITY
grMipmap
->
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_64
;
grMipmap
->
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
grMipmap
->
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
#endif
grMipmap
->
grInfo
.
format
=
GR_TEXFMT_P_8
;
grMipmap
->
grInfo
.
format
=
GR_TEXFMT_P_8
;
grMipmap
->
flags
=
TF_WRAPXY
|
TF_CHROMAKEYED
;
grMipmap
->
flags
=
TF_WRAPXY
|
TF_CHROMAKEYED
;
...
...
This diff is collapsed.
Click to expand it.
src/hardware/hw_glide.h
+
2
−
0
View file @
a4a529bd
...
@@ -59,9 +59,11 @@ typedef FxI32 GrTextureFormat_t;
...
@@ -59,9 +59,11 @@ typedef FxI32 GrTextureFormat_t;
typedef
struct
typedef
struct
{
{
#ifdef GLIDE_API_COMPATIBILITY
GrLOD_t
smallLodLog2
;
GrLOD_t
smallLodLog2
;
GrLOD_t
largeLodLog2
;
GrLOD_t
largeLodLog2
;
GrAspectRatio_t
aspectRatioLog2
;
GrAspectRatio_t
aspectRatioLog2
;
#endif
GrTextureFormat_t
format
;
GrTextureFormat_t
format
;
void
*
data
;
void
*
data
;
}
GrTexInfo
;
}
GrTexInfo
;
...
...
This diff is collapsed.
Click to expand it.
src/hardware/hw_light.c
+
2
−
0
View file @
a4a529bd
...
@@ -1112,9 +1112,11 @@ static void HWR_SetLight(void)
...
@@ -1112,9 +1112,11 @@ static void HWR_SetLight(void)
lightmappatch
.
height
=
128
;
lightmappatch
.
height
=
128
;
lightmappatch
.
mipmap
.
width
=
128
;
lightmappatch
.
mipmap
.
width
=
128
;
lightmappatch
.
mipmap
.
height
=
128
;
lightmappatch
.
mipmap
.
height
=
128
;
#ifdef GLIDE_API_COMPATIBILITY
lightmappatch
.
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_128
;
lightmappatch
.
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_128
;
lightmappatch
.
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_128
;
lightmappatch
.
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_128
;
lightmappatch
.
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
lightmappatch
.
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
#endif
lightmappatch
.
mipmap
.
flags
=
0
;
//TF_WRAPXY; // DEBUG: view the overdraw !
lightmappatch
.
mipmap
.
flags
=
0
;
//TF_WRAPXY; // DEBUG: view the overdraw !
}
}
HWD
.
pfnSetTexture
(
&
lightmappatch
.
mipmap
);
HWD
.
pfnSetTexture
(
&
lightmappatch
.
mipmap
);
...
...
This diff is collapsed.
Click to expand it.
src/hardware/hw_md2.c
+
4
−
0
View file @
a4a529bd
...
@@ -716,10 +716,12 @@ static void md2_loadTexture(md2_t *model)
...
@@ -716,10 +716,12 @@ static void md2_loadTexture(md2_t *model)
grpatch
->
mipmap
.
width
=
(
UINT16
)
w
;
grpatch
->
mipmap
.
width
=
(
UINT16
)
w
;
grpatch
->
mipmap
.
height
=
(
UINT16
)
h
;
grpatch
->
mipmap
.
height
=
(
UINT16
)
h
;
#ifdef GLIDE_API_COMPATIBILITY
// not correct!
// not correct!
grpatch
->
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
grpatch
->
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
#endif
}
}
HWD
.
pfnSetTexture
(
&
grpatch
->
mipmap
);
HWD
.
pfnSetTexture
(
&
grpatch
->
mipmap
);
HWR_UnlockCachedPatch
(
grpatch
);
HWR_UnlockCachedPatch
(
grpatch
);
...
@@ -767,10 +769,12 @@ static void md2_loadBlendTexture(md2_t *model)
...
@@ -767,10 +769,12 @@ static void md2_loadBlendTexture(md2_t *model)
grpatch
->
mipmap
.
width
=
(
UINT16
)
w
;
grpatch
->
mipmap
.
width
=
(
UINT16
)
w
;
grpatch
->
mipmap
.
height
=
(
UINT16
)
h
;
grpatch
->
mipmap
.
height
=
(
UINT16
)
h
;
#ifdef GLIDE_API_COMPATIBILITY
// not correct!
// not correct!
grpatch
->
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
smallLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
largeLodLog2
=
GR_LOD_LOG2_256
;
grpatch
->
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
grpatch
->
mipmap
.
grInfo
.
aspectRatioLog2
=
GR_ASPECT_LOG2_1x1
;
#endif
}
}
HWD
.
pfnSetTexture
(
&
grpatch
->
mipmap
);
// We do need to do this so that it can be cleared and knows to recreate it when necessary
HWD
.
pfnSetTexture
(
&
grpatch
->
mipmap
);
// We do need to do this so that it can be cleared and knows to recreate it when necessary
HWR_UnlockCachedPatch
(
grpatch
);
HWR_UnlockCachedPatch
(
grpatch
);
...
...
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