mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 11:40:44 +00:00
- Blood: use names instead of indices to address textures in the status bar drawer.
This is a preparation for scriptification of the status bars. Blood's wasn't using any symbolic constants at all aside from the new HUD fonts.
This commit is contained in:
parent
acb4830eb5
commit
5859188d3a
3 changed files with 295 additions and 117 deletions
|
@ -18,3 +18,177 @@ x(SBarNumberInv, 9240)
|
|||
x(SBarNumberArmor1, 9250)
|
||||
x(SBarNumberArmor2, 9260)
|
||||
x(SBarNumberArmor3, 9270)
|
||||
x(SBarSlash, 9280)
|
||||
|
||||
x(PackBG, 2568)
|
||||
x(PackSelect, 2559)
|
||||
|
||||
x(PackIcon1, 2569)
|
||||
x(PackIcon2, 2564)
|
||||
x(PackIcon3, 2566)
|
||||
x(PackIcon4, 2568)
|
||||
x(PackIcon5, 2560)
|
||||
|
||||
x(Pack2Icon1, 519)
|
||||
x(Pack2Icon2, 830)
|
||||
x(Pack2Icon3, 760)
|
||||
x(Pack2Icon4, 839)
|
||||
x(Pack2Icon5, 827)
|
||||
|
||||
x(AmmoIcon1, 816)
|
||||
x(AmmoIcon2, 619)
|
||||
x(AmmoIcon3, 817)
|
||||
x(AmmoIcon4, 801)
|
||||
x(AmmoIcon5, 589)
|
||||
x(AmmoIcon6, 618)
|
||||
x(AmmoIcon7, 548)
|
||||
x(AmmoIcon8, 820)
|
||||
x(AmmoIcon9, 525)
|
||||
x(AmmoIcon10, 811)
|
||||
x(AmmoIcon11, 810)
|
||||
|
||||
x(SBPlayerSlot, 2229)
|
||||
|
||||
x(FlagHave, 3558)
|
||||
x(FlagHaveNot, 3559)
|
||||
x(FlagDropped, 2332)
|
||||
x(FlagTaken, 4097)
|
||||
x(Statusbar, 2200)
|
||||
x(FullHUD, 2201)
|
||||
x(Armor1Gauge, 2207)
|
||||
x(Armor2Gauge, 2208)
|
||||
x(Armor3Gauge, 2209)
|
||||
|
||||
x(KeyIcon1, 2220)
|
||||
x(KeyIcon2, 2221)
|
||||
x(KeyIcon3, 2222)
|
||||
x(KeyIcon4, 2223)
|
||||
x(KeyIcon5, 2224)
|
||||
x(KeyIcon6, 2225)
|
||||
|
||||
x(HudKeyIcon1, 2552)
|
||||
x(HudKeyIcon2, 2553)
|
||||
x(HudKeyIcon3, 2554)
|
||||
x(HudKeyIcon4, 2555)
|
||||
x(HudKeyIcon5, 2556)
|
||||
x(HudKeyIcon6, 2557)
|
||||
x(HudKeyIcon7, 2558)
|
||||
|
||||
x(BlinkIcon, 2202)
|
||||
x(ThrowGauge, 2260)
|
||||
x(Armorbox, 2173)
|
||||
|
||||
x(Healthicon, 2169)
|
||||
x(Armor1Icon, 2578)
|
||||
x(Armor2Icon, 2602)
|
||||
x(Armor3Icon, 2586)
|
||||
|
||||
x(SBarNumberHealth0, 9220)
|
||||
x(SBarNumberHealth1, 9221)
|
||||
x(SBarNumberHealth2, 9222)
|
||||
x(SBarNumberHealth3, 9223)
|
||||
x(SBarNumberHealth4, 9224)
|
||||
x(SBarNumberHealth5, 9225)
|
||||
x(SBarNumberHealth6, 9226)
|
||||
x(SBarNumberHealth7, 9227)
|
||||
x(SBarNumberHealth8, 9228)
|
||||
x(SBarNumberHealth9, 9229)
|
||||
|
||||
x(SBarNumberAmmo0, 9230)
|
||||
x(SBarNumberAmmo1, 9231)
|
||||
x(SBarNumberAmmo2, 9232)
|
||||
x(SBarNumberAmmo3, 9233)
|
||||
x(SBarNumberAmmo4, 9234)
|
||||
x(SBarNumberAmmo5, 9235)
|
||||
x(SBarNumberAmmo6, 9236)
|
||||
x(SBarNumberAmmo7, 9237)
|
||||
x(SBarNumberAmmo8, 9238)
|
||||
x(SBarNumberAmmo9, 9239)
|
||||
|
||||
x(SBarNumberInv0, 9240)
|
||||
x(SBarNumberInv1, 9241)
|
||||
x(SBarNumberInv2, 9242)
|
||||
x(SBarNumberInv3, 9243)
|
||||
x(SBarNumberInv4, 9244)
|
||||
x(SBarNumberInv5, 9245)
|
||||
x(SBarNumberInv6, 9246)
|
||||
x(SBarNumberInv7, 9247)
|
||||
x(SBarNumberInv8, 9248)
|
||||
x(SBarNumberInv9, 9249)
|
||||
|
||||
x(SBarNumberArmor1_0, 9250)
|
||||
x(SBarNumberArmor1_1, 9251)
|
||||
x(SBarNumberArmor1_2, 9252)
|
||||
x(SBarNumberArmor1_3, 9253)
|
||||
x(SBarNumberArmor1_4, 9254)
|
||||
x(SBarNumberArmor1_5, 9255)
|
||||
x(SBarNumberArmor1_6, 9256)
|
||||
x(SBarNumberArmor1_7, 9257)
|
||||
x(SBarNumberArmor1_8, 9258)
|
||||
x(SBarNumberArmor1_9, 9259)
|
||||
|
||||
x(SBarNumberArmor2_0, 9260)
|
||||
x(SBarNumberArmor2_1, 9261)
|
||||
x(SBarNumberArmor2_2, 9262)
|
||||
x(SBarNumberArmor2_3, 9263)
|
||||
x(SBarNumberArmor2_4, 9264)
|
||||
x(SBarNumberArmor2_5, 9265)
|
||||
x(SBarNumberArmor2_6, 9266)
|
||||
x(SBarNumberArmor2_7, 9267)
|
||||
x(SBarNumberArmor2_8, 9268)
|
||||
x(SBarNumberArmor2_9, 9269)
|
||||
|
||||
x(SBarNumberArmor3_0, 9270)
|
||||
x(SBarNumberArmor3_1, 9271)
|
||||
x(SBarNumberArmor3_2, 9272)
|
||||
x(SBarNumberArmor3_3, 9273)
|
||||
x(SBarNumberArmor3_4, 9274)
|
||||
x(SBarNumberArmor3_5, 9275)
|
||||
x(SBarNumberArmor3_6, 9276)
|
||||
x(SBarNumberArmor3_7, 9277)
|
||||
x(SBarNumberArmor3_8, 9278)
|
||||
x(SBarNumberArmor3_9, 9279)
|
||||
|
||||
x(SBarPackAmount0, 2250)
|
||||
x(SBarPackAmount1, 2251)
|
||||
x(SBarPackAmount2, 2252)
|
||||
x(SBarPackAmount3, 2253)
|
||||
x(SBarPackAmount4, 2254)
|
||||
x(SBarPackAmount5, 2255)
|
||||
x(SBarPackAmount6, 2256)
|
||||
x(SBarPackAmount7, 2257)
|
||||
x(SBarPackAmount8, 2258)
|
||||
x(SBarPackAmount9, 2259)
|
||||
|
||||
x(SBarHealthAmount0, 2190)
|
||||
x(SBarHealthAmount1, 2191)
|
||||
x(SBarHealthAmount2, 2192)
|
||||
x(SBarHealthAmount3, 2193)
|
||||
x(SBarHealthAmount4, 2194)
|
||||
x(SBarHealthAmount5, 2195)
|
||||
x(SBarHealthAmount6, 2196)
|
||||
x(SBarHealthAmount7, 2197)
|
||||
x(SBarHealthAmount8, 2198)
|
||||
x(SBarHealthAmount9, 2199)
|
||||
|
||||
x(SBarAmmoAmount0, 2230)
|
||||
x(SBarAmmoAmount1, 2231)
|
||||
x(SBarAmmoAmount2, 2232)
|
||||
x(SBarAmmoAmount3, 2233)
|
||||
x(SBarAmmoAmount4, 2234)
|
||||
x(SBarAmmoAmount5, 2235)
|
||||
x(SBarAmmoAmount6, 2236)
|
||||
x(SBarAmmoAmount7, 2237)
|
||||
x(SBarAmmoAmount8, 2238)
|
||||
x(SBarAmmoAmount9, 2239)
|
||||
|
||||
x(SBarWaponNum0, 2240)
|
||||
x(SBarWaponNum0, 2241)
|
||||
x(SBarWaponNum0, 2242)
|
||||
x(SBarWaponNum0, 2243)
|
||||
x(SBarWaponNum0, 2244)
|
||||
x(SBarWaponNum0, 2245)
|
||||
x(SBarWaponNum0, 2246)
|
||||
x(SBarWaponNum0, 2247)
|
||||
x(SBarWaponNum0, 2248)
|
||||
x(SBarWaponNum0, 2249)
|
||||
|
|
|
@ -51,44 +51,19 @@ BEGIN_BLD_NS
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static int gPackIcons[5] = {
|
||||
2569, 2564, 2566, 2568, 2560
|
||||
static const char* gPackIcons[5] = {
|
||||
"PackIcon1", "PackIcon2", "PackIcon3", "PackIcon4", "PackIcon5"
|
||||
};
|
||||
|
||||
struct PACKICON2 {
|
||||
short nTile;
|
||||
int nScale;
|
||||
int nYOffs;
|
||||
};
|
||||
static const char* packIcons2[] = { "Pack2Icon1", "Pack2Icon2", "Pack2Icon3", "Pack2Icon4", "Pack2Icon5" };
|
||||
static const char* ammoIcons[] = { nullptr, "AmmoIcon1", "AmmoIcon2", "AmmoIcon3", "AmmoIcon4", "AmmoIcon5", "AmmoIcon6",
|
||||
"AmmoIcon7", "AmmoIcon8", "AmmoIcon9", "AmmoIcon10", "AmmoIcon11" };
|
||||
|
||||
PACKICON2 gPackIcons2[] = {
|
||||
{ 519, (int)(65536 * 0.5), 0 },
|
||||
{ 830, (int)(65536 * 0.3), 0 },
|
||||
{ 760, (int)(65536 * 0.6), 0 },
|
||||
{ 839, (int)(65536 * 0.5), -4 },
|
||||
{ 827, (int)(65536 * 0.4), 0 },
|
||||
};
|
||||
static const float packScale[] = { 0.5f, 0.3f, 0.6f, 0.5f, 0.4f };
|
||||
static const int packYoffs[] = { 0, 0, 0, -4, 0 };
|
||||
static const float ammoScale[] = { 0, 0.5f, 0.8f, 0.7f, 0.5f, 0.7f, 0.5f, 0.3f, 0.3f, 0.6f, 0.5f, 0.45f };
|
||||
static const int ammoYoffs[] = { 0, 0, 0, 3, -6, 2, 4, -6, -6, -6, 2, 2 };
|
||||
|
||||
struct AMMOICON {
|
||||
short nTile;
|
||||
int nScale;
|
||||
int nYOffs;
|
||||
};
|
||||
|
||||
static AMMOICON gAmmoIcons[] = {
|
||||
{ -1, 0, 0 },
|
||||
{ 816, (int)(65536 * 0.5), 0 },
|
||||
{ 619, (int)(65536 * 0.8), 0 },
|
||||
{ 817, (int)(65536 * 0.7), 3 },
|
||||
{ 801, (int)(65536 * 0.5), -6 },
|
||||
{ 589, (int)(65536 * 0.7), 2 },
|
||||
{ 618, (int)(65536 * 0.5), 4 },
|
||||
{ 548, (int)(65536 * 0.3), -6 },
|
||||
{ 820, (int)(65536 * 0.3), -6 },
|
||||
{ 525, (int)(65536 * 0.6), -6 },
|
||||
{ 811, (int)(65536 * 0.5), 2 },
|
||||
{ 810, (int)(65536 * 0.45), 2 },
|
||||
};
|
||||
|
||||
struct POWERUPDISPLAY
|
||||
{
|
||||
|
@ -124,27 +99,53 @@ private:
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DrawStatSprite(int nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, ERenderStyle style = STYLE_Normal, int align = DI_SCREEN_AUTO)
|
||||
void DrawStatSprite(const char* nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, ERenderStyle style = STYLE_Normal, int align = DI_SCREEN_AUTO)
|
||||
{
|
||||
int flags = align | ((nStat & RS_CENTERBOTTOM)? DI_ITEM_CENTER_BOTTOM : (nStat & RS_TOPLEFT)? DI_ITEM_LEFT_TOP : DI_ITEM_RELCENTER);
|
||||
double alpha = 1.;
|
||||
double scale = nScale / 65536.;
|
||||
DrawGraphic(TexMan.CheckForTexture(nTile, ETextureType::Any), x, y, flags, alpha, -1, -1, scale, scale, STYLE_Translucent, shadeToLight(nShade), TRANSLATION(Translation_Remap, nPalette), style);
|
||||
}
|
||||
void DrawStatMaskedSprite(const char* nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, int align = DI_SCREEN_AUTO)
|
||||
{
|
||||
DrawStatSprite(nTile, x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
}
|
||||
|
||||
void DrawStatSprite(int nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, ERenderStyle style = STYLE_Normal, int align = DI_SCREEN_AUTO)
|
||||
{
|
||||
int flags = align | ((nStat & RS_CENTERBOTTOM) ? DI_ITEM_CENTER_BOTTOM : (nStat & RS_TOPLEFT) ? DI_ITEM_LEFT_TOP : DI_ITEM_RELCENTER);
|
||||
double alpha = 1.;
|
||||
double scale = nScale / 65536.;
|
||||
DrawGraphic(tileGetTexture(nTile, true), x, y, flags, alpha, -1, -1, scale, scale, STYLE_Translucent, shadeToLight(nShade), TRANSLATION(Translation_Remap, nPalette), style);
|
||||
}
|
||||
|
||||
void DrawStatMaskedSprite(int nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, int align = DI_SCREEN_AUTO)
|
||||
{
|
||||
DrawStatSprite(nTile, x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
}
|
||||
|
||||
int texWidth(const char* name)
|
||||
{
|
||||
auto tex = TexMan.FindGameTexture(name, ETextureType::Any);
|
||||
return tex ? int(tex->GetDisplayWidth()) : 0;
|
||||
}
|
||||
|
||||
int texHeight(const char* name)
|
||||
{
|
||||
auto tex = TexMan.FindGameTexture(name, ETextureType::Any);
|
||||
return tex ? int(tex->GetDisplayHeight()) : 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DrawStatNumber(const char* pFormat, int nNumber, int nTile, double x, double y, int nShade, int nPalette, unsigned int nStat = 0, int nScale = 65536, int align = 0)
|
||||
void DrawStatNumber(const char* pFormat, int nNumber, const char* nametemplate, double x, double y, int nShade, int nPalette, unsigned int nStat = 0, int nScale = 65536, int align = 0)
|
||||
{
|
||||
double width = (tileWidth(nTile) + 1) * (nScale / 65536.);
|
||||
FStringf name("%s%d", nametemplate, 1);
|
||||
double width = (texWidth(name) + 1) * (nScale / 65536.);
|
||||
|
||||
char tempbuf[80];
|
||||
mysnprintf(tempbuf, 80, pFormat, nNumber);
|
||||
|
@ -153,7 +154,8 @@ private:
|
|||
for (unsigned int i = 0; tempbuf[i]; i++, x += width)
|
||||
{
|
||||
if (tempbuf[i] == ' ') continue;
|
||||
DrawStatSprite(nTile + tempbuf[i] - '0', x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
name.Format("%s%d", nametemplate, tempbuf[i] - '0');
|
||||
DrawStatSprite(name, x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,23 +165,25 @@ private:
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DrawCharArray(const char* string, int nTile, double x, double y, int nShade, int nPalette, unsigned int nStat = 0, int nScale = 65536, int align = 0)
|
||||
void DrawCharArray(const char* text, const char *nametemplate, double x, double y, int nShade, int nPalette, unsigned int nStat = 0, int nScale = 65536, int align = 0)
|
||||
{
|
||||
double width = (tileWidth(nTile) + 1) * (nScale / 65536.);
|
||||
FStringf name("%s%d", nametemplate, 1);
|
||||
double width = (texWidth(name) + 1) * (nScale / 65536.);
|
||||
|
||||
x += 0.5;
|
||||
y += 0.5; // This is needed because due to using floating point math, this code rounds slightly differently which for the numbers can be a problem.
|
||||
|
||||
for (unsigned int i = 0; string[i]; i++, x += width)
|
||||
for (unsigned int i = 0; text[i]; i++, x += width)
|
||||
{
|
||||
// Hackasaurus rex to give me a slash when drawing the weapon count of a reloadable gun.
|
||||
if (string[i] == 47 && nTile == kSBarNumberAmmo)
|
||||
if (text[i] == 47)
|
||||
{
|
||||
DrawStatSprite(9280, x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
DrawStatSprite("SBarSlash", x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawStatSprite(nTile + string[i] - '0', x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
name.Format("%s%d", nametemplate, text[i] - '0');
|
||||
DrawStatSprite(name, x, y, nShade, nPalette, nStat, nScale, STYLE_Translucent, align);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,13 +194,15 @@ private:
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void TileHGauge(int nTile, double x, double y, int nMult, int nDiv, int nStat = 0, int nScale = 65536)
|
||||
void TileHGauge(const char* nTile, double x, double y, int nMult, int nDiv, int nStat = 0, int nScale = 65536)
|
||||
{
|
||||
int w = tileWidth(nTile);
|
||||
auto tex = TexMan.CheckForTexture(nTile, ETextureType::Any);
|
||||
if (!tex.isValid()) return;
|
||||
int w = TexMan.GetGameTexture(tex)->GetDisplayWidth();
|
||||
int bx = scale(MulScale(w, nScale, 16), nMult, nDiv) + x;
|
||||
double scale = double(bx - x) / w;
|
||||
double sc = nScale / 65536.;
|
||||
DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, sc, sc, STYLE_Translucent, 0xffffffff, 0, scale);
|
||||
DrawGraphic(tex, x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, sc, sc, STYLE_Translucent, 0xffffffff, 0, scale);
|
||||
}
|
||||
|
||||
|
||||
|
@ -317,7 +323,7 @@ private:
|
|||
DrawStatMaskedSprite(powerups[i].nTile, x, y + powerups[i].yOffset, 0, 0, 256, (int)(65536 * powerups[i].nScaleRatio), DI_SCREEN_LEFT_CENTER);
|
||||
}
|
||||
|
||||
DrawStatNumber("%d", remainingSeconds, kSBarNumberInv, x + 15, y, 0, remainingSeconds > warningTime ? 0 : 2, 256, 65536 * 0.5, DI_SCREEN_LEFT_CENTER);
|
||||
DrawStatNumber("%d", remainingSeconds, "SBarNumberInv", x + 15, y, 0, remainingSeconds > warningTime ? 0 : 2, 256, 65536 * 0.5, DI_SCREEN_LEFT_CENTER);
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
|
@ -341,7 +347,7 @@ private:
|
|||
if (pPlayer->packSlots[i].curAmount)
|
||||
{
|
||||
packs[nPacks++] = i;
|
||||
width += tileWidth(gPackIcons[i]) + 1;
|
||||
width += texWidth(gPackIcons[i]) + 1;
|
||||
}
|
||||
}
|
||||
width /= 2;
|
||||
|
@ -349,18 +355,18 @@ private:
|
|||
for (int i = 0; i < nPacks; i++)
|
||||
{
|
||||
int nPack = packs[i];
|
||||
DrawStatSprite(2568, x + 1, y - 8);
|
||||
DrawStatSprite(2568, x + 1, y - 6);
|
||||
DrawStatSprite("PackBG", x + 1, y - 8);
|
||||
DrawStatSprite("PackBG", x + 1, y - 6);
|
||||
DrawStatSprite(gPackIcons[nPack], x + 1, y + 1);
|
||||
if (nPack == pPlayer->packItemId)
|
||||
DrawStatMaskedSprite(2559, x + 1, y + 1);
|
||||
DrawStatMaskedSprite("PackSelect", x + 1, y + 1);
|
||||
int nShade;
|
||||
if (pPlayer->packSlots[nPack].isActive)
|
||||
nShade = 4;
|
||||
else
|
||||
nShade = 24;
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[nPack].curAmount, 2250, x - 4, y - 13, nShade, 0);
|
||||
x += tileWidth(gPackIcons[nPack]) + 1;
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[nPack].curAmount, "SBarPackAmount", x - 4, y - 13, nShade, 0);
|
||||
x += texWidth(gPackIcons[nPack]) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -378,15 +384,15 @@ private:
|
|||
if (id < 0) return;
|
||||
|
||||
DrawStatSprite(gPackIcons[id], x, y, 0, 0);
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[id].curAmount, 2250, x2, y2, 0, 0);
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[id].curAmount, "SBarPackAmount", x2, y2, 0, 0);
|
||||
}
|
||||
|
||||
void DrawPackItemInStatusBar2(PLAYER* pPlayer, int x, int y, int x2, int y2, int nStat, int nScale)
|
||||
{
|
||||
if (pPlayer->packItemId < 0) return;
|
||||
|
||||
DrawStatMaskedSprite(gPackIcons2[pPlayer->packItemId].nTile, x, y + gPackIcons2[pPlayer->packItemId].nYOffs, 0, 0, nStat, gPackIcons2[pPlayer->packItemId].nScale);
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[pPlayer->packItemId].curAmount, kSBarNumberInv, x2, y2, 0, 0, nStat, nScale);
|
||||
DrawStatMaskedSprite(packIcons2[pPlayer->packItemId], x, y + packYoffs[pPlayer->packItemId], 0, 0, nStat, packScale[pPlayer->packItemId] * 65536);
|
||||
DrawStatNumber("%3d", pPlayer->packSlots[pPlayer->packItemId].curAmount, "SBarNumberInv", x2, y2, 0, 0, nStat, nScale);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -401,7 +407,7 @@ private:
|
|||
{
|
||||
for (int nCol = 0; nCol < 4; nCol++)
|
||||
{
|
||||
DrawStatSprite(2229, -120 + nCol * 80, 4 + nRows * 9, 16, 0, 0, 65536, STYLE_Normal, DI_SCREEN_CENTER_TOP);
|
||||
DrawStatSprite("SBPlayerSlot", -120 + nCol * 80, 4 + nRows * 9, 16, 0, 0, 65536, STYLE_Normal, DI_SCREEN_CENTER_TOP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -503,7 +509,7 @@ private:
|
|||
if (team_ticker[team] == 0 || (PlayClock & 8))
|
||||
{
|
||||
if (show)
|
||||
DrawStatNumber("%d", team_score[team], kSBarNumberInv, -30, team ? 25 : -10, 0, team ? 2 : 10, 512, 65536 * 0.75, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatNumber("%d", team_score[team], "SBarNumberInv", -30, team ? 25 : -10, 0, team ? 2 : 10, 512, 65536 * 0.75, DI_SCREEN_RIGHT_CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -541,19 +547,19 @@ private:
|
|||
}
|
||||
|
||||
bool meHaveBlueFlag = gMe->hasFlag & 1;
|
||||
DrawStatMaskedSprite(meHaveBlueFlag ? 3558 : 3559, 0, 75-100, 0, 10, 512, 65536 * 0.35, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite(meHaveBlueFlag ? "FlagHave" : "FlagHaveNot", 0, 75-100, 0, 10, 512, 65536 * 0.35, DI_SCREEN_RIGHT_CENTER);
|
||||
if (gBlueFlagDropped)
|
||||
DrawStatMaskedSprite(2332, 305-320, 83 - 100, 0, 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite("FlagDropped", 305-320, 83 - 100, 0, 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
else if (blueFlagTaken)
|
||||
DrawStatMaskedSprite(4097, 307-320, 77 - 100, 0, blueFlagCarrierColor ? 2 : 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite("FlagTaken", 307-320, 77 - 100, 0, blueFlagCarrierColor ? 2 : 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
flashTeamScore(0, true);
|
||||
|
||||
bool meHaveRedFlag = gMe->hasFlag & 2;
|
||||
DrawStatMaskedSprite(meHaveRedFlag ? 3558 : 3559, 0, 10, 0, 2, 512, 65536 * 0.35, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite(meHaveRedFlag ? "FlagHave" : "FlagHaveNot", 0, 10, 0, 2, 512, 65536 * 0.35, DI_SCREEN_RIGHT_CENTER);
|
||||
if (gRedFlagDropped)
|
||||
DrawStatMaskedSprite(2332, 305-320, 17, 0, 2, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite("FlagDropped", 305-320, 17, 0, 2, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
else if (redFlagTaken)
|
||||
DrawStatMaskedSprite(4097, 307-320, 11, 0, redFlagCarrierColor ? 2 : 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
DrawStatMaskedSprite("FlagTaken", 307-320, 11, 0, redFlagCarrierColor ? 2 : 10, 512, 65536, DI_SCREEN_RIGHT_CENTER);
|
||||
flashTeamScore(1, true);
|
||||
}
|
||||
|
||||
|
@ -565,24 +571,25 @@ private:
|
|||
|
||||
void DrawStatusBar(int nPalette)
|
||||
{
|
||||
BeginStatusBar(320, 200, tileHeight(2200));
|
||||
int th = texHeight("Statusbar");
|
||||
BeginStatusBar(320, 200, th);
|
||||
|
||||
PLAYER* pPlayer = gView;
|
||||
XSPRITE* pXSprite = pPlayer->pXSprite;
|
||||
|
||||
DrawStatMaskedSprite(2200, 160, 200, 0, nPalette, RS_CENTERBOTTOM);
|
||||
DrawStatMaskedSprite("Statusbar", 160, 200, 0, nPalette, RS_CENTERBOTTOM);
|
||||
DrawPackItemInStatusBar(pPlayer, 265, 186, 260, 172);
|
||||
|
||||
if (pXSprite->health >= 16 || (PlayClock & 16) || pXSprite->health == 0)
|
||||
{
|
||||
DrawStatNumber("%3d", pXSprite->health >> 4, 2190, 86, 183, 0, 0);
|
||||
DrawStatNumber("%3d", pXSprite->health >> 4, "SBarHealthAmount", 86, 183, 0, 0);
|
||||
}
|
||||
if (pPlayer->curWeapon && pPlayer->weaponAmmo != -1)
|
||||
{
|
||||
int num = pPlayer->ammoCount[pPlayer->weaponAmmo];
|
||||
if (pPlayer->weaponAmmo == 6)
|
||||
num /= 10;
|
||||
DrawStatNumber("%3d", num, 2240, 216, 183, 0, 0);
|
||||
DrawStatNumber("%3d", num, "SBarWeaponNum", 216, 183, 0, 0);
|
||||
}
|
||||
for (int i = 9; i >= 1; i--)
|
||||
{
|
||||
|
@ -591,30 +598,30 @@ private:
|
|||
int num = pPlayer->ammoCount[i];
|
||||
if (i == 6)
|
||||
num /= 10;
|
||||
DrawStatNumber("%3d", num, 2230, x, y, i == pPlayer->weaponAmmo? -128 : 32, 10);
|
||||
DrawStatNumber("%3d", num, "SBarAmmoAmount", x, y, i == pPlayer->weaponAmmo? -128 : 32, 10);
|
||||
}
|
||||
DrawStatNumber("%2d", pPlayer->ammoCount[10], 2230, 291, 194, pPlayer->weaponAmmo == 10? -128 : 32, 10);
|
||||
DrawStatNumber("%2d", pPlayer->ammoCount[11], 2230, 309, 194, pPlayer->weaponAmmo == 11? -128 : 32, 10);
|
||||
DrawStatNumber("%2d", pPlayer->ammoCount[10], "SBarAmmoAmount", 291, 194, pPlayer->weaponAmmo == 10? -128 : 32, 10);
|
||||
DrawStatNumber("%2d", pPlayer->ammoCount[11], "SBarAmmoAmount", 309, 194, pPlayer->weaponAmmo == 11? -128 : 32, 10);
|
||||
|
||||
if (pPlayer->armor[1])
|
||||
{
|
||||
TileHGauge(2207, 44, 174, pPlayer->armor[1], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, 2230, 50, 177, 0, 0);
|
||||
TileHGauge("Armor1Gauge", 44, 174, pPlayer->armor[1], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, "SBarAmmoAmount", 50, 177, 0, 0);
|
||||
}
|
||||
if (pPlayer->armor[0])
|
||||
{
|
||||
TileHGauge(2209, 44, 182, pPlayer->armor[0], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, 2230, 50, 185, 0, 0);
|
||||
TileHGauge("Armor3Gauge", 44, 182, pPlayer->armor[0], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, "SBarAmmoAmount", 50, 185, 0, 0);
|
||||
}
|
||||
if (pPlayer->armor[2])
|
||||
{
|
||||
TileHGauge(2208, 44, 190, pPlayer->armor[2], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, 2230, 50, 193, 0, 0);
|
||||
TileHGauge("Armor2Gauge", 44, 190, pPlayer->armor[2], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, "SBarAmmoAmount", 50, 193, 0, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int nTile = 2220 + i;
|
||||
FStringf nTile("KEYICON%d", i+1);
|
||||
double x = 73.5 + (i & 1) * 173;
|
||||
double y = 171.5 + (i >> 1) * 11;
|
||||
if (pPlayer->hasKey[i + 1])
|
||||
|
@ -622,13 +629,13 @@ private:
|
|||
else
|
||||
DrawStatSprite(nTile, x, y, 40, 5);
|
||||
}
|
||||
DrawStatMaskedSprite(2202, 118.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||
DrawStatMaskedSprite(2202, 201.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||
DrawStatMaskedSprite("BlinkIcon", 118.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||
DrawStatMaskedSprite("BlinkIcon", 201.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||
if (pPlayer->throwPower)
|
||||
{
|
||||
TileHGauge(2260, 124, 175.5, pPlayer->throwPower, 65536);
|
||||
TileHGauge("ThrowGauge", 124, 175.5, pPlayer->throwPower, 65536);
|
||||
}
|
||||
drawInventory(pPlayer, 166, 200 - tileHeight(2200));
|
||||
drawInventory(pPlayer, 166, 200 - th);
|
||||
// Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already.
|
||||
PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scalefactor < 0.7) && double(twod->GetWidth())/twod->GetHeight() > 1.6? 28 : 56);
|
||||
|
||||
|
@ -646,40 +653,40 @@ private:
|
|||
XSPRITE* pXSprite = pPlayer->pXSprite;
|
||||
|
||||
BeginHUD(320, 200, 1);
|
||||
DrawStatSprite(2201, 34, 187 - 200, 16, nPalette);
|
||||
DrawStatSprite("FullHUD", 34, 187 - 200, 16, nPalette);
|
||||
if (pXSprite->health >= 16 || (PlayClock & 16) || pXSprite->health == 0)
|
||||
{
|
||||
DrawStatNumber("%3d", pXSprite->health >> 4, 2190, 8, 183 - 200, 0, 0);
|
||||
DrawStatNumber("%3d", pXSprite->health >> 4, "SBarHealthAmount", 8, 183 - 200, 0, 0);
|
||||
}
|
||||
if (pPlayer->curWeapon && pPlayer->weaponAmmo != -1)
|
||||
{
|
||||
int num = pPlayer->ammoCount[pPlayer->weaponAmmo];
|
||||
if (pPlayer->weaponAmmo == 6)
|
||||
num /= 10;
|
||||
DrawStatNumber("%3d", num, 2240, 42, 183 - 200, 0, 0);
|
||||
DrawStatNumber("%3d", num, "SBarWeaponNum", 42, 183 - 200, 0, 0);
|
||||
}
|
||||
DrawStatSprite(2173, 284-320, 187 - 200, 16, nPalette);
|
||||
DrawStatSprite("ArmorBox", 284-320, 187 - 200, 16, nPalette);
|
||||
if (pPlayer->armor[1])
|
||||
{
|
||||
TileHGauge(2207, 250-320, 175 - 200, pPlayer->armor[1], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, 2230, 255-320, 178 - 200, 0, 0);
|
||||
TileHGauge("Armor1Gauge", 250-320, 175 - 200, pPlayer->armor[1], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, "SBarAmmoAmount", 255-320, 178 - 200, 0, 0);
|
||||
}
|
||||
if (pPlayer->armor[0])
|
||||
{
|
||||
TileHGauge(2209, 250-320, 183 - 200, pPlayer->armor[0], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, 2230, 255-320, 186 - 200, 0, 0);
|
||||
TileHGauge("Armor3Gauge", 250-320, 183 - 200, pPlayer->armor[0], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, "SBarAmmoAmount", 255-320, 186 - 200, 0, 0);
|
||||
}
|
||||
if (pPlayer->armor[2])
|
||||
{
|
||||
TileHGauge(2208, 250-320, 191 - 200, pPlayer->armor[2], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, 2230, 255-320, 194 - 200, 0, 0);
|
||||
TileHGauge("Armor2Gauge", 250-320, 191 - 200, pPlayer->armor[2], 3200);
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, "SBarAmmoAmount", 255-320, 194 - 200, 0, 0);
|
||||
}
|
||||
|
||||
DrawPackItemInStatusBar(pPlayer, 286-320, 186 - 200, 302-320, 183 - 200);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int nTile = 2220 + i;
|
||||
FStringf nTile("KEYICON%d", i+1);
|
||||
int x;
|
||||
int y = - 6;
|
||||
if (i & 1)
|
||||
|
@ -708,22 +715,22 @@ private:
|
|||
XSPRITE* pXSprite = pPlayer->pXSprite;
|
||||
|
||||
BeginHUD(320, 200, 1);
|
||||
DrawStatMaskedSprite(2169, 12, 195 - 200, 0, 0, 256, (int)(65536 * 0.56));
|
||||
DrawStatNumber("%d", pXSprite->health >> 4, kSBarNumberHealth, 28, 187 - 200, 0, 0, 256);
|
||||
DrawStatMaskedSprite("HealthIcon", 12, 195 - 200, 0, 0, 256, (int)(65536 * 0.56));
|
||||
DrawStatNumber("%d", pXSprite->health >> 4, "SBarNumberHealth", 28, 187 - 200, 0, 0, 256);
|
||||
if (pPlayer->armor[1])
|
||||
{
|
||||
DrawStatMaskedSprite(2578, 70, 186 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, kSBarNumberArmor2, 83, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
DrawStatMaskedSprite("Armor1Icon", 70, 186 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[1] >> 4, "SBarNumberArmor2_", 83, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
}
|
||||
if (pPlayer->armor[0])
|
||||
{
|
||||
DrawStatMaskedSprite(2586, 112, 195 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, kSBarNumberArmor1, 125, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
DrawStatMaskedSprite("Armor3Icon", 112, 195 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[0] >> 4, "SBarNumberArmor1_", 125, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
}
|
||||
if (pPlayer->armor[2])
|
||||
{
|
||||
DrawStatMaskedSprite(2602, 155, 196 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, kSBarNumberArmor3, 170, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
DrawStatMaskedSprite("Armor2Icon", 155, 196 - 200, 0, 0, 256, (int)(65536 * 0.5));
|
||||
DrawStatNumber("%3d", pPlayer->armor[2] >> 4, "SBarNumberArmor3_", 170, 187 - 200, 0, 0, 256, (int)(65536 * 0.65));
|
||||
}
|
||||
|
||||
DrawPackItemInStatusBar2(pPlayer, 216 - 320, 194 - 200, 231 - 320, 187 - 200, 512, (int)(65536 * 0.7));
|
||||
|
@ -733,14 +740,14 @@ private:
|
|||
int num = pPlayer->ammoCount[pPlayer->weaponAmmo];
|
||||
if (pPlayer->weaponAmmo == 6)
|
||||
num /= 10;
|
||||
if ((unsigned int)gAmmoIcons[pPlayer->weaponAmmo].nTile < kMaxTiles)
|
||||
DrawStatMaskedSprite(gAmmoIcons[pPlayer->weaponAmmo].nTile, 304-320, -8 + gAmmoIcons[pPlayer->weaponAmmo].nYOffs,
|
||||
0, 0, 512, gAmmoIcons[pPlayer->weaponAmmo].nScale);
|
||||
if (ammoIcons[pPlayer->weaponAmmo])
|
||||
DrawStatMaskedSprite(ammoIcons[pPlayer->weaponAmmo], 304-320, -8 + ammoYoffs[pPlayer->weaponAmmo],
|
||||
0, 0, 512, ammoScale[pPlayer->weaponAmmo] * 65536);
|
||||
|
||||
bool reloadableWeapon = pPlayer->curWeapon == 3 && !powerupCheck(pPlayer, kPwUpTwoGuns);
|
||||
if (!reloadableWeapon || (reloadableWeapon && !cl_showmagamt))
|
||||
{
|
||||
DrawStatNumber("%3d", num, kSBarNumberAmmo, 267-320, 187 - 200, 0, 0, 512);
|
||||
DrawStatNumber("%3d", num, "SBarNumberAmmo", 267-320, 187 - 200, 0, 0, 512);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -749,21 +756,24 @@ private:
|
|||
short total = num - clip;
|
||||
format.Format("%d/%d", clip, num - clip);
|
||||
|
||||
DrawCharArray(format.GetChars(), kSBarNumberAmmo, (total < 10 ? 267 : 258) - 320, 187 - 200, 0, 0, 512);
|
||||
DrawCharArray(format.GetChars(), "SBarNumberAmmo", (total < 10 ? 267 : 258) - 320, 187 - 200, 0, 0, 512);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (pPlayer->hasKey[i + 1])
|
||||
DrawStatMaskedSprite(2552 + i, -60 + 10 * i, 170 - 200, 0, 0, 0, (int)(65536 * 0.25));
|
||||
{
|
||||
FStringf tile("HUDKEYICON%d", i + 1);
|
||||
DrawStatMaskedSprite(tile, -60 + 10 * i, 170 - 200, 0, 0, 0, (int)(65536 * 0.25));
|
||||
}
|
||||
}
|
||||
|
||||
BeginStatusBar(320, 200, 28);
|
||||
if (pPlayer->throwPower)
|
||||
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
||||
TileHGauge("ThrowGauge", 124, 175, pPlayer->throwPower, 65536);
|
||||
else
|
||||
drawInventory(pPlayer, 166, 200-tileHeight(2201) / 2 - 30);
|
||||
drawInventory(pPlayer, 166, 200-texHeight("FULLHUD") / 2 - 30);
|
||||
PrintLevelStats(pPlayer, 28);
|
||||
}
|
||||
|
||||
|
@ -796,7 +806,7 @@ private:
|
|||
{
|
||||
BeginStatusBar(320, 200, 28);
|
||||
if (pPlayer->throwPower)
|
||||
TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
|
||||
TileHGauge("ThrowGauge", 124, 175, pPlayer->throwPower, 65536);
|
||||
else if (hud_size > Hud_StbarOverlay)
|
||||
drawInventory(pPlayer, 166, 200 - tileHeight(2201) / 2);
|
||||
}
|
||||
|
|
|
@ -785,12 +785,6 @@ void viewDrawScreen(bool sceneonly)
|
|||
{
|
||||
gChoke.animateChoke(160, zn, (int)gInterpolate);
|
||||
}
|
||||
#if 0
|
||||
if (drawtile_2048)
|
||||
{
|
||||
DrawStatSprite(2048, xdim-15, 20);
|
||||
}
|
||||
#endif
|
||||
|
||||
viewDrawAimedPlayerName();
|
||||
if (paused)
|
||||
|
|
Loading…
Reference in a new issue