mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +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 gl_CreateSections();
|
||||||
|
void AddAutoBrightmaps();
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
@ -364,6 +365,7 @@ void gl_RecalcVertexHeights(vertex_t * v)
|
||||||
void gl_InitData()
|
void gl_InitData()
|
||||||
{
|
{
|
||||||
AdjustSpriteOffsets();
|
AdjustSpriteOffsets();
|
||||||
|
AddAutoBrightmaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -665,11 +665,13 @@ void gl_ParseBrightmap(FScanner &sc, int deflump)
|
||||||
|
|
||||||
if (bmtex != NULL)
|
if (bmtex != NULL)
|
||||||
{
|
{
|
||||||
|
/* I do not think this is needed any longer
|
||||||
if (tex->bWarped != 0)
|
if (tex->bWarped != 0)
|
||||||
{
|
{
|
||||||
Printf("Cannot combine warping with brightmap on texture '%s'\n", tex->Name.GetChars());
|
Printf("Cannot combine warping with brightmap on texture '%s'\n", tex->Name.GetChars());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bmtex->bMasked = false;
|
bmtex->bMasked = false;
|
||||||
tex->gl_info.Brightmap = bmtex;
|
tex->gl_info.Brightmap = bmtex;
|
||||||
|
@ -677,6 +679,33 @@ void gl_ParseBrightmap(FScanner &sc, int deflump)
|
||||||
tex->gl_info.bDisableFullbright = disable_fullbright;
|
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
|
// Parses a GLBoom+ detail texture definition
|
||||||
|
|
Loading…
Reference in a new issue