Delete R_CropFlat
This commit is contained in:
parent
02c3710211
commit
0af9e865f9
33
src/r_data.c
33
src/r_data.c
|
@ -1770,36 +1770,3 @@ void R_FlatTexture(size_t tex, UINT8 *flat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_CropFlat(UINT8 *srcflat, UINT8 *destflat,
|
|
||||||
UINT16 srcwidth, UINT16 srcheight,
|
|
||||||
UINT16 resizewidth, UINT16 resizeheight,
|
|
||||||
UINT16 destwidth, UINT16 destheight)
|
|
||||||
{
|
|
||||||
UINT16 y;
|
|
||||||
UINT16 position = 0;
|
|
||||||
for (y = 0; y < destheight; y++)
|
|
||||||
{
|
|
||||||
if (position > (srcwidth * srcheight))
|
|
||||||
break;
|
|
||||||
if (srcwidth != resizewidth)
|
|
||||||
{
|
|
||||||
if (resizewidth > srcwidth)
|
|
||||||
{
|
|
||||||
UINT8 *pos2 = srcflat+position;
|
|
||||||
UINT8 lastpixel = *(pos2-1);
|
|
||||||
M_Memcpy(destflat, srcflat+position, destwidth);
|
|
||||||
memset(pos2, lastpixel, resizewidth-srcwidth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
M_Memcpy(destflat, srcflat+position, resizewidth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
M_Memcpy(destflat, srcflat+position, destwidth);
|
|
||||||
destflat += destwidth;
|
|
||||||
position += srcwidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (y++ < min(resizeheight, srcheight))
|
|
||||||
memset(destflat + (y * destwidth), *(destflat - 1), destwidth);
|
|
||||||
}
|
|
||||||
|
|
|
@ -103,10 +103,6 @@ boolean R_CheckIfPatch(lumpnum_t lump);
|
||||||
|
|
||||||
void R_FlatPatch(patch_t *patch, UINT8 *flat);
|
void R_FlatPatch(patch_t *patch, UINT8 *flat);
|
||||||
void R_FlatTexture(size_t tex, UINT8 *flat);
|
void R_FlatTexture(size_t tex, UINT8 *flat);
|
||||||
void R_CropFlat(UINT8 *srcflat, UINT8 *destflat,
|
|
||||||
UINT16 srcwidth, UINT16 srcheight,
|
|
||||||
UINT16 resizewidth, UINT16 resizeheight,
|
|
||||||
UINT16 destwidth, UINT16 destheight);
|
|
||||||
|
|
||||||
extern INT32 numtextures;
|
extern INT32 numtextures;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue