blockmodulo and bpp do not need to be args of HWR_DrawPatchInCache
This commit is contained in:
parent
efa042a995
commit
ff2ebf20fb
|
@ -139,10 +139,10 @@ static void HWR_DrawColumnInCache(column_t *patchcol, UINT8 *block, GLMipmap_t *
|
||||||
|
|
||||||
// sprite, use alpha and chroma key for hole
|
// sprite, use alpha and chroma key for hole
|
||||||
static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
|
static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
|
||||||
INT32 pblockwidth, INT32 pblockheight, INT32 blockmodulo,
|
INT32 pblockwidth, INT32 pblockheight,
|
||||||
INT32 ptexturewidth, INT32 ptextureheight,
|
INT32 ptexturewidth, INT32 ptextureheight,
|
||||||
INT32 originx, INT32 originy, // where to draw patch in surface block
|
INT32 originx, INT32 originy, // where to draw patch in surface block
|
||||||
patch_t *realpatch, INT32 bpp)
|
patch_t *realpatch)
|
||||||
{
|
{
|
||||||
INT32 x, x1, x2;
|
INT32 x, x1, x2;
|
||||||
INT32 col, ncols;
|
INT32 col, ncols;
|
||||||
|
@ -150,6 +150,8 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
|
||||||
fixed_t yfracstep, scale_y;
|
fixed_t yfracstep, scale_y;
|
||||||
column_t *patchcol;
|
column_t *patchcol;
|
||||||
UINT8 *block = mipmap->grInfo.data;
|
UINT8 *block = mipmap->grInfo.data;
|
||||||
|
INT32 bpp;
|
||||||
|
INT32 blockmodulo;
|
||||||
|
|
||||||
if (!ptexturewidth)
|
if (!ptexturewidth)
|
||||||
return;
|
return;
|
||||||
|
@ -198,9 +200,13 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap,
|
||||||
yfracstep = (ptextureheight<< FRACBITS) / pblockheight;
|
yfracstep = (ptextureheight<< FRACBITS) / pblockheight;
|
||||||
scale_y = (pblockheight << FRACBITS) / ptextureheight;
|
scale_y = (pblockheight << FRACBITS) / ptextureheight;
|
||||||
|
|
||||||
|
bpp = format2bpp[mipmap->grInfo.format];
|
||||||
|
|
||||||
if (bpp < 1 || bpp > 4)
|
if (bpp < 1 || bpp > 4)
|
||||||
I_Error("HWR_DrawPatchInCache: no drawer defined for this bpp (%d)\n",bpp);
|
I_Error("HWR_DrawPatchInCache: no drawer defined for this bpp (%d)\n",bpp);
|
||||||
|
|
||||||
|
blockmodulo = blockwidth*bpp;
|
||||||
|
|
||||||
// Draw each column to the block cache
|
// Draw each column to the block cache
|
||||||
for (block += col*bpp; ncols--; block += bpp, xfrac += xfracstep)
|
for (block += col*bpp; ncols--; block += bpp, xfrac += xfracstep)
|
||||||
{
|
{
|
||||||
|
@ -477,11 +483,9 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex)
|
||||||
realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE);
|
realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE);
|
||||||
HWR_DrawPatchInCache(&grtex->mipmap,
|
HWR_DrawPatchInCache(&grtex->mipmap,
|
||||||
blockwidth, blockheight,
|
blockwidth, blockheight,
|
||||||
blockwidth*format2bpp[grtex->mipmap.grInfo.format],
|
|
||||||
texture->width, texture->height,
|
texture->width, texture->height,
|
||||||
patch->originx, patch->originy,
|
patch->originx, patch->originy,
|
||||||
realpatch,
|
realpatch);
|
||||||
format2bpp[grtex->mipmap.grInfo.format]);
|
|
||||||
Z_Unlock(realpatch);
|
Z_Unlock(realpatch);
|
||||||
}
|
}
|
||||||
//Hurdler: not efficient at all but I don't remember exactly how HWR_DrawPatchInCache works :(
|
//Hurdler: not efficient at all but I don't remember exactly how HWR_DrawPatchInCache works :(
|
||||||
|
@ -568,11 +572,9 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
|
||||||
|
|
||||||
HWR_DrawPatchInCache(grMipmap,
|
HWR_DrawPatchInCache(grMipmap,
|
||||||
newwidth, newheight,
|
newwidth, newheight,
|
||||||
blockwidth*format2bpp[grMipmap->grInfo.format],
|
|
||||||
grPatch->width, grPatch->height,
|
grPatch->width, grPatch->height,
|
||||||
0, 0,
|
0, 0,
|
||||||
patch,
|
patch);
|
||||||
format2bpp[grMipmap->grInfo.format]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
grPatch->max_s = (float)newwidth / (float)blockwidth;
|
grPatch->max_s = (float)newwidth / (float)blockwidth;
|
||||||
|
|
Loading…
Reference in a new issue