mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- Fixed: Since the minimum size for a texture is 2x2, FBarShader can't use
a one-dimensional texture. SVN r669 (trunk)
This commit is contained in:
parent
51461aa010
commit
59c007d5f4
2 changed files with 46 additions and 23 deletions
|
@ -1,4 +1,6 @@
|
||||||
January 6, 2008
|
January 6, 2008
|
||||||
|
- Fixed: Since the minimum size for a texture is 2x2, FBarShader can't use
|
||||||
|
a one-dimensional texture.
|
||||||
- Added back the code to allow some variation to the players' shades when
|
- Added back the code to allow some variation to the players' shades when
|
||||||
players are on teams.
|
players are on teams.
|
||||||
- Set TEAM_None back to 255. Since a player's team has already been accessible
|
- Set TEAM_None back to 255. Since a player's team has already been accessible
|
||||||
|
|
|
@ -996,8 +996,8 @@ public:
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Width = vertical ? 1 : 256;
|
Width = vertical ? 2 : 256;
|
||||||
Height = vertical ? 256 : 1;
|
Height = vertical ? 256 : 2;
|
||||||
CalcBitSize();
|
CalcBitSize();
|
||||||
|
|
||||||
// Fill the column/row with shading values.
|
// Fill the column/row with shading values.
|
||||||
|
@ -1005,11 +1005,14 @@ public:
|
||||||
// and maximum alpha at the bottom, unless flipped by
|
// and maximum alpha at the bottom, unless flipped by
|
||||||
// setting reverse to true. Horizontal shaders are just
|
// setting reverse to true. Horizontal shaders are just
|
||||||
// the opposite.
|
// the opposite.
|
||||||
if ((!reverse && vertical) || (reverse && !vertical))
|
if (vertical)
|
||||||
|
{
|
||||||
|
if (!reverse)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 256; ++i)
|
for (i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
Pixels[i] = i;
|
Pixels[i] = i;
|
||||||
|
Pixels[256+i] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1017,6 +1020,27 @@ public:
|
||||||
for (i = 0; i < 256; ++i)
|
for (i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
Pixels[i] = 255 - i;
|
Pixels[i] = 255 - i;
|
||||||
|
Pixels[256+i] = 255 -i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!reverse)
|
||||||
|
{
|
||||||
|
for (i = 0; i < 256; ++i)
|
||||||
|
{
|
||||||
|
Pixels[i*2] = 255 - i;
|
||||||
|
Pixels[i*2+1] = 255 - i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < 256; ++i)
|
||||||
|
{
|
||||||
|
Pixels[i*2] = i;
|
||||||
|
Pixels[i*2+1] = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DummySpan[0].TopOffset = 0;
|
DummySpan[0].TopOffset = 0;
|
||||||
|
@ -1031,14 +1055,7 @@ public:
|
||||||
{
|
{
|
||||||
*spans_out = DummySpan;
|
*spans_out = DummySpan;
|
||||||
}
|
}
|
||||||
if (Width == 1)
|
return Pixels + (column & WidthMask) * 256;
|
||||||
{
|
|
||||||
return Pixels;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Pixels + (column & 255);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BYTE *GetPixels()
|
const BYTE *GetPixels()
|
||||||
|
@ -1051,7 +1068,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BYTE Pixels[256];
|
BYTE Pixels[512];
|
||||||
Span DummySpan[2];
|
Span DummySpan[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1059,7 +1076,11 @@ private:
|
||||||
class FSBarInfo : public FBaseStatusBar
|
class FSBarInfo : public FBaseStatusBar
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FSBarInfo () : FBaseStatusBar (SBarInfoScript->height)
|
FSBarInfo () : FBaseStatusBar (SBarInfoScript->height),
|
||||||
|
shader_horz_normal(false, false),
|
||||||
|
shader_horz_reverse(false, true),
|
||||||
|
shader_vert_normal(true, false),
|
||||||
|
shader_vert_reverse(true, true)
|
||||||
{
|
{
|
||||||
static const char *InventoryBarLumps[] =
|
static const char *InventoryBarLumps[] =
|
||||||
{
|
{
|
||||||
|
@ -1630,11 +1651,7 @@ private:
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWSHADER:
|
case SBARINFO_DRAWSHADER:
|
||||||
{
|
{
|
||||||
static FBarShader shader_horz_normal(false, false);
|
FBarShader *const shaders[4] =
|
||||||
static FBarShader shader_horz_reverse(false, true);
|
|
||||||
static FBarShader shader_vert_normal(true, false);
|
|
||||||
static FBarShader shader_vert_reverse(true, true);
|
|
||||||
static FBarShader *const shaders[4] =
|
|
||||||
{
|
{
|
||||||
&shader_horz_normal, &shader_horz_reverse,
|
&shader_horz_normal, &shader_horz_reverse,
|
||||||
&shader_vert_normal, &shader_vert_reverse
|
&shader_vert_normal, &shader_vert_reverse
|
||||||
|
@ -1670,7 +1687,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws and image with the specified flags
|
//draws an image with the specified flags
|
||||||
void DrawGraphic(FTexture* texture, int x, int y, int flags)
|
void DrawGraphic(FTexture* texture, int x, int y, int flags)
|
||||||
{
|
{
|
||||||
if((flags & DRAWIMAGE_OFFSET_CENTER))
|
if((flags & DRAWIMAGE_OFFSET_CENTER))
|
||||||
|
@ -1930,6 +1947,10 @@ private:
|
||||||
int chainWiggle;
|
int chainWiggle;
|
||||||
int artiflash;
|
int artiflash;
|
||||||
unsigned int invBarOffset;
|
unsigned int invBarOffset;
|
||||||
|
FBarShader shader_horz_normal;
|
||||||
|
FBarShader shader_horz_reverse;
|
||||||
|
FBarShader shader_vert_normal;
|
||||||
|
FBarShader shader_vert_reverse;
|
||||||
};
|
};
|
||||||
|
|
||||||
FBaseStatusBar *CreateCustomStatusBar ()
|
FBaseStatusBar *CreateCustomStatusBar ()
|
||||||
|
|
Loading…
Reference in a new issue