mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
EDuke32: When in menus, always draw a black (33%) translucent background.
Internally, there's a new function fade_screen_black() that implements the fading more efficiently than calling rotatesprite for classic, and uses tile 0 (assumed to have at least 64x32 size) in the GL modes. The black background of the user map selector is still done with rotatesprite and tile BLANK in every renderer. git-svn-id: https://svn.eduke32.com/eduke32@2312 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7b09accdce
commit
00b852fe37
3 changed files with 28 additions and 10 deletions
|
@ -567,6 +567,7 @@ void setbasepaltable(uint8_t **basepaltable, uint8_t basepalcount);
|
|||
void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags);
|
||||
void setpalettefade(char r, char g, char b, char offset);
|
||||
void squarerotatetile(int16_t tilenume);
|
||||
void fade_screen_black(int32_t moreopaquep);
|
||||
|
||||
int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t dabpp);
|
||||
void nextpage(void);
|
||||
|
|
|
@ -2298,6 +2298,28 @@ static inline int32_t getpalookup(int32_t davis, int32_t dashade)
|
|||
|
||||
static void setpalettefade_calc(uint8_t offset);
|
||||
|
||||
void fade_screen_black(int32_t moreopaquep)
|
||||
{
|
||||
if (getrendermode() >= 3)
|
||||
{
|
||||
// we have a ~1 px horizontal line if we don't shift y by -1,
|
||||
// might need a fix in rotatesprite!
|
||||
rotatesprite_fs(0, -(1<<16), 65536<<3, 0, 0,0,4,10+16+1+((!moreopaquep)*32)+1024); // tile 0: 64x32
|
||||
}
|
||||
else
|
||||
{
|
||||
int32_t i;
|
||||
const int32_t shiftamnt = ((!!moreopaquep)*8);
|
||||
|
||||
assert(!offscreenrendering);
|
||||
|
||||
begindrawing();
|
||||
for (i=0; i<xdim*ydim; i++)
|
||||
((uint8_t *)frameplace)[i] = transluc[(((uint8_t *)frameplace)[i])<<shiftamnt];
|
||||
enddrawing();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// returns: 0=continue sprite collecting;
|
||||
// 1=break out of sprite collecting;
|
||||
|
|
|
@ -626,17 +626,12 @@ void M_DisplayMenus(void)
|
|||
g_player[myconnectindex].ps->gm &= (0xff-MODE_TYPE);
|
||||
g_player[myconnectindex].ps->fta = 0;
|
||||
|
||||
x = 0;
|
||||
// x = 0;
|
||||
|
||||
sh = 4-(sintable[(totalclock<<4)&2047]>>11);
|
||||
|
||||
if (getrendermode() >= 3)
|
||||
{
|
||||
int32_t x,y=0;
|
||||
for (; y<ydim; y+=tilesizy[MENUSCREEN])
|
||||
for (x=0; x<xdim; x+=tilesizx[MENUSCREEN])
|
||||
rotatesprite_fs(x<<16,y<<16,65536L,0,MENUSCREEN,80,0,1+8+16);
|
||||
}
|
||||
// black translucent background
|
||||
fade_screen_black(1);
|
||||
|
||||
if (!(g_currentMenu >= 1000 && g_currentMenu <= 2999 && g_currentMenu >= 300 && g_currentMenu <= 369))
|
||||
G_UpdateScreenArea();
|
||||
|
@ -1895,8 +1890,8 @@ cheat_for_port_credits:
|
|||
for (m=0,i=(totalclock/104)%numlines; m<6; m++,i++)
|
||||
{
|
||||
if (i==numlines) i=0;
|
||||
minitext(161-(Bstrlen(scroller[i])<<1), 101+10+10+8+4+(m*7)-l, (char *)scroller[i], 4, 10+16+128);
|
||||
minitext(160-(Bstrlen(scroller[i])<<1), 100+10+10+8+4+(m*7)-l, (char *)scroller[i], 8, 10+16+128);
|
||||
minitext(161-(Bstrlen(scroller[i])<<1), 101+10+10+8+4+(m*7)-l, scroller[i], 4, 10+16+128);
|
||||
minitext(160-(Bstrlen(scroller[i])<<1), 100+10+10+8+4+(m*7)-l, scroller[i], 8, 10+16+128);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue