mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- Applied Blzut3's SBARINFO update #8:
* Fixed: Drawbar had a few memory leaks. - Added another temporary cvar called pc to play with the multipiler used by D3DFB::SetPaletteTexture(). SVN r704 (trunk)
This commit is contained in:
parent
d13fdec9bf
commit
685de5ce30
4 changed files with 19 additions and 7 deletions
|
@ -1,5 +1,16 @@
|
||||||
January 12, 2008
|
January 12, 2008
|
||||||
- Applied Blzut3's SBARINFO update #7.
|
- Applied Blzut3's SBARINFO update #8:
|
||||||
|
* Fixed: Drawbar had a few memory leaks.
|
||||||
|
- Applied Blzut3's SBARINFO update #7:
|
||||||
|
* Added drawstring to SBARINFO.
|
||||||
|
* Added animatedgodmode flag to drawmugshot, also changed the flags to use the
|
||||||
|
standard named arguments instead of numbers. The old way is considered
|
||||||
|
deprecated.
|
||||||
|
* Added kills, monsters, items, totalitems, secrets, and totalsecrets to
|
||||||
|
drawnumber. Drawbar can also use kills, items, and secrets.
|
||||||
|
* Added weaponicon to drawimage which will display the inventory.icon of the
|
||||||
|
currently selected weapon.
|
||||||
|
* Fixed: I apparently forgot to add the "rampage" face to drawmugshot.
|
||||||
|
|
||||||
January 12, 2008 (Changes by Graf Zahl)
|
January 12, 2008 (Changes by Graf Zahl)
|
||||||
- Moved renderer dependent part of savegame pic creation into DFrameBuffer
|
- Moved renderer dependent part of savegame pic creation into DFrameBuffer
|
||||||
|
|
|
@ -1067,6 +1067,8 @@ public:
|
||||||
{
|
{
|
||||||
width = (int) (((double) width/100)*value);
|
width = (int) (((double) width/100)*value);
|
||||||
}
|
}
|
||||||
|
if(Pixels != NULL)
|
||||||
|
delete Pixels;
|
||||||
Pixels = new BYTE[Width*Height];
|
Pixels = new BYTE[Width*Height];
|
||||||
memset(Pixels, 0, Width*Height); //Prevent garbage when using transparent images
|
memset(Pixels, 0, Width*Height); //Prevent garbage when using transparent images
|
||||||
bar->CopyToBlock(Pixels, Width, Height, 0, 0); //draw the bar
|
bar->CopyToBlock(Pixels, Width, Height, 0, 0); //draw the bar
|
||||||
|
@ -1820,6 +1822,7 @@ private:
|
||||||
else
|
else
|
||||||
bar->PrepareTexture(Images[cmd.sprite], NULL, value, horizontal, reverse);
|
bar->PrepareTexture(Images[cmd.sprite], NULL, value, horizontal, reverse);
|
||||||
DrawImage(bar, cmd.x, cmd.y);
|
DrawImage(bar, cmd.x, cmd.y);
|
||||||
|
delete bar;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWGEM:
|
case SBARINFO_DRAWGEM:
|
||||||
|
|
|
@ -1505,9 +1505,6 @@ void FBaseStatusBar::DrawConsistancy () const
|
||||||
players[1-consoleplayer].inconsistant,
|
players[1-consoleplayer].inconsistant,
|
||||||
players[1-consoleplayer].inconsistant/ticdup);
|
players[1-consoleplayer].inconsistant/ticdup);
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG
|
|
||||||
AddCommandString ("showrngs");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
screen->DrawText (CR_GREEN,
|
screen->DrawText (CR_GREEN,
|
||||||
(screen->GetWidth() - SmallFont->StringWidth (conbuff)*CleanXfac) / 2,
|
(screen->GetWidth() - SmallFont->StringWidth (conbuff)*CleanXfac) / 2,
|
||||||
|
|
|
@ -3058,12 +3058,13 @@ void D3DFB::SetTexture(int tnum, IDirect3DTexture9 *texture)
|
||||||
}
|
}
|
||||||
|
|
||||||
CVAR(Float, pal, 0.5f, 0)
|
CVAR(Float, pal, 0.5f, 0)
|
||||||
|
CVAR(Float, pc, 255.f, 0)
|
||||||
void D3DFB::SetPaletteTexture(IDirect3DTexture9 *texture, int count)
|
void D3DFB::SetPaletteTexture(IDirect3DTexture9 *texture, int count)
|
||||||
{
|
{
|
||||||
if (count == 256 || SM14)
|
if (count == 256 || SM14)
|
||||||
{
|
{
|
||||||
// Shader Model 1.4 only uses 256-color palettes.
|
// Shader Model 1.4 only uses 256-color palettes.
|
||||||
SetConstant(2, 255 / 256.f, pal / 256.f, 0, 0);
|
SetConstant(2, pc / 256.f, pal / 256.f, 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3074,12 +3075,12 @@ void D3DFB::SetPaletteTexture(IDirect3DTexture9 *texture, int count)
|
||||||
// the palette indexes so they lie exactly in the center of each
|
// the palette indexes so they lie exactly in the center of each
|
||||||
// texel. For a normal palette with 256 entries, that means the
|
// texel. For a normal palette with 256 entries, that means the
|
||||||
// range we use should be [0.5,255.5], adjusted so the coordinate
|
// range we use should be [0.5,255.5], adjusted so the coordinate
|
||||||
// is still with [0.0,1.0].
|
// is still within [0.0,1.0].
|
||||||
//
|
//
|
||||||
// The constant register c2 is used to hold the multiplier in the
|
// The constant register c2 is used to hold the multiplier in the
|
||||||
// x part and the adder in the y part.
|
// x part and the adder in the y part.
|
||||||
float fcount = 1 / float(count);
|
float fcount = 1 / float(count);
|
||||||
SetConstant(2, 255 * fcount, pal * fcount, 0, 0);
|
SetConstant(2, pc * fcount, pal * fcount, 0, 0);
|
||||||
}
|
}
|
||||||
SetTexture(1, texture);
|
SetTexture(1, texture);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue