From b58833d7303661a31d790d7f4fd174f5f5ace5ee Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 24 Aug 2008 05:39:28 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1015 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/osd.c | 98 ++++++++++++++------------ polymer/eduke32/source/jmact/control.c | 22 ++---- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index fd229b7e3..e6e81480a 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -126,7 +126,7 @@ const char *stripcolorcodes(const char *in, char *out) { char *ptr = out; - while (*in) + do { if (*in == '^' && isdigit(*(in+1))) { @@ -146,7 +146,8 @@ const char *stripcolorcodes(const char *in, char *out) continue; } *(out++) = *(in++); - } + } while (*in); + *out = '\0'; return(ptr); } @@ -1248,7 +1249,7 @@ void OSD_ResizeDisplay(int w, int h) k = min(newcols, osdcols); memset(newtext, 32, TEXTSIZE); - for (i=0;i=0;i--) { memcpy(newtext+newcols*i, osdtext+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); len = min(osdcols-1-3, osdeditlen-osdeditwinstart); - for (x=0; x=0; x--) drawosdchar(3+x,osdrowscur,osdeditbuf[osdeditwinstart+x],osdeditshade<<1,osdeditpal); drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrowscur,osdovertype,keytime); @@ -1424,56 +1425,65 @@ void OSD_Printf(const char *fmt, ...) linecnt=logcutoff+1; } - for (chp = tmpstr; *chp; chp++) + chp = tmpstr; + do { - 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 == '^' && Btoupper(*(chp+1)) == 'S') - { - chp++; - if (isdigit(*(++chp))) - s = *chp; - } - else if (*chp == '^' && Btoupper(*(chp+1)) == 'O') - { - chp++; - p = osdtextpal; - s = osdtextshade; - } - else if (*chp == '\r') osdpos=0; - else if (*chp == '\n') + if (*chp == '\n') { osdpos=0; linecnt++; linefeed(); + continue; } - else + if (*chp == '\r') { - osdtext[osdpos] = *chp; - osdfmt[osdpos++] = p+(s<<5); - if (osdpos == osdcols) + osdpos=0; + continue; + } + if (*chp == '^') + { + if (isdigit(*(chp+1))) { - osdpos = 0; - linefeed(); + 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); + } + continue; + } + if (Btoupper(*(chp+1)) == 'S') + { + chp++; + if (isdigit(*(++chp))) + s = *chp; + continue; + } + if (Btoupper(*(chp+1)) == 'O') + { + chp++; + p = osdtextpal; + s = osdtextshade; + continue; } } - } + osdtext[osdpos] = *chp; + osdfmt[osdpos++] = p+(s<<5); + if (osdpos == osdcols) + { + osdpos = 0; + linefeed(); + } + } while (*(++chp)); } diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 5393e0a6f..b0d2a1199 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -425,14 +425,6 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio } } -void CONTROL_ClearFlags(void) -{ - int32 i; - - for (i=0;i=0;i--) { bs = (buttons >> i) & 1; @@ -493,14 +485,12 @@ static void DoGetDeviceButtons( { ButtonClickedState[i] = true; } + continue; } - else - { - if (ButtonClickedCount[i] == 2) - ButtonClickedCount[i] = 0; + if (ButtonClickedCount[i] == 2) + ButtonClickedCount[i] = 0; - ButtonClicked[i] = false; - } + ButtonClicked[i] = false; } }