mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Be gone ye old texture hack
This commit is contained in:
parent
8196c59557
commit
c1d5c711a9
1 changed files with 7 additions and 25 deletions
32
src/r_data.c
32
src/r_data.c
|
@ -472,40 +472,22 @@ void R_LoadTextures(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT16 patchcount = 1;
|
|
||||||
//CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height);
|
//CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height);
|
||||||
if (SHORT(patchlump->width) == 64
|
texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
|
||||||
&& SHORT(patchlump->height) == 64)
|
|
||||||
{ // 64x64 patch
|
|
||||||
const column_t *column;
|
|
||||||
for (k = 0; k < SHORT(patchlump->width); k++)
|
|
||||||
{ // Find use of transparency.
|
|
||||||
column = (const column_t *)((const UINT8 *)patchlump + LONG(patchlump->columnofs[k]));
|
|
||||||
if (column->length != SHORT(patchlump->height))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (k == SHORT(patchlump->width))
|
|
||||||
patchcount = 2; // No transparency? 64x128 texture.
|
|
||||||
}
|
|
||||||
texture = textures[i] = Z_Calloc(sizeof(texture_t) + (sizeof(texpatch_t) * patchcount), PU_STATIC, NULL);
|
|
||||||
|
|
||||||
// Set texture properties.
|
// Set texture properties.
|
||||||
M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name));
|
M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name));
|
||||||
texture->width = SHORT(patchlump->width);
|
texture->width = SHORT(patchlump->width);
|
||||||
texture->height = SHORT(patchlump->height)*patchcount;
|
texture->height = SHORT(patchlump->height);
|
||||||
texture->patchcount = patchcount;
|
texture->patchcount = 1;
|
||||||
texture->holes = false;
|
texture->holes = false;
|
||||||
|
|
||||||
// Allocate information for the texture's patches.
|
// Allocate information for the texture's patches.
|
||||||
for (k = 0; k < patchcount; k++)
|
patch = &texture->patches[0];
|
||||||
{
|
|
||||||
patch = &texture->patches[k];
|
|
||||||
|
|
||||||
patch->originx = 0;
|
patch->originx = patch->originy = 0;
|
||||||
patch->originy = (INT16)(k*patchlump->height);
|
patch->wad = (UINT16)w;
|
||||||
patch->wad = (UINT16)w;
|
patch->lump = texstart + j;
|
||||||
patch->lump = texstart + j;
|
|
||||||
}
|
|
||||||
|
|
||||||
Z_Unlock(patchlump);
|
Z_Unlock(patchlump);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue