mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Hardware renderer: Disable Glide-specific texture handling
This commit is contained in:
parent
6019cf64e8
commit
d0c295f44f
4 changed files with 23 additions and 0 deletions
|
|
@ -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,
|
||||||
|
|
||||||
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,
|
||||||
}
|
}
|
||||||
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,
|
||||||
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,
|
||||||
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)
|
||||||
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)
|
||||||
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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
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);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue