From 00b852fe3730c41d3999f9317746f53b99ffcdb1 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 4 Feb 2012 14:30:39 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/include/build.h | 1 + polymer/eduke32/build/src/engine.c | 22 ++++++++++++++++++++++ polymer/eduke32/source/menus.c | 15 +++++---------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index e291f6802..28727c9bd 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -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); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index fdac7b856..9a8022b87 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -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; igm &= (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= 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); } }