Revert "kill "Use po2 patches to fix mipmaps ""

This reverts commit 6b904b10f5.
This commit is contained in:
Alug committed 2024-12-12 18:09:17 +01:00
1 parent ddc97b662c
commit 3db5f64b5e
1 file changed
+12 -9
+12 -9
View File
@@ -172,13 +172,13 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
palette = HWR_GetTexturePalette();
ncols = (pwidth * pblockwidth) / pwidth;
ncols = pwidth;
// source advance
xfrac = 0;
xfracstep = (pwidth << FRACBITS) / pblockwidth;
yfracstep = (pheight << FRACBITS) / pblockheight;
scale_y = (pblockheight << FRACBITS) / pheight;
xfracstep = FRACUNIT;
yfracstep = FRACUNIT;
scale_y = FRACUNIT;
bpp = format2bpp(mipmap->format);
@@ -418,14 +418,19 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *glPatch, GLMipmap_t *glMipmap, bo
glPatch->leftoffset = SHORT(patch->leftoffset);
glPatch->topoffset = SHORT(patch->topoffset);
glMipmap->width = (UINT16)SHORT(patch->width);
glMipmap->height = (UINT16)SHORT(patch->height);
glMipmap->width = glMipmap->height = 1;
while (glMipmap->width < glPatch->width) glMipmap->width <<= 1;
while (glMipmap->height < glPatch->height) glMipmap->height <<= 1;
// no wrap around, no chroma key
glMipmap->flags = 0;
// setup the texture info
glMipmap->format = patchformat;
//glPatch->max_s = glPatch->max_t = 1.0f;
glPatch->max_s = (float)glPatch->width / (float)glMipmap->width;
glPatch->max_t = (float)glPatch->height / (float)glMipmap->height;
}
Z_Free(glMipmap->data);
@@ -436,12 +441,10 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *glPatch, GLMipmap_t *glMipmap, bo
MakeBlock(glMipmap);
HWR_DrawPatchInCache(glMipmap,
glPatch->width, glPatch->height,
glMipmap->width, glMipmap->height,
glPatch->width, glPatch->height,
patch);
}
glPatch->max_s = glPatch->max_t = 1.0f;
}
// =================================================