mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Simplify map title rendering code and enable alpha for classic renderer
This commit is contained in:
parent
2b443c2eac
commit
f6cd86d77e
1 changed files with 4 additions and 8 deletions
|
@ -1242,15 +1242,11 @@ void viewDrawMapTitle(void)
|
||||||
if (!gShowMapTitle || gGameMenuMgr.m_bActive)
|
if (!gShowMapTitle || gGameMenuMgr.m_bActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int seconds = (gLevelTime / kTicsPerSec);
|
int const fadeStartTic = int(1.f*kTicsPerSec);
|
||||||
int millisecs = (gLevelTime % kTicsPerSec) * 33;
|
int const fadeEndTic = int(1.25f*kTicsPerSec);
|
||||||
if (seconds > 3)
|
if (gLevelTime > fadeEndTic)
|
||||||
return;
|
return;
|
||||||
|
uint8_t const alpha = clamp((gLevelTime-fadeStartTic)*255/(fadeEndTic-fadeStartTic), 0, 255);
|
||||||
const int noAlphaForSecs = 1;
|
|
||||||
uint8_t alpha = videoGetRenderMode() != REND_CLASSIC || numalphatabs >= 15 ?
|
|
||||||
seconds < noAlphaForSecs ? 0 : clamp(((seconds-noAlphaForSecs)*1000+millisecs)/4, 0, 255)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
if (alpha != 255)
|
if (alpha != 255)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue