Make status bar code polymost friendly

This commit is contained in:
nukeykt 2019-09-01 01:05:11 +09:00 committed by Christoph Oelckers
parent 48b9ca7f7f
commit 0023ae625d
6 changed files with 31 additions and 47 deletions

View file

@ -610,12 +610,8 @@ short nGamma = 0;
short word_CB326;
short screenpage;
short screensize;
short barpages;
short bSnakeCam = kFalse;
short bRecord = kFalse;
short bPlayback = kFalse;
@ -763,8 +759,6 @@ void UpdateScreenSize()
(xdim >> 1) - (screensize >> 1) + screensize - 1,
(y1 + v0 - 1));
screenpage = (short)numpages;
RefreshStatus();
}
@ -2148,6 +2142,7 @@ LOOP3:
if (bMapMode)
{
#if 0
if (bHiRes && nViewBottom > nMaskY)
{
videoSetViewableArea(nViewLeft, nViewTop, nViewRight, nMaskY);
@ -2158,6 +2153,10 @@ LOOP3:
{
DrawMap();
}
#else
// TODO: Map should not be drawn on top of status bar. Redraw status bar?
DrawMap();
#endif
}
videoNextPage();
@ -2750,11 +2749,14 @@ void EraseScreen(int nVal)
nVal = overscanindex;
}
videoClearScreen(nVal);
#if 0
for (int i = 0; i < numpages; i++)
{
videoClearScreen(nVal);
videoNextPage();
}
#endif
}
int Query(short nLines, short nKeys, ...)
@ -2846,7 +2848,6 @@ int Query(short nLines, short nKeys, ...)
{
RefreshStatus();
ClearAllKeys();
bgpages = numpages;
return i;
}
}
@ -2855,7 +2856,6 @@ int Query(short nLines, short nKeys, ...)
RefreshStatus();
ClearAllKeys();
bgpages = numpages;
return i;
}

View file

@ -106,7 +106,6 @@ extern int nNetPlayerCount;
extern int htimer;
extern int nNetTime;
extern short barpages;
extern short nTotalPlayers;
@ -170,8 +169,6 @@ extern int totalmoves;
extern short nGamma;
extern short screenpage;
extern int lCountDown;
extern short bSlipMode;

View file

