git-svn-id: https://svn.eduke32.com/eduke32@1015 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-08-24 05:39:28 +00:00
parent cf2f7927ea
commit b58833d730
2 changed files with 60 additions and 60 deletions

View file

@ -126,7 +126,7 @@ const char *stripcolorcodes(const char *in, char *out)
{ {
char *ptr = out; char *ptr = out;
while (*in) do
{ {
if (*in == '^' && isdigit(*(in+1))) if (*in == '^' && isdigit(*(in+1)))
{ {
@ -146,7 +146,8 @@ const char *stripcolorcodes(const char *in, char *out)
continue; continue;
} }
*(out++) = *(in++); *(out++) = *(in++);
} } while (*in);
*out = '\0'; *out = '\0';
return(ptr); return(ptr);
} }
@ -1248,7 +1249,7 @@ void OSD_ResizeDisplay(int w, int h)
k = min(newcols, osdcols); k = min(newcols, osdcols);
memset(newtext, 32, TEXTSIZE); memset(newtext, 32, TEXTSIZE);
for (i=0;i<j;i++) for (i=j-1;i>=0;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(newfmt+newcols*i, osdfmt+osdcols*i, k);
@ -1364,7 +1365,7 @@ void OSD_Draw(void)
if (osdeditshift) drawosdchar(1,osdrowscur,'H',osdpromptshade,osdpromptpal); if (osdeditshift) drawosdchar(1,osdrowscur,'H',osdpromptshade,osdpromptpal);
len = min(osdcols-1-3, osdeditlen-osdeditwinstart); len = min(osdcols-1-3, osdeditlen-osdeditwinstart);
for (x=0; x<len; x++) for (x=len-1; x>=0; x--)
drawosdchar(3+x,osdrowscur,osdeditbuf[osdeditwinstart+x],osdeditshade<<1,osdeditpal); drawosdchar(3+x,osdrowscur,osdeditbuf[osdeditwinstart+x],osdeditshade<<1,osdeditpal);
drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrowscur,osdovertype,keytime); drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrowscur,osdovertype,keytime);
@ -1424,9 +1425,24 @@ void OSD_Printf(const char *fmt, ...)
linecnt=logcutoff+1; linecnt=logcutoff+1;
} }
for (chp = tmpstr; *chp; chp++) chp = tmpstr;
do
{ {
if (*chp == '^' && isdigit(*(chp+1))) if (*chp == '\n')
{
osdpos=0;
linecnt++;
linefeed();
continue;
}
if (*chp == '\r')
{
osdpos=0;
continue;
}
if (*chp == '^')
{
if (isdigit(*(chp+1)))
{ {
char smallbuf[4]; char smallbuf[4];
chp++; chp++;
@ -1443,28 +1459,23 @@ void OSD_Printf(const char *fmt, ...)
smallbuf[1] = '\0'; smallbuf[1] = '\0';
p = atol(smallbuf); p = atol(smallbuf);
} }
continue;
} }
else if (*chp == '^' && Btoupper(*(chp+1)) == 'S') if (Btoupper(*(chp+1)) == 'S')
{ {
chp++; chp++;
if (isdigit(*(++chp))) if (isdigit(*(++chp)))
s = *chp; s = *chp;
continue;
} }
else if (*chp == '^' && Btoupper(*(chp+1)) == 'O') if (Btoupper(*(chp+1)) == 'O')
{ {
chp++; chp++;
p = osdtextpal; p = osdtextpal;
s = osdtextshade; s = osdtextshade;
continue;
} }
else if (*chp == '\r') osdpos=0;
else if (*chp == '\n')
{
osdpos=0;
linecnt++;
linefeed();
} }
else
{
osdtext[osdpos] = *chp; osdtext[osdpos] = *chp;
osdfmt[osdpos++] = p+(s<<5); osdfmt[osdpos++] = p+(s<<5);
if (osdpos == osdcols) if (osdpos == osdcols)
@ -1472,8 +1483,7 @@ void OSD_Printf(const char *fmt, ...)
osdpos = 0; osdpos = 0;
linefeed(); linefeed();
} }
} } while (*(++chp));
}
} }

View file

@ -425,14 +425,6 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio
} }
} }
void CONTROL_ClearFlags(void)
{
int32 i;
for (i=0;i<CONTROL_NUM_FLAGS;i++)
CONTROL_Flags[i].used = false;
}
void CONTROL_ClearAssignments(void) void CONTROL_ClearAssignments(void)
{ {
int32 i; int32 i;
@ -462,9 +454,9 @@ static void DoGetDeviceButtons(
byte *ButtonClickedCount byte *ButtonClickedCount
) )
{ {
int32 i, bs; int32 i=NumButtons-1, bs;
for (i=0;i<NumButtons;i++) for (;i>=0;i--)
{ {
bs = (buttons >> i) & 1; bs = (buttons >> i) & 1;
@ -493,16 +485,14 @@ static void DoGetDeviceButtons(
{ {
ButtonClickedState[i] = true; ButtonClickedState[i] = true;
} }
continue;
} }
else
{
if (ButtonClickedCount[i] == 2) if (ButtonClickedCount[i] == 2)
ButtonClickedCount[i] = 0; ButtonClickedCount[i] = 0;
ButtonClicked[i] = false; ButtonClicked[i] = false;
} }
} }
}
void CONTROL_GetDeviceButtons(void) void CONTROL_GetDeviceButtons(void)
{ {