mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 02:30:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@843 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e67f7bd94a
commit
01449fc547
5 changed files with 23 additions and 12 deletions
|
@ -31,9 +31,8 @@ const char *stripcolorcodes(const char *t);
|
|||
#define OSDCMD_OK 0
|
||||
#define OSDCMD_SHOWHELP 1
|
||||
|
||||
extern int osdexecscript;
|
||||
extern int osdkey;
|
||||
|
||||
int OSD_ParsingScript(void);
|
||||
int OSD_OSDKey(void);
|
||||
int OSD_Exec(const char *szScript);
|
||||
|
||||
// initializes things
|
||||
|
|
|
@ -52,7 +52,7 @@ static char osdinput=0; // capture input?
|
|||
static int osdhead=0; // topmost visible line number
|
||||
static BFILE *osdlog=NULL; // log filehandle
|
||||
static char osdinited=0; // text buffer initialized?
|
||||
int osdkey=0x29; // tilde shows the osd
|
||||
static int osdkey=0x29; // tilde shows the osd
|
||||
static int keytime=0;
|
||||
static int osdscrtime = 0;
|
||||
|
||||
|
@ -75,15 +75,16 @@ static int osdeditwinend=60-1-3;
|
|||
static int osdhistorypos=-1; // position we are at in the history buffer
|
||||
static char osdhistorybuf[HISTORYDEPTH][EDITLENGTH+1]; // history strings
|
||||
static int osdhistorysize=0; // number of entries in history
|
||||
static int osdhistorytotal=0; // number of total history entries
|
||||
|
||||
// execution buffer
|
||||
// the execution buffer works from the command history
|
||||
static int osdexeccount=0; // number of lines from the head of the history buffer to execute
|
||||
|
||||
// maximal log line count
|
||||
int logcutoff=120000;
|
||||
int linecnt;
|
||||
int osdexecscript=0;
|
||||
static int logcutoff=120000;
|
||||
static int linecnt;
|
||||
static int osdexecscript=0;
|
||||
|
||||
// presentation parameters
|
||||
static int osdpromptshade=0;
|
||||
|
@ -504,7 +505,7 @@ static int _internal_osdfunc_history(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s\n",parm->raw);
|
||||
for (i=HISTORYDEPTH-1; i>=0;i--)
|
||||
if (osdhistorybuf[i][0])
|
||||
OSD_Printf("%4d \"%s\"\n",++j,osdhistorybuf[i]);
|
||||
OSD_Printf("%4d \"%s\"\n",osdhistorytotal-osdhistorysize+(++j),osdhistorybuf[i]);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -800,6 +801,7 @@ int OSD_HandleChar(char ch)
|
|||
Bmemmove(osdhistorybuf[1], osdhistorybuf[0], (HISTORYDEPTH-1)*(EDITLENGTH+1));
|
||||
Bmemmove(osdhistorybuf[0], osdeditbuf, EDITLENGTH+1);
|
||||
if (osdhistorysize < HISTORYDEPTH) osdhistorysize++;
|
||||
osdhistorytotal++;
|
||||
if (osdexeccount == HISTORYDEPTH)
|
||||
OSD_Printf("Command Buffer Warning: Failed queueing command "
|
||||
"for execution. Buffer full.\n");
|
||||
|
@ -1575,6 +1577,16 @@ void OSD_SetVersionString(const char *version, int shade, int pal)
|
|||
osdversionstringpal = pal;
|
||||
}
|
||||
|
||||
int OSD_ParsingScript(void)
|
||||
{
|
||||
return osdexecscript;
|
||||
}
|
||||
|
||||
int OSD_OSDKey(void)
|
||||
{
|
||||
return osdkey;
|
||||
}
|
||||
|
||||
//
|
||||
// addnewsymbol() -- Allocates space for a new symbol and attaches it
|
||||
// appropriately to the lists, sorted.
|
||||
|
|
|
@ -1416,7 +1416,7 @@ int handleevents(void)
|
|||
case SDL_KEYUP:
|
||||
code = keytranslation[ev.key.keysym.sym];
|
||||
|
||||
if (code != osdkey && ev.key.keysym.unicode != 0 && ev.key.type == SDL_KEYDOWN &&
|
||||
if (code != OSD_OSDKey() && ev.key.keysym.unicode != 0 && ev.key.type == SDL_KEYDOWN &&
|
||||
(ev.key.keysym.unicode & 0xff80) == 0 &&
|
||||
((keyasciififoend+1)&(KEYFIFOSIZ-1)) != keyasciififoplc)
|
||||
{
|
||||
|
|
|
@ -4124,7 +4124,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
|||
case WM_CHAR:
|
||||
if (((keyasciififoend+1)&(KEYFIFOSIZ-1)) == keyasciififoplc) return 0;
|
||||
if ((keyasciififoend - keyasciififoplc) > 0) return 0;
|
||||
if (Btolower(scantoasc[osdkey]) == Btolower((unsigned char)wParam)) return 0;
|
||||
if (Btolower(scantoasc[OSD_OSDKey()]) == Btolower((unsigned char)wParam)) return 0;
|
||||
if (!OSD_HandleChar((unsigned char)wParam)) return 0;
|
||||
keyasciififo[keyasciififoend] = (unsigned char)wParam;
|
||||
keyasciififoend = ((keyasciififoend+1)&(KEYFIFOSIZ-1));
|
||||
|
|
|
@ -1110,7 +1110,7 @@ static int osdcmd_bind(const osdfuncparm_t *parm)
|
|||
Bstrncpy(mousebind[i].cmd,tempbuf, MAXBINDSTRINGLENGTH-1);
|
||||
|
||||
mousebind[i].key=mousenames[i];
|
||||
if (!osdexecscript)
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s\n",parm->raw);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ static int osdcmd_bind(const osdfuncparm_t *parm)
|
|||
Bstrncpy(boundkeys[keynames[i].id].cmd,tempbuf, MAXBINDSTRINGLENGTH-1);
|
||||
|
||||
boundkeys[keynames[i].id].key=keynames[i].name;
|
||||
if (!osdexecscript)
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s\n",parm->raw);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue