mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- added automatic brightmaps.
Everything in the brightmaps/auto directory will automatically be assigned to the same-named texture.
This commit is contained in:
parent
7011010ff2
commit
bde73fc530
2 changed files with 31 additions and 0 deletions
|
@ -69,6 +69,7 @@ CUSTOM_CVAR(Bool, gl_notexturefill, false, 0)
|
|||
|
||||
|
||||
void gl_CreateSections();
|
||||
void AddAutoBrightmaps();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -364,6 +365,7 @@ void gl_RecalcVertexHeights(vertex_t * v)
|
|||
void gl_InitData()
|
||||
{
|
||||
AdjustSpriteOffsets();
|
||||
AddAutoBrightmaps();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -665,11 +665,13 @@ void gl_ParseBrightmap(FScanner &sc, int deflump)
|
|||
|
||||
if (bmtex != NULL)
|
||||
{
|
||||
/* I do not think this is needed any longer
|
||||
if (tex->bWarped != 0)
|
||||
{
|
||||
Printf("Cannot combine warping with brightmap on texture '%s'\n", tex->Name.GetChars());
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
bmtex->bMasked = false;
|
||||
tex->gl_info.Brightmap = bmtex;
|
||||
|
@ -677,6 +679,33 @@ void gl_ParseBrightmap(FScanner &sc, int deflump)
|
|||
tex->gl_info.bDisableFullbright = disable_fullbright;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void AddAutoBrightmaps()
|
||||
{
|
||||
int num = Wads.GetNumLumps();
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
{
|
||||
const char *name = Wads.GetLumpFullName(i);
|
||||
if (strstr(name, "brightmaps/auto/") == name)
|
||||
{
|
||||
TArray<FTextureID> list;
|
||||
FString texname = ExtractFileBase(name, false);
|
||||
TexMan.ListTextures(texname, list);
|
||||
auto bmtex = TexMan.FindTexture(name, FTexture::TEX_Any, FTextureManager::TEXMAN_TryAny);
|
||||
for (auto texid : list)
|
||||
{
|
||||
bmtex->bMasked = false;
|
||||
TexMan[texid]->gl_info.Brightmap = bmtex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Parses a GLBoom+ detail texture definition
|
||||
|
|
Loading…
Reference in a new issue