Fake multi: fix display of item percentage and on/off states.

git-svn-id: https://svn.eduke32.com/eduke32@2935 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-19 13:02:37 +00:00
parent 5e6642df2a
commit dc3a523eed
4 changed files with 18 additions and 13 deletions

View file

@ -150,8 +150,12 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t),
// max x/y val (= max editorgridextent in Mapster32) // max x/y val (= max editorgridextent in Mapster32)
#define BXY_MAX 524288 #define BXY_MAX 524288
// ROTATESPRITE_MAX-1 is the mask of all externally available orientation bits enum {
#define ROTATESPRITE_MAX 2048 // ROTATESPRITE_MAX-1 is the mask of all externally available orientation bits
ROTATESPRITE_MAX = 2048,
RS_CENTERORIGIN = (1<<30),
};
//Make all variables in BUILD.H defined in the ENGINE, //Make all variables in BUILD.H defined in the ENGINE,
//and externed in GAME //and externed in GAME

View file

@ -6918,7 +6918,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
else if ((dastat & 256) == 0) else if ((dastat & 256) == 0)
sx += (oxdim-xdim)<<15; sx += (oxdim-xdim)<<15;
if (dastat&(1<<29)) if (dastat&RS_CENTERORIGIN)
sx += oxdim<<15; sx += oxdim<<15;
zoomsc = scale(xdim, ouryxaspect, 320); zoomsc = scale(xdim, ouryxaspect, 320);
@ -13635,7 +13635,7 @@ void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
if ((tilesizx[picnum] <= 0) || (tilesizy[picnum] <= 0)) return; if ((tilesizx[picnum] <= 0) || (tilesizy[picnum] <= 0)) return;
// Experimental / development bits. ONLY FOR INTERNAL USE! // Experimental / development bits. ONLY FOR INTERNAL USE!
// bit (1<<29): see dorotspr_handle_bit2 // bit RS_CENTERORIGIN: see dorotspr_handle_bit2
//////////////////// ////////////////////
if (((dastat&128) == 0) || (numpages < 2) || (beforedrawrooms != 0)) if (((dastat&128) == 0) || (numpages < 2) || (beforedrawrooms != 0))

View file

@ -493,7 +493,7 @@ int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t
char ch, cmode; char ch, cmode;
cmode = (sb&ROTATESPRITE_MAX)!=0; cmode = (sb&ROTATESPRITE_MAX)!=0;
sb &= ROTATESPRITE_MAX-1; sb &= (ROTATESPRITE_MAX-1)|RS_CENTERORIGIN;
if (t == NULL) if (t == NULL)
{ {
@ -1335,16 +1335,17 @@ 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); int32_t orient = 2+8+16+256 + (g_fakeMultiMode && snum==1)*RS_CENTERORIGIN;
rotatesprite_fs(sbarx(5),sbary(200-28),sb16,0,HEALTHBOX,0,21,orient); rotatesprite_fs(sbarx(5),sbary(200-28),sb16,0,HEALTHBOX,0,21,orient);
if (p->inven_icon) if (p->inven_icon)
rotatesprite_fs(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 {
G_DrawDigiNum(20,200-17,1,-16,orient); int32_t health = (sprite[p->i].pal == 1 && p->last_extra < 2) ? 1 : p->last_extra;
else G_DrawDigiNum(20,200-17,p->last_extra,-16,orient); G_DrawDigiNum(20, 200-17, health, -16, orient);
}
rotatesprite_fs(sbarx(37),sbary(200-28),sb16,0,AMMOBOX,0,21,orient); rotatesprite_fs(sbarx(37),sbary(200-28),sb16,0,AMMOBOX,0,21,orient);
@ -1356,14 +1357,14 @@ static void G_DrawStatusBar(int32_t snum)
permbit = 0; permbit = 0;
if (p->inven_icon) if (p->inven_icon)
{ {
// orient += permbit; // orient |= permbit;
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(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) // scale by status bar size
orient |= ROTATESPRITE_MAX; orient |= ROTATESPRITE_MAX;
minitext(292-30-o,190,"%",6, orient); minitext(292-30-o,190,"%",6, orient);

View file

@ -2598,7 +2598,7 @@ nullquote:
OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],q); OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],q);
continue; continue;
} }
minitextshade(x,y,ScriptQuotes[q],shade,pal,26); minitextshade(x,y,ScriptQuotes[q],shade,pal, 2+8+16);
continue; continue;
} }