From 762ce146ebd15954b4ec0e6f2fbf4029b00c1e69 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 7 Jan 2020 12:43:27 -0300 Subject: [PATCH] Organise header files, use R_GetFlat --- src/r_plane.c | 4 ++-- src/r_textures.c | 2 -- src/r_textures.h | 14 +++++--------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/r_plane.c b/src/r_plane.c index 982354a5f..cc304043e 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -1127,7 +1127,7 @@ void R_DrawSinglePlane(visplane_t *pl) case LEVELFLAT_NONE: return; case LEVELFLAT_FLAT: - ds_source = W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_CACHE); + ds_source = R_GetFlat(levelflat->u.flat.lumpnum); R_CheckFlatLength(W_LumpLength(levelflat->u.flat.lumpnum)); // Raw flats always have dimensions that are powers-of-two numbers. ds_powersoftwo = true; @@ -1140,7 +1140,7 @@ void R_DrawSinglePlane(visplane_t *pl) ds_source = R_GetTextureFlat(levelflat, true, false); break; default: - ds_source = W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_STATIC); + ds_source = R_GetFlat(levelflat->u.flat.lumpnum); flat = R_GetTextureFlat(levelflat, false, #ifndef NO_PNG_LUMPS ( type == LEVELFLAT_PNG ) diff --git a/src/r_textures.c b/src/r_textures.c index c9c8fd937..96f2590a6 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -497,8 +497,6 @@ UINT8 *R_GetColumn(fixed_t tex, INT32 col) return data + LONG(texturecolumnofs[tex][col]); } -// convert flats to hicolor as they are requested -// UINT8 *R_GetFlat(lumpnum_t flatlumpnum) { return W_CacheLumpNum(flatlumpnum, PU_CACHE); diff --git a/src/r_textures.h b/src/r_textures.h index d9f5e9e1d..fd35926cc 100644 --- a/src/r_textures.h +++ b/src/r_textures.h @@ -85,24 +85,20 @@ extern UINT8 **texturecache; // graphics data for each generated full-size textu void R_LoadTextures(void); void R_FlushTextureCache(void); +// Texture generation UINT8 *R_GenerateTexture(size_t texnum); INT32 R_GetTextureNum(INT32 texnum); void R_CheckTextureCache(INT32 tex); +void R_ClearTextureNumCache(boolean btell); -// Retrieve column data for span blitting. +// Retrieve texture data. UINT8 *R_GetColumn(fixed_t tex, INT32 col); UINT8 *R_GetFlat(lumpnum_t flatnum); -// Retrieval. -// Floor/ceiling opaque texture tiles, -// lookup by name. For animation? -lumpnum_t R_GetFlatNumForName(const char *name); - -// Called by P_Ticker for switches and animations, -// returns the texture number for the texture name. -void R_ClearTextureNumCache(boolean btell); +// Returns the texture number for the texture name. INT32 R_TextureNumForName(const char *name); INT32 R_CheckTextureNumForName(const char *name); +lumpnum_t R_GetFlatNumForName(const char *name); extern INT32 numtextures;