mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
Fake multi: draw the HUD weapons and status bar with the proper aspect.
This uses the new rotatesprite bit introduced earlier. Also, allow the HUD-less screen size. git-svn-id: https://svn.eduke32.com/eduke32@2931 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
eca0959740
commit
5806582805
2 changed files with 23 additions and 37 deletions
|
@ -1174,7 +1174,7 @@ static void G_DrawStatusBar(int32_t snum)
|
||||||
int32_t i, j, o, u;
|
int32_t i, j, o, u;
|
||||||
int32_t permbit = 0;
|
int32_t permbit = 0;
|
||||||
|
|
||||||
const int32_t ss = g_fakeMultiMode ? 4 : ud.screen_size;
|
const int32_t ss = g_fakeMultiMode ? min(ud.screen_size, 4) : ud.screen_size;
|
||||||
const int32_t althud = g_fakeMultiMode ? 0 : ud.althud;
|
const int32_t althud = g_fakeMultiMode ? 0 : ud.althud;
|
||||||
|
|
||||||
const int32_t SBY = (200-tilesizy[BOTTOMSTATUSBAR]);
|
const int32_t SBY = (200-tilesizy[BOTTOMSTATUSBAR]);
|
||||||
|
@ -1335,24 +1335,22 @@ static void G_DrawStatusBar(int32_t snum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ORIGINAL MINI STATUS BAR
|
// ORIGINAL MINI STATUS BAR
|
||||||
|
int32_t orient = 10+16+256 + (g_fakeMultiMode && snum==1)*(1<<29);
|
||||||
|
|
||||||
const int32_t ofs = (g_fakeMultiMode && snum==1) ? 160 : 0, ofssh=ofs<<16;
|
rotatesprite_fs(sbarx(5),sbary(200-28),sb16,0,HEALTHBOX,0,21,orient);
|
||||||
int32_t orient = 10+16+256 + (g_fakeMultiMode?1024:0);
|
|
||||||
|
|
||||||
rotatesprite_fs(ofssh+sbarx(5),sbary(200-28),sb16,0,HEALTHBOX,0,21,orient);
|
|
||||||
if (p->inven_icon)
|
if (p->inven_icon)
|
||||||
rotatesprite_fs(ofssh+sbarx(69),sbary(200-30),sb16,0,INVENTORYBOX,0,21,orient);
|
rotatesprite_fs(sbarx(69),sbary(200-30),sb16,0,INVENTORYBOX,0,21,orient);
|
||||||
|
|
||||||
// health
|
// health
|
||||||
if (sprite[p->i].pal == 1 && p->last_extra < 2) // frozen
|
if (sprite[p->i].pal == 1 && p->last_extra < 2) // frozen
|
||||||
G_DrawDigiNum(ofs+20,200-17,1,-16,orient);
|
G_DrawDigiNum(20,200-17,1,-16,orient);
|
||||||
else G_DrawDigiNum(ofs+20,200-17,p->last_extra,-16,orient);
|
else G_DrawDigiNum(20,200-17,p->last_extra,-16,orient);
|
||||||
|
|
||||||
rotatesprite_fs(ofssh+sbarx(37),sbary(200-28),sb16,0,AMMOBOX,0,21,orient);
|
rotatesprite_fs(sbarx(37),sbary(200-28),sb16,0,AMMOBOX,0,21,orient);
|
||||||
|
|
||||||
if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON;
|
if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON;
|
||||||
else i = p->curr_weapon;
|
else i = p->curr_weapon;
|
||||||
G_DrawDigiNum(ofs+53,200-17,p->ammo_amount[i],-16,orient);
|
G_DrawDigiNum(53,200-17,p->ammo_amount[i],-16,orient);
|
||||||
|
|
||||||
o = 158;
|
o = 158;
|
||||||
permbit = 0;
|
permbit = 0;
|
||||||
|
@ -1362,25 +1360,25 @@ static void G_DrawStatusBar(int32_t snum)
|
||||||
|
|
||||||
i = ((unsigned)p->inven_icon < 8) ? item_icons[p->inven_icon] : -1;
|
i = ((unsigned)p->inven_icon < 8) ? item_icons[p->inven_icon] : -1;
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
rotatesprite_fs(ofssh+sbarx(231-o),sbary(200-21),sb16,0,i,0,0, orient);
|
rotatesprite_fs(sbarx(231-o),sbary(200-21),sb16,0,i,0,0, orient);
|
||||||
|
|
||||||
if (!g_fakeMultiMode)
|
if (!g_fakeMultiMode)
|
||||||
orient |= ROTATESPRITE_MAX;
|
orient |= ROTATESPRITE_MAX;
|
||||||
|
|
||||||
minitext(ofs+292-30-o,190,"%",6, orient);
|
minitext(292-30-o,190,"%",6, orient);
|
||||||
|
|
||||||
i = G_GetInvAmount(p);
|
i = G_GetInvAmount(p);
|
||||||
j = G_GetInvOn(p);
|
j = G_GetInvOn(p);
|
||||||
|
|
||||||
G_DrawInvNum(ofs+284-30-o,200-6,(uint8_t)i,0, orient&~16);
|
G_DrawInvNum(284-30-o,200-6,(uint8_t)i,0, orient&~16);
|
||||||
|
|
||||||
if (j > 0)
|
if (j > 0)
|
||||||
minitext(ofs+288-30-o,180,"On",0, orient);
|
minitext(288-30-o,180,"On",0, orient);
|
||||||
else if ((uint32_t)j != 0x80000000)
|
else if ((uint32_t)j != 0x80000000)
|
||||||
minitext(ofs+284-30-o,180,"Off",2, orient);
|
minitext(284-30-o,180,"Off",2, orient);
|
||||||
|
|
||||||
if (p->inven_icon >= 6)
|
if (p->inven_icon >= 6)
|
||||||
minitext(ofs+284-35-o,180,"Auto",2, orient);
|
minitext(284-35-o,180,"Auto",2, orient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2022,11 +2022,10 @@ static inline int32_t weapsc(int32_t sc)
|
||||||
|
|
||||||
static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p)
|
static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int32_t orientation, int32_t p)
|
||||||
{
|
{
|
||||||
int32_t a = 0;
|
int32_t ang = 0;
|
||||||
int32_t xoff = 192;
|
int32_t xoff = 192;
|
||||||
|
|
||||||
int32_t xadd = 0;
|
int32_t wx[2] = { windowx1, windowx2 };
|
||||||
int32_t wx1=windowx1, wx2=windowx2;
|
|
||||||
|
|
||||||
switch (g_currentweapon)
|
switch (g_currentweapon)
|
||||||
{
|
{
|
||||||
|
@ -2043,36 +2042,25 @@ static void G_DrawTileScaled(int32_t x, int32_t y, int32_t tilenum, int32_t shad
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for G_DrawTileScaled, bit 4 means "flip x"
|
||||||
if (orientation&4)
|
if (orientation&4)
|
||||||
a = 1024;
|
ang = 1024;
|
||||||
|
|
||||||
if (g_fakeMultiMode && ud.multimode==2)
|
if (g_fakeMultiMode && ud.multimode==2)
|
||||||
{
|
{
|
||||||
// splitscreen HACK
|
// splitscreen HACK
|
||||||
xadd = (-80 + g_snum*160)*65536;
|
orientation &= ~(1024|512|256|8);
|
||||||
|
wx[(g_snum==0)] = (wx[0]+wx[1])/2+1;
|
||||||
if ((orientation&1024)==0)
|
|
||||||
{
|
|
||||||
x*=65536;
|
|
||||||
y*=65536;
|
|
||||||
orientation |= 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_snum==0)
|
|
||||||
wx2 = (wx2+wx1)/2+1;
|
|
||||||
else
|
|
||||||
wx1 = (wx2+wx1)/2+1;
|
|
||||||
orientation |= 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
if (getrendermode() >= 3 && usemodels && md_tilehasmodel(tilenum,p) >= 0)
|
if (getrendermode() >= 3 && usemodels && md_tilehasmodel(tilenum,p) >= 0)
|
||||||
y += (224-weapsc(224));
|
y += (224-weapsc(224));
|
||||||
#endif
|
#endif
|
||||||
rotatesprite(xadd + weapsc(x<<16) + ((xoff-weapsc(xoff))<<16),
|
rotatesprite(weapsc(x<<16) + ((xoff-weapsc(xoff))<<16),
|
||||||
weapsc(y<<16) + ((200-weapsc(200))<<16),
|
weapsc(y<<16) + ((200-weapsc(200))<<16),
|
||||||
weapsc(65536L),a,tilenum,shade,p,(2|orientation),
|
weapsc(65536L),ang,tilenum,shade,p,(2|orientation),
|
||||||
wx1,windowy1,wx2,windowy2);
|
wx[0],windowy1,wx[1],windowy2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade,
|
static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shade,
|
||||||
|
|
Loading…
Reference in a new issue