mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- fixed NoFullbrightRange.
Ever since the texture system switchover this only set a dead bit, it has to explicitly mark the texture as not having a brightmap.
This commit is contained in:
parent
40a632a2ae
commit
afb2cd3b82
3 changed files with 44 additions and 13 deletions
|
@ -1526,20 +1526,10 @@ static int32_t defsparser(scriptfile *script)
|
|||
break;
|
||||
|
||||
case T_TEXHITSCANRANGE:
|
||||
parseTexHitscanRange(*script, pos);
|
||||
break;
|
||||
case T_NOFULLBRIGHTRANGE:
|
||||
{
|
||||
int32_t b,e, i;
|
||||
|
||||
if (scriptfile_getsymbol(script,&b)) break;
|
||||
if (scriptfile_getsymbol(script,&e))break;
|
||||
|
||||
b = max(b, 0);
|
||||
e = min(e, MAXUSERTILES-1);
|
||||
|
||||
for (i=b; i<=e; i++)
|
||||
picanm[i].sf |= (tokn==T_TEXHITSCANRANGE) ?
|
||||
PICANM_TEXHITSCAN_BIT : PICANM_NOFULLBRIGHT_BIT;
|
||||
}
|
||||
parseNoFullbrightRange(*script, pos);
|
||||
break;
|
||||
|
||||
case T_SOUND:
|
||||
|
|
|
@ -231,6 +231,7 @@ public:
|
|||
void SetFullbright() { flags |= GTexf_RenderFullbright; }
|
||||
void SetDisableFullbright(bool on) { if (on) flags |= GTexf_DisableFullbrightSprites; else flags &= ~GTexf_DisableFullbrightSprites; }
|
||||
void SetGlowing(PalEntry color) { flags = (flags & ~GTexf_AutoGlowing) | GTexf_Glowing; GlowColor = color; }
|
||||
void SetDisableBrightmap() { flags |= GTexf_BrightmapChecked; Brightmap = nullptr; }
|
||||
|
||||
bool isUserContent() const;
|
||||
int CheckRealHeight() { return xs_RoundToInt(Base->CheckRealHeight() / ScaleY); }
|
||||
|
|
|
@ -678,3 +678,43 @@ void parseNewGameChoices(FScanner& sc, FScriptPosition& pos)
|
|||
while (!sc.FoundEndBrace(blockend)) {}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void parseTexHitscanRange(FScanner& sc, FScriptPosition& pos)
|
||||
{
|
||||
int start, end;
|
||||
|
||||
if (!sc.GetNumber(start, true)) return;
|
||||
if (!sc.GetNumber(end, true)) return;
|
||||
|
||||
if (start < 0) start = 0;
|
||||
if (end >= MAXUSERTILES) end = MAXUSERTILES - 1;
|
||||
for (int i = start; i <= end; i++)
|
||||
TileFiles.tiledata[i].picanm.sf |= PICANM_TEXHITSCAN_BIT;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void parseNoFullbrightRange(FScanner& sc, FScriptPosition& pos)
|
||||
{
|
||||
int start, end;
|
||||
|
||||
if (!sc.GetNumber(start, true)) return;
|
||||
if (!sc.GetNumber(end, true)) return;
|
||||
|
||||
if (start < 0) start = 0;
|
||||
if (end >= MAXUSERTILES) end = MAXUSERTILES - 1;
|
||||
for (int i = start; i <= end; i++)
|
||||
{
|
||||
auto tex = tileGetTexture(i);
|
||||
if (tex->isValid()) tex->SetDisableBrightmap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue