mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
Menus: Make black background boxes translucent again.
git-svn-id: https://svn.eduke32.com/eduke32@4917 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c1c672032b
commit
c42faee32e
1 changed files with 6 additions and 26 deletions
|
@ -3229,6 +3229,11 @@ void M_CloseMenu(size_t playerID)
|
|||
}
|
||||
}
|
||||
|
||||
static int32_t xdim_from_320_16(int32_t x)
|
||||
{
|
||||
const int32_t screenwidth = scale(240<<16, xdim, ydim);
|
||||
return scale(x + (screenwidth>>1) - (160<<16), xdim, screenwidth);
|
||||
}
|
||||
static int32_t ydim_from_200_16(int32_t y)
|
||||
{
|
||||
return scale(y, ydim, 200<<16);
|
||||
|
@ -3238,32 +3243,7 @@ static void M_BlackRectangle(int32_t x, int32_t y, int32_t width, int32_t height
|
|||
{
|
||||
const int32_t xscale = scale(65536, width, tilesiz[0].x<<16), yscale = scale(65536, height, tilesiz[0].y<<16);
|
||||
|
||||
if (xscale >= yscale)
|
||||
{
|
||||
const int32_t patchwidth = scale(tilesiz[0].x<<16, yscale, 65536);
|
||||
const int32_t finalx = x + width - patchwidth;
|
||||
|
||||
while (x < finalx)
|
||||
{
|
||||
rotatesprite_fs(x, y, yscale, 0, 0, 127, 4, 2|8|16|64);
|
||||
x += patchwidth;
|
||||
}
|
||||
|
||||
rotatesprite_fs(finalx, y, yscale, 0, 0, 127, 4, 2|8|16|64);
|
||||
}
|
||||
else
|
||||
{
|
||||
const int32_t patchheight = scale(tilesiz[0].y<<16, xscale, 65536);
|
||||
const int32_t finaly = y + height - patchheight;
|
||||
|
||||
while (y < finaly)
|
||||
{
|
||||
rotatesprite_fs(x, y, xscale, 0, 0, 127, 4, 2|8|16|64);
|
||||
y += patchheight;
|
||||
}
|
||||
|
||||
rotatesprite_fs(x, finaly, xscale, 0, 0, 127, 4, 2|8|16|64);
|
||||
}
|
||||
rotatesprite_(x, y, max(xscale, yscale), 0, 0, 127, 4, 1|2|8|16|32, 0, 0, xdim_from_320_16(x), ydim_from_200_16(y), xdim_from_320_16(x + width), ydim_from_200_16(y + height));
|
||||
}
|
||||
|
||||
enum MenuTextFlags_t
|
||||
|
|
Loading…
Reference in a new issue