@ -986,7 +986,7 @@ int menu_NewGameMenu()
int nNameOffset = 0; // char index into slot name string
int nPages = numpages;
//int nPages = numpages;
int arg_3E = tilesiz[kMenuBlankTitleTile].x - 10;
@ -1058,10 +1058,10 @@ int menu_NewGameMenu()
overwritesprite(233, edi + 78, kMenuCursorTile, 0, 10, kPalNormal);
videoNextPage();
nPages--;
if (nPages > 0) {
continue;
}
//nPages--;
//if (nPages > 0) {
// continue;
//}
if (KB_KeyDown[sc_Escape])
{

View file

@ -19,7 +19,7 @@
short nMaskY;
static short nAnimsFree = 0;
short statusmask[1600];
short statusmask[MAXXDIM];
short message_timer = 0;
char message_text[80];
@ -60,7 +60,6 @@ short nItemAltSeq;
short airpages = 0;
short ammodelay = 3;
short ammopages = 4;
short nCounterBullet = -1;
@ -144,8 +143,6 @@ void RefreshStatus()
val += 2;
}
barpages = numpages;
SetPlayerItem(nLocalPlayer, nPlayerItem[nLocalPlayer]);
SetHealthFrame(0);
SetMagicFrame();
@ -365,7 +362,6 @@ void SetCounterDigits()
nDigit[2] = 3 * (nCounter / 100 % 10);
nDigit[1] = 3 * (nCounter / 10 % 10);
nDigit[0] = 3 * (nCounter % 10);
ammopages = numpages;
}
void SetItemSeq()
@ -507,7 +503,6 @@ void MoveStatus()
if (nCounter == nCounterDest)
{
nCounter = nCounterDest;
ammopages = numpages;
ammodelay = 3;
return;
}
@ -519,8 +514,6 @@ void MoveStatus()
}
}
ammopages = numpages;
int eax = nCounterDest - nCounter;
if (eax <= 0)
@ -590,13 +583,16 @@ void MoveStatus()
void UnMaskStatus()
{
#if 0
for (int i = 0; i < xdim; i++) {
startdmost[i] = ydim;
}
#endif
}
void MaskStatus()
{
#if 0
for (int i = 0; i < xdim; i++)
{
short bx = startdmost[i];
@ -606,10 +602,12 @@ void MaskStatus()
startdmost[i] = cx;
}
}
#endif
}
void LoadStatus()
{
#if 0
int i;
short nSize;
short tmp;
@ -651,6 +649,7 @@ void LoadStatus()
nMaskY = ydim - v8;
}
}
#endif
}
void StatusMessage(int messageTime, const char *fmt, ...)
@ -680,12 +679,8 @@ void DrawStatus()
NoClip();
// }
if (barpages > 0)
{
// draw the main bar itself
seq_DrawStatusSequence(nStatusSeqOffset, 0, 0);
barpages--;
}
// draw the main bar itself
seq_DrawStatusSequence(nStatusSeqOffset, 0, 0);
seq_DrawStatusSequence(nStatusSeqOffset + 128, 0, 0);
seq_DrawStatusSequence(nStatusSeqOffset + 127, 0, 0);
@ -728,13 +723,9 @@ void DrawStatus()
printext(xdim - 20, nViewTop, cFPS, kTile159, -1);
}
if (ammopages)
{
ammopages--;
seq_DrawStatusSequence(nStatusSeqOffset + 44, nDigit[2], 0);
seq_DrawStatusSequence(nStatusSeqOffset + 45, nDigit[1], 0);
seq_DrawStatusSequence(nStatusSeqOffset + 46, nDigit[0], 0);
}
seq_DrawStatusSequence(nStatusSeqOffset + 44, nDigit[2], 0);
seq_DrawStatusSequence(nStatusSeqOffset + 45, nDigit[1], 0);
seq_DrawStatusSequence(nStatusSeqOffset + 46, nDigit[0], 0);
// bjd - commenting out this check seems to fix the black status bar at 320x200 resolution
// if (bHiRes) {
@ -837,7 +828,7 @@ void DrawStatus()
sprintf(coordBuf, "X %d", (int)sprite[nSprite].x);
printext(x, nViewTop + 1, coordBuf, kTile159, 255);
sprintf(coordBuf, "Y %d", (int)sprite[nSprite].y);
sprintf(coordBuf, "Y %d", sprite[nSprite].y);
printext(x, nViewTop + 10, coordBuf, kTile159, 255);
}

View file

@ -44,7 +44,6 @@ short nChunkTotal = 0;
short nCameraa;
short nCamerapan;
short nViewTop;
short bgpages = 0;
short bClip = kFalse;
short nViewBottom;
short nViewRight;
@ -215,15 +214,10 @@ void ResetView()
MySetPalette(kenpal);
LoadStatus();
screenpage = (short)numpages;
}
void SetView1()
{
if (screenpage > 0) {
screenpage--;
}
}
void FlushMessageLine()
@ -284,8 +278,6 @@ void MySetView(int x1, int y1, int x2, int y2)
videoSetViewableArea(x1, y1, x2, y2);
nViewy = y1;
barpages = (short)numpages;
bgpages = (short)numpages;
}
// unused function
@ -302,6 +294,7 @@ void DrawView()
int nAngle;
short pan;
#if 0
if (bgpages <= 0)
{
if (textpages > 0)
@ -315,6 +308,10 @@ void DrawView()
RefreshBackground();
bgpages--;
}
#else
FlushMessageLine();
RefreshBackground();
#endif
if (!bFullScreen) {
MaskStatus();

View file

@ -4,7 +4,6 @@
extern short bSubTitles;
extern short nViewTop;
extern short bgpages;
extern short bClip;
extern short nViewBottom;
extern short nViewRight;