mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
colorized OSD text... wastes 32kB memory but in 2008 I don't think anyone really gives half a shit
git-svn-id: https://svn.eduke32.com/eduke32@864 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
564e00a3f2
commit
6374609c4d
6 changed files with 101 additions and 48 deletions
|
@ -34,6 +34,8 @@ const char *stripcolorcodes(const char *t);
|
||||||
int OSD_ParsingScript(void);
|
int OSD_ParsingScript(void);
|
||||||
int OSD_OSDKey(void);
|
int OSD_OSDKey(void);
|
||||||
int OSD_Exec(const char *szScript);
|
int OSD_Exec(const char *szScript);
|
||||||
|
char *OSD_GetTextPtr(void);
|
||||||
|
char *OSD_GetFmtPtr(void);
|
||||||
|
|
||||||
// initializes things
|
// initializes things
|
||||||
void OSD_Init(void);
|
void OSD_Init(void);
|
||||||
|
@ -99,5 +101,19 @@ int OSD_Dispatch(const char *cmd);
|
||||||
// func = the entry point to the function
|
// func = the entry point to the function
|
||||||
int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const osdfuncparm_t*));
|
int OSD_RegisterFunction(const char *name, const char *help, int (*func)(const osdfuncparm_t*));
|
||||||
|
|
||||||
|
// these correspond to the Duke palettes, so they shouldn't really be here
|
||||||
|
// ...but I don't care
|
||||||
|
|
||||||
|
#define OSDTEXT_BLUE "^00"
|
||||||
|
#define OSDTEXT_DARKRED "^10"
|
||||||
|
#define OSDTEXT_GREEN "^11"
|
||||||
|
#define OSDTEXT_GRAY "^12"
|
||||||
|
#define OSDTEXT_DARKGRAY "^13"
|
||||||
|
#define OSDTEXT_DARKGREEN "^14"
|
||||||
|
#define OSDTEXT_BROWN "^15"
|
||||||
|
#define OSDTEXT_DARKBLUE "^16"
|
||||||
|
#define OSDTEXT_RED "^21"
|
||||||
|
#define OSDTEXT_YELLOW "^23"
|
||||||
|
|
||||||
#endif // __osd_h__
|
#endif // __osd_h__
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ static void _internal_onshowosd(int);
|
||||||
|
|
||||||
// history display
|
// history display
|
||||||
static char osdtext[TEXTSIZE];
|
static char osdtext[TEXTSIZE];
|
||||||
|
static char osdfmt[TEXTSIZE];
|
||||||
static char osdversionstring[32];
|
static char osdversionstring[32];
|
||||||
static int osdversionstringlen;
|
static int osdversionstringlen;
|
||||||
static int osdversionstringshade;
|
static int osdversionstringshade;
|
||||||
|
@ -494,6 +495,7 @@ static int _internal_osdfunc_clear(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(parm);
|
UNREFERENCED_PARAMETER(parm);
|
||||||
Bmemset(osdtext,0,sizeof(osdtext));
|
Bmemset(osdtext,0,sizeof(osdtext));
|
||||||
|
Bmemset(osdfmt,osdtextpal,sizeof(osdfmt));
|
||||||
osdlines = 1;
|
osdlines = 1;
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
@ -538,6 +540,7 @@ void OSD_Cleanup(void)
|
||||||
void OSD_Init(void)
|
void OSD_Init(void)
|
||||||
{
|
{
|
||||||
Bmemset(osdtext, 32, TEXTSIZE);
|
Bmemset(osdtext, 32, TEXTSIZE);
|
||||||
|
Bmemset(osdfmt, osdtextpal, TEXTSIZE);
|
||||||
osdlines=1;
|
osdlines=1;
|
||||||
|
|
||||||
osdinited=1;
|
osdinited=1;
|
||||||
|
@ -803,7 +806,7 @@ int OSD_HandleChar(char ch)
|
||||||
lastmatch = symb;
|
lastmatch = symb;
|
||||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||||
}
|
}
|
||||||
OSD_Printf("Found %d possible completions for '%s':\n",num,osdedittmp);
|
OSD_Printf(OSDTEXT_GREEN "Found %d possible completions for '%s':\n",num,osdedittmp);
|
||||||
maxwidth += 3;
|
maxwidth += 3;
|
||||||
symb = tabc;
|
symb = tabc;
|
||||||
OSD_Printf(" ");
|
OSD_Printf(" ");
|
||||||
|
@ -858,6 +861,7 @@ int OSD_HandleChar(char ch)
|
||||||
else if (ch == 12) // control l, clear screen
|
else if (ch == 12) // control l, clear screen
|
||||||
{
|
{
|
||||||
Bmemset(osdtext,0,sizeof(osdtext));
|
Bmemset(osdtext,0,sizeof(osdtext));
|
||||||
|
Bmemset(osdfmt,osdtextpal,sizeof(osdfmt));
|
||||||
osdlines = 1;
|
osdlines = 1;
|
||||||
}
|
}
|
||||||
else if (ch == 13) // control m, enter
|
else if (ch == 13) // control m, enter
|
||||||
|
@ -1140,6 +1144,7 @@ void OSD_ResizeDisplay(int w, int h)
|
||||||
int newcols;
|
int newcols;
|
||||||
int newmaxlines;
|
int newmaxlines;
|
||||||
char newtext[TEXTSIZE];
|
char newtext[TEXTSIZE];
|
||||||
|
char newfmt[TEXTSIZE];
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
|
|
||||||
newcols = getcolumnwidth(w);
|
newcols = getcolumnwidth(w);
|
||||||
|
@ -1152,9 +1157,11 @@ void OSD_ResizeDisplay(int w, int h)
|
||||||
for (i=0;i<j;i++)
|
for (i=0;i<j;i++)
|
||||||
{
|
{
|
||||||
memcpy(newtext+newcols*i, osdtext+osdcols*i, k);
|
memcpy(newtext+newcols*i, osdtext+osdcols*i, k);
|
||||||
|
memcpy(newfmt+newcols*i, osdfmt+osdcols*i, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(osdtext, newtext, TEXTSIZE);
|
memcpy(osdtext, newtext, TEXTSIZE);
|
||||||
|
memcpy(osdfmt, newfmt, TEXTSIZE);
|
||||||
osdcols = newcols;
|
osdcols = newcols;
|
||||||
osdmaxlines = newmaxlines;
|
osdmaxlines = newmaxlines;
|
||||||
osdmaxrows = getrowheight(h)-2;
|
osdmaxrows = getrowheight(h)-2;
|
||||||
|
@ -1281,13 +1288,14 @@ static inline void linefeed(void)
|
||||||
{
|
{
|
||||||
Bmemmove(osdtext+osdcols, osdtext, TEXTSIZE-osdcols);
|
Bmemmove(osdtext+osdcols, osdtext, TEXTSIZE-osdcols);
|
||||||
Bmemset(osdtext, 32, osdcols);
|
Bmemset(osdtext, 32, osdcols);
|
||||||
|
Bmemmove(osdfmt+osdcols, osdfmt, TEXTSIZE-osdcols);
|
||||||
|
Bmemset(osdfmt, osdtextpal, osdcols);
|
||||||
if (osdlines < osdmaxlines) osdlines++;
|
if (osdlines < osdmaxlines) osdlines++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSD_Printf(const char *fmt, ...)
|
void OSD_Printf(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char tmpstr[1024], *chp;
|
char tmpstr[1024], *chp, p=osdtextpal;
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
if (!osdinited) OSD_Init();
|
if (!osdinited) OSD_Init();
|
||||||
|
@ -1299,7 +1307,7 @@ void OSD_Printf(const char *fmt, ...)
|
||||||
if (linecnt<logcutoff)
|
if (linecnt<logcutoff)
|
||||||
{
|
{
|
||||||
if (osdlog&&(!logcutoff||linecnt<logcutoff))
|
if (osdlog&&(!logcutoff||linecnt<logcutoff))
|
||||||
Bfputs(tmpstr, osdlog);
|
Bfputs(stripcolorcodes(tmpstr), osdlog);
|
||||||
}
|
}
|
||||||
else if (linecnt==logcutoff)
|
else if (linecnt==logcutoff)
|
||||||
{
|
{
|
||||||
|
@ -1310,7 +1318,25 @@ void OSD_Printf(const char *fmt, ...)
|
||||||
|
|
||||||
for (chp = tmpstr; *chp; chp++)
|
for (chp = tmpstr; *chp; chp++)
|
||||||
{
|
{
|
||||||
if (*chp == '\r') osdpos=0;
|
if (*chp == '^' && isdigit(*(chp+1)))
|
||||||
|
{
|
||||||
|
char smallbuf[4];
|
||||||
|
chp++;
|
||||||
|
if (isdigit(*(chp+1)))
|
||||||
|
{
|
||||||
|
smallbuf[0] = *(chp++);
|
||||||
|
smallbuf[1] = *(chp);
|
||||||
|
smallbuf[2] = '\0';
|
||||||
|
p = atol(smallbuf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
smallbuf[0] = *(chp);
|
||||||
|
smallbuf[1] = '\0';
|
||||||
|
p = atol(smallbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*chp == '\r') osdpos=0;
|
||||||
else if (*chp == '\n')
|
else if (*chp == '\n')
|
||||||
{
|
{
|
||||||
osdpos=0;
|
osdpos=0;
|
||||||
|
@ -1319,7 +1345,8 @@ void OSD_Printf(const char *fmt, ...)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
osdtext[osdpos++] = *chp;
|
osdtext[osdpos] = *chp;
|
||||||
|
osdfmt[osdpos++] = p;
|
||||||
if (osdpos == osdcols)
|
if (osdpos == osdcols)
|
||||||
{
|
{
|
||||||
osdpos = 0;
|
osdpos = 0;
|
||||||
|
@ -1614,6 +1641,16 @@ int OSD_OSDKey(void)
|
||||||
return osdkey;
|
return osdkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *OSD_GetTextPtr(void)
|
||||||
|
{
|
||||||
|
return (&osdtext[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *OSD_GetFmtPtr(void)
|
||||||
|
{
|
||||||
|
return (&osdfmt[0]);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// addnewsymbol() -- Allocates space for a new symbol and attaches it
|
// addnewsymbol() -- Allocates space for a new symbol and attaches it
|
||||||
// appropriately to the lists, sorted.
|
// appropriately to the lists, sorted.
|
||||||
|
|
|
@ -464,7 +464,7 @@ void adduserquote(const char *daquote)
|
||||||
user_quote_time[i] = user_quote_time[i-1];
|
user_quote_time[i] = user_quote_time[i-1];
|
||||||
}
|
}
|
||||||
Bstrcpy(user_quote[0],daquote);
|
Bstrcpy(user_quote[0],daquote);
|
||||||
OSD_Printf("%s\n",stripcolorcodes(daquote));
|
OSD_Printf("%s\n",daquote);
|
||||||
|
|
||||||
user_quote_time[0] = ud.msgdisptime;
|
user_quote_time[0] = ud.msgdisptime;
|
||||||
pub = NUMPAGES;
|
pub = NUMPAGES;
|
||||||
|
@ -487,7 +487,7 @@ void getpackets(void)
|
||||||
{
|
{
|
||||||
if (setgamemode(!ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP))
|
if (setgamemode(!ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP))
|
||||||
{
|
{
|
||||||
OSD_Printf("Failed setting fullscreen video mode.\n");
|
OSD_Printf(OSDTEXT_DARKRED "Failed setting fullscreen video mode.\n");
|
||||||
if (setgamemode(ud.config.ScreenMode, ud.config.ScreenWidth, ud.config.ScreenHeight, ud.config.ScreenBPP))
|
if (setgamemode(ud.config.ScreenMode, ud.config.ScreenWidth, ud.config.ScreenHeight, ud.config.ScreenBPP))
|
||||||
gameexit("Failed to recover from failure to set fullscreen video mode.\n");
|
gameexit("Failed to recover from failure to set fullscreen video mode.\n");
|
||||||
}
|
}
|
||||||
|
@ -2426,7 +2426,7 @@ static void operatefta(void)
|
||||||
|
|
||||||
if (fta_quotes[g_player[screenpeek].ps->ftq] == NULL)
|
if (fta_quotes[g_player[screenpeek].ps->ftq] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps->ftq);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps->ftq);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2473,7 +2473,7 @@ void FTA(int q,player_struct *p)
|
||||||
{
|
{
|
||||||
if (fta_quotes[p->ftq] == NULL)
|
if (fta_quotes[p->ftq] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,p->ftq);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,p->ftq);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2490,7 +2490,7 @@ void FTA(int q,player_struct *p)
|
||||||
{
|
{
|
||||||
if (p->ftq != q)
|
if (p->ftq != q)
|
||||||
if (p == g_player[screenpeek].ps)
|
if (p == g_player[screenpeek].ps)
|
||||||
OSD_Printf("%s\n",stripcolorcodes(fta_quotes[q]));
|
OSD_Printf(OSDTEXT_BLUE "%s\n",stripcolorcodes(fta_quotes[q]));
|
||||||
|
|
||||||
p->ftq = q;
|
p->ftq = q;
|
||||||
pub = NUMPAGES;
|
pub = NUMPAGES;
|
||||||
|
@ -5324,7 +5324,7 @@ int spawn(int j, int pn)
|
||||||
if (sp->hitag && sp->picnum == WATERBUBBLEMAKER)
|
if (sp->hitag && sp->picnum == WATERBUBBLEMAKER)
|
||||||
{
|
{
|
||||||
// JBF 20030913: Pisses off move(), eg. in bobsp2
|
// JBF 20030913: Pisses off move(), eg. in bobsp2
|
||||||
OSD_Printf("WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
OSD_Printf(OSDTEXT_DARKRED "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n",
|
||||||
i,sp->x,sp->y);
|
i,sp->x,sp->y);
|
||||||
sp->hitag = 0;
|
sp->hitag = 0;
|
||||||
}
|
}
|
||||||
|
@ -10139,6 +10139,7 @@ void app_main(int argc,const char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSD_SetLogFile("eduke32.log");
|
OSD_SetLogFile("eduke32.log");
|
||||||
|
OSD_SetParameters(10,0, 0,12, 4,12);
|
||||||
|
|
||||||
wm_setapptitle(HEAD2);
|
wm_setapptitle(HEAD2);
|
||||||
|
|
||||||
|
|
|
@ -878,7 +878,7 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||||
if (proj < 0 || proj >= MAXSPRITES)
|
if (proj < 0 || proj >= MAXSPRITES)
|
||||||
{
|
{
|
||||||
// OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj);
|
// OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj);
|
||||||
OSD_Printf("DoThisProjectile(): tried to %s %s on invalid target projectile (%d) %d %d from %s\n",
|
OSD_Printf(OSDTEXT_DARKRED "DoThisProjectile(): tried to %s %s on invalid target projectile (%d) %d %d from %s\n",
|
||||||
iSet?"set":"get",projectilelabels[lLabelID].name,proj,g_i,g_sp->picnum,
|
iSet?"set":"get",projectilelabels[lLabelID].name,proj,g_i,g_sp->picnum,
|
||||||
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
|
@ -1159,7 +1159,7 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
||||||
if (iPlayer<0 || iPlayer >= ud.multimode)
|
if (iPlayer<0 || iPlayer >= ud.multimode)
|
||||||
{
|
{
|
||||||
// OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i);
|
// OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i);
|
||||||
OSD_Printf("DoPlayer(): tried to %s %s on invalid target player (%d) %d from %s\n",
|
OSD_Printf(OSDTEXT_DARKRED "DoPlayer(): tried to %s %s on invalid target player (%d) %d from %s\n",
|
||||||
iSet?"set":"get",actorlabels[lLabelID].name,iPlayer,g_i,
|
iSet?"set":"get",actorlabels[lLabelID].name,iPlayer,g_i,
|
||||||
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
|
@ -2506,7 +2506,7 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||||
if (iPlayer<0 || iPlayer >= ud.multimode)
|
if (iPlayer<0 || iPlayer >= ud.multimode)
|
||||||
{
|
{
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
OSD_Printf("DoInput(): invalid target player (%d) %d\n",iPlayer,g_i);
|
OSD_Printf(OSDTEXT_DARKRED "DoInput(): invalid target player (%d) %d\n",iPlayer,g_i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2988,7 +2988,7 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
|
||||||
|
|
||||||
if (iActor < 0 || iActor >= MAXSPRITES)
|
if (iActor < 0 || iActor >= MAXSPRITES)
|
||||||
{
|
{
|
||||||
OSD_Printf("DoActor(): tried to %s %s on invalid target sprite (%d) %d %d from %s\n",
|
OSD_Printf(OSDTEXT_DARKRED "DoActor(): tried to %s %s on invalid target sprite (%d) %d %d from %s\n",
|
||||||
iSet?"set":"get",actorlabels[lLabelID].name,iActor,g_i,g_sp->picnum,
|
iSet?"set":"get",actorlabels[lLabelID].name,iActor,g_i,g_sp->picnum,
|
||||||
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
|
@ -3466,7 +3466,7 @@ static void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||||
|
|
||||||
if (iActor < 0 || iActor >= MAXSPRITES)
|
if (iActor < 0 || iActor >= MAXSPRITES)
|
||||||
{
|
{
|
||||||
OSD_Printf("DoTsprite(): invalid target sprite (%d) %d %d\n",iActor,g_i,g_sp->picnum);
|
OSD_Printf(OSDTEXT_DARKRED "DoTsprite(): invalid target sprite (%d) %d %d\n",iActor,g_i,g_sp->picnum);
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3607,7 +3607,7 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
|
||||||
|
|
||||||
if (lVar1 < 0 || lVar1 >= MAXTILES)
|
if (lVar1 < 0 || lVar1 >= MAXTILES)
|
||||||
{
|
{
|
||||||
OSD_Printf("DoProjectile(): invalid tile (%d)\n",lVar1);
|
OSD_Printf(OSDTEXT_DARKRED "DoProjectile(): invalid tile (%d)\n",lVar1);
|
||||||
insptr += (lVar2 == MAXGAMEVARS);
|
insptr += (lVar2 == MAXGAMEVARS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3878,7 +3878,7 @@ void OnEvent(int iEventID, int iActor, int iPlayer, int lDist)
|
||||||
{
|
{
|
||||||
if (iEventID >= MAXGAMEEVENTS)
|
if (iEventID >= MAXGAMEEVENTS)
|
||||||
{
|
{
|
||||||
OSD_Printf("OnEvent(): invalid event ID");
|
OSD_Printf(OSDTEXT_DARKRED "OnEvent(): invalid event ID");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4471,7 +4471,7 @@ static int parse(void)
|
||||||
int q = *insptr++, i = *insptr++;
|
int q = *insptr++, i = *insptr++;
|
||||||
if (fta_quotes[q] == NULL || redefined_quotes[i] == NULL)
|
if (fta_quotes[q] == NULL || redefined_quotes[i] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d %d\n",__FILE__,__LINE__,q,i);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d %d\n",__FILE__,__LINE__,q,i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Bstrcpy(fta_quotes[q],redefined_quotes[i]);
|
Bstrcpy(fta_quotes[q],redefined_quotes[i]);
|
||||||
|
@ -5293,7 +5293,7 @@ static int parse(void)
|
||||||
Bstrcpy(fta_quotes[i],g_player[j].user_name);
|
Bstrcpy(fta_quotes[i],g_player[j].user_name);
|
||||||
else Bsprintf(fta_quotes[i],"%d",j);
|
else Bsprintf(fta_quotes[i],"%d",j);
|
||||||
}
|
}
|
||||||
else OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,i);
|
else OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,i);
|
||||||
break;
|
break;
|
||||||
case CON_QGETSYSSTR:
|
case CON_QGETSYSSTR:
|
||||||
if (fta_quotes[i] != NULL)
|
if (fta_quotes[i] != NULL)
|
||||||
|
@ -5315,19 +5315,19 @@ static int parse(void)
|
||||||
Bstrcpy(fta_quotes[i],gametype_names[ud.coop]);
|
Bstrcpy(fta_quotes[i],gametype_names[ud.coop]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
OSD_Printf("%s %d unknown str ID %d %d\n",__FILE__,__LINE__,i,j);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d unknown str ID %d %d\n",__FILE__,__LINE__,i,j);
|
||||||
}
|
}
|
||||||
else OSD_Printf("%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
else OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
||||||
break;
|
break;
|
||||||
case CON_QSTRCAT:
|
case CON_QSTRCAT:
|
||||||
if (fta_quotes[i] != NULL && fta_quotes[j] != NULL)
|
if (fta_quotes[i] != NULL && fta_quotes[j] != NULL)
|
||||||
Bstrncat(fta_quotes[i],fta_quotes[j],(MAXQUOTELEN-1)-Bstrlen(fta_quotes[i]));
|
Bstrncat(fta_quotes[i],fta_quotes[j],(MAXQUOTELEN-1)-Bstrlen(fta_quotes[i]));
|
||||||
else OSD_Printf("%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
else OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
||||||
break;
|
break;
|
||||||
case CON_QSTRCPY:
|
case CON_QSTRCPY:
|
||||||
if (fta_quotes[i] != NULL && fta_quotes[j] != NULL)
|
if (fta_quotes[i] != NULL && fta_quotes[j] != NULL)
|
||||||
Bstrcpy(fta_quotes[i],fta_quotes[j]);
|
Bstrcpy(fta_quotes[i],fta_quotes[j]);
|
||||||
else OSD_Printf("%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
else OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d %d\n",__FILE__,__LINE__,i,j);
|
||||||
break;
|
break;
|
||||||
case CON_CHANGESPRITESTAT:
|
case CON_CHANGESPRITESTAT:
|
||||||
changespritestat(i,j);
|
changespritestat(i,j);
|
||||||
|
@ -5347,13 +5347,13 @@ static int parse(void)
|
||||||
|
|
||||||
if (volnume > MAXVOLUMES-1 || volnume < 0)
|
if (volnume > MAXVOLUMES-1 || volnume < 0)
|
||||||
{
|
{
|
||||||
OSD_Printf("parse():CON_STARTLEVEL: invalid volume (%d)\n",volnume);
|
OSD_Printf(OSDTEXT_DARKRED "CON_STARTLEVEL: invalid volume (%d)\n",volnume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levnume > MAXLEVELS-1 || levnume < 0)
|
if (levnume > MAXLEVELS-1 || levnume < 0)
|
||||||
{
|
{
|
||||||
OSD_Printf("parse():CON_STARTLEVEL: invalid level (%d)\n",levnume);
|
OSD_Printf(OSDTEXT_DARKRED "CON_STARTLEVEL: invalid level (%d)\n",levnume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5512,7 +5512,7 @@ static int parse(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else OSD_Printf("error: invalid sprite\n");
|
else OSD_Printf(OSDTEXT_DARKRED "CON_DIST/CON_LDIST: error: invalid sprite\n");
|
||||||
|
|
||||||
SetGameVarID(distvar, distx, g_i, g_p);
|
SetGameVarID(distvar, distx, g_i, g_p);
|
||||||
break;
|
break;
|
||||||
|
@ -5849,7 +5849,7 @@ static int parse(void)
|
||||||
int z=65536;
|
int z=65536;
|
||||||
if (fta_quotes[q] == NULL)
|
if (fta_quotes[q] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,q);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,q);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (tw == CON_GAMETEXTZ)z=GetGameVarID(*insptr++,g_i,g_p);
|
if (tw == CON_GAMETEXTZ)z=GetGameVarID(*insptr++,g_i,g_p);
|
||||||
|
@ -5863,7 +5863,7 @@ static int parse(void)
|
||||||
|
|
||||||
if (fta_quotes[q] == NULL)
|
if (fta_quotes[q] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,q);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,q);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
minitextshade(x,y,fta_quotes[q],shade,pal,26);
|
minitextshade(x,y,fta_quotes[q],shade,pal,26);
|
||||||
|
@ -6420,8 +6420,7 @@ static int parse(void)
|
||||||
case CON_CLEARMAPSTATE:
|
case CON_CLEARMAPSTATE:
|
||||||
if (map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate)
|
if (map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate)
|
||||||
{
|
{
|
||||||
Bfree(map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate);
|
FreeMapState(ud.volume_number*MAXLEVELS+ud.level_number);
|
||||||
map[ud.volume_number*MAXLEVELS+ud.level_number].savedstate = NULL;
|
|
||||||
}
|
}
|
||||||
insptr++;
|
insptr++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -6530,8 +6529,8 @@ static int parse(void)
|
||||||
Bsprintf(fta_quotes[dq],tempbuf,var1,var2,var3,var4);
|
Bsprintf(fta_quotes[dq],tempbuf,var1,var2,var3,var4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (fta_quotes[sq] == NULL) OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,sq);
|
if (fta_quotes[sq] == NULL) OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,sq);
|
||||||
if (fta_quotes[dq] == NULL) OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,dq);
|
if (fta_quotes[dq] == NULL) OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,dq);
|
||||||
insptr += 4;
|
insptr += 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6539,7 +6538,7 @@ static int parse(void)
|
||||||
case CON_ADDLOG:
|
case CON_ADDLOG:
|
||||||
{
|
{
|
||||||
insptr++;
|
insptr++;
|
||||||
OSD_Printf("CONLOG: L=%d\n",*insptr++);
|
OSD_Printf(OSDTEXT_GREEN "CONLOG: L=%d\n",*insptr++);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6572,12 +6571,12 @@ static int parse(void)
|
||||||
index=GetGameVarID(*insptr++,g_i,g_p);
|
index=GetGameVarID(*insptr++,g_i,g_p);
|
||||||
if ((index < aGameArrays[lVarID].size)&&(index>=0))
|
if ((index < aGameArrays[lVarID].size)&&(index>=0))
|
||||||
{
|
{
|
||||||
OSD_Printf("CONLOGVAR: L=%d %s[%d] =%d\n",l, aGameArrays[lVarID].szLabel,index,m*aGameArrays[lVarID].plValues[index]);
|
OSD_Printf(OSDTEXT_GREEN "CONLOGVAR: L=%d %s[%d] =%d\n",l, aGameArrays[lVarID].szLabel,index,m*aGameArrays[lVarID].plValues[index]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSD_Printf("CONLOGVAR: L=%d INVALID ARRAY INDEX\n",l);
|
OSD_Printf(OSDTEXT_DARKRED "CONLOGVAR: L=%d INVALID ARRAY INDEX\n",l);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6590,7 +6589,7 @@ static int parse(void)
|
||||||
{
|
{
|
||||||
// invalid varID
|
// invalid varID
|
||||||
insptr++;
|
insptr++;
|
||||||
OSD_Printf("CONLOGVAR: L=%d INVALID VARIABLE\n",l);
|
OSD_Printf(OSDTEXT_DARKRED "CONLOGVAR: L=%d INVALID VARIABLE\n",l);
|
||||||
break; // out of switch
|
break; // out of switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6617,7 +6616,7 @@ static int parse(void)
|
||||||
Bstrcat(g_szBuf,szBuf);
|
Bstrcat(g_szBuf,szBuf);
|
||||||
Bsprintf(szBuf," =%d\n", GetGameVarID(lVarID, g_i, g_p)*m);
|
Bsprintf(szBuf," =%d\n", GetGameVarID(lVarID, g_i, g_p)*m);
|
||||||
Bstrcat(g_szBuf,szBuf);
|
Bstrcat(g_szBuf,szBuf);
|
||||||
OSD_Printf(g_szBuf);
|
OSD_Printf(OSDTEXT_GREEN "%s",g_szBuf);
|
||||||
insptr++;
|
insptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7043,7 +7042,7 @@ static int parse(void)
|
||||||
int asize = GetGameVarID(*insptr++, g_i, g_p);
|
int asize = GetGameVarID(*insptr++, g_i, g_p);
|
||||||
if (asize > 0)
|
if (asize > 0)
|
||||||
{
|
{
|
||||||
OSD_Printf("resizing array %s, old size %d new size %d\n", aGameArrays[j].szLabel, aGameArrays[j].size, asize);
|
OSD_Printf(OSDTEXT_GREEN "resizing array %s, old size %d new size %d\n", aGameArrays[j].szLabel, aGameArrays[j].size, asize);
|
||||||
aGameArrays[j].plValues=Brealloc(aGameArrays[j].plValues, sizeof(int) * asize);
|
aGameArrays[j].plValues=Brealloc(aGameArrays[j].plValues, sizeof(int) * asize);
|
||||||
aGameArrays[j].size = asize;
|
aGameArrays[j].size = asize;
|
||||||
}
|
}
|
||||||
|
@ -7476,14 +7475,14 @@ static int parse(void)
|
||||||
|
|
||||||
if (fta_quotes[*insptr] == NULL)
|
if (fta_quotes[*insptr] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,*insptr);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,*insptr);
|
||||||
insptr++;
|
insptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_p < 0 || g_p >= MAXPLAYERS)
|
if (g_p < 0 || g_p >= MAXPLAYERS)
|
||||||
{
|
{
|
||||||
OSD_Printf("CON_QUOTE: bad player for quote %d: (%d)\n",*insptr,g_p);
|
OSD_Printf(OSDTEXT_DARKRED "CON_QUOTE: bad player for quote %d: (%d)\n",*insptr,g_p);
|
||||||
insptr++;
|
insptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7498,7 +7497,7 @@ static int parse(void)
|
||||||
|
|
||||||
if (fta_quotes[i] == NULL)
|
if (fta_quotes[i] == NULL)
|
||||||
{
|
{
|
||||||
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,i);
|
OSD_Printf(OSDTEXT_DARKRED "%s %d null quote %d\n",__FILE__,__LINE__,i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
adduserquote(fta_quotes[i]);
|
adduserquote(fta_quotes[i]);
|
||||||
|
|
|
@ -51,7 +51,7 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
|
||||||
ac = *ch-'!'+STARTALPHANUM;
|
ac = *ch-'!'+STARTALPHANUM;
|
||||||
if (ac < STARTALPHANUM || ac > ENDALPHANUM) return;
|
if (ac < STARTALPHANUM || ac > ENDALPHANUM) return;
|
||||||
|
|
||||||
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, shade, pal, 8|16, 0, 0, xdim-1, ydim-1);
|
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, shade, *(ch-OSD_GetTextPtr()+OSD_GetFmtPtr()), 8|16, 0, 0, xdim-1, ydim-1);
|
||||||
/* if (*ch >= '0' && *ch <= '9') x+=8;
|
/* if (*ch >= '0' && *ch <= '9') x+=8;
|
||||||
else x += tilesizx[ac]; */
|
else x += tilesizx[ac]; */
|
||||||
x += OSDCHAR_WIDTH;
|
x += OSDCHAR_WIDTH;
|
||||||
|
|
|
@ -1298,7 +1298,7 @@ int getteampal(int team)
|
||||||
static void resetpspritevars(char g)
|
static void resetpspritevars(char g)
|
||||||
{
|
{
|
||||||
short i, j, nexti,circ;
|
short i, j, nexti,circ;
|
||||||
int firstx,firsty;
|
// int firstx,firsty;
|
||||||
spritetype *s;
|
spritetype *s;
|
||||||
char aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS];
|
char aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS];
|
||||||
STATUSBARTYPE tsbar[MAXPLAYERS];
|
STATUSBARTYPE tsbar[MAXPLAYERS];
|
||||||
|
@ -1379,11 +1379,11 @@ static void resetpspritevars(char g)
|
||||||
if (numplayersprites == MAXPLAYERS)
|
if (numplayersprites == MAXPLAYERS)
|
||||||
gameexit("\nToo many player sprites (max 16.)");
|
gameexit("\nToo many player sprites (max 16.)");
|
||||||
|
|
||||||
if (numplayersprites == 0)
|
/* if (numplayersprites == 0)
|
||||||
{
|
{
|
||||||
firstx = g_player[0].ps->posx;
|
firstx = g_player[0].ps->posx;
|
||||||
firsty = g_player[0].ps->posy;
|
firsty = g_player[0].ps->posy;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
g_PlayerSpawnPoints[(unsigned char)numplayersprites].ox = s->x;
|
g_PlayerSpawnPoints[(unsigned char)numplayersprites].ox = s->x;
|
||||||
g_PlayerSpawnPoints[(unsigned char)numplayersprites].oy = s->y;
|
g_PlayerSpawnPoints[(unsigned char)numplayersprites].oy = s->y;
|
||||||
|
@ -1858,7 +1858,7 @@ int enterlevel(int g)
|
||||||
// variables are set by pointer...
|
// variables are set by pointer...
|
||||||
|
|
||||||
OnEvent(EVENT_ENTERLEVEL, -1, -1, -1);
|
OnEvent(EVENT_ENTERLEVEL, -1, -1, -1);
|
||||||
initprintf("E%dL%d: %s\n",ud.volume_number+1,ud.level_number+1,map[(ud.volume_number*MAXLEVELS)+ud.level_number].name);
|
initprintf("^21E%dL%d: %s\n",ud.volume_number+1,ud.level_number+1,map[(ud.volume_number*MAXLEVELS)+ud.level_number].name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue