From 52bb6e84c97ef38bd1e8be341d2ef02183e517d9 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 24 Aug 2008 06:17:09 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1017 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/osd.c | 18 ++++++----- polymer/build/src/polymost.c | 4 ++- polymer/eduke32/source/actors.c | 6 ++-- polymer/eduke32/source/game.c | 19 +++++------ polymer/eduke32/source/gameexec.c | 36 +++++++++++++-------- polymer/eduke32/source/jmact/control.c | 44 +++++++++++++++----------- polymer/eduke32/source/osdfuncs.c | 8 +++-- 7 files changed, 80 insertions(+), 55 deletions(-) diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index e6e81480a..4d43b1459 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -146,7 +146,8 @@ const char *stripcolorcodes(const char *in, char *out) continue; } *(out++) = *(in++); - } while (*in); + } + while (*in); *out = '\0'; return(ptr); @@ -1402,12 +1403,12 @@ void OSD_Printf(const char *fmt, ...) if (tmpstr[0]=='^' && tmpstr[1]=='1' && tmpstr[2]=='0' && ++OSD_errors > MAX_ERRORS) { - if(OSD_errors == MAX_ERRORS+1) Bstrcpy(tmpstr,OSD_ERROR "\nToo many errors. Logging errors stopped.\n"); - else - { - OSD_errors=MAX_ERRORS+2; - return; - } + if (OSD_errors == MAX_ERRORS+1) Bstrcpy(tmpstr,OSD_ERROR "\nToo many errors. Logging errors stopped.\n"); + else + { + OSD_errors=MAX_ERRORS+2; + return; + } } if (linecntx+x,tspr->y+y,&datempsectnum); } - for (i=4;i>-1;i--) + i = 4; + do { cullcheckcnt++; if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+x, tspr->y+y, tspr->z-(j*i)-512, datempsectnum)) return 1; } + while (--i > -1); if (x != y && x == oldx) { diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index e8fead31d..15da80419 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -7593,8 +7593,10 @@ void moveobjects(void) pl=findplayer(&sprite[i],&p); OnEvent(EVENT_GAME,i, pl, p); i = j; - } while (i >= 0); - } while (--k); + } + while (i >= 0); + } + while (--k); } doanimations(); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 98eb9c3c1..1032d245c 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7437,20 +7437,21 @@ PALONLY: do { if (display_mirror) tsprite[j].statnum = TSPR_MIRROR; - if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) - { - OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); - spriteext[tsprite[j].owner].tspr = NULL; + if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) + { + OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); + spriteext[tsprite[j].owner].tspr = NULL; } - } while (--j > 0); + } + while (--j > 0); if (j < 0) return; if (display_mirror) tsprite[j].statnum = TSPR_MIRROR; - if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) - { - OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); - spriteext[tsprite[j].owner].tspr = NULL; + if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) + { + OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); + spriteext[tsprite[j].owner].tspr = NULL; } } #ifdef _MSC_VER diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 827b66cf9..7a470fe30 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3686,7 +3686,7 @@ static void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2) SetGameVarID(lVar2, spriteext[iActor].tspr->owner,g_i,g_p); return; -#if 1 +#if 1 case ACTOR_XVEL: if (iSet) { @@ -3722,7 +3722,7 @@ static void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2) } SetGameVarID(lVar2, spriteext[iActor].tspr->lotag,g_i,g_p); return; - + case ACTOR_HITAG: if (iSet) { @@ -5313,7 +5313,7 @@ static int parse(void) operatesectors(var1, var2); break; case CON_OPERATEACTIVATORS: - if ((var2<0 || var2>=ud.multimode) && checkCON){OSD_Printf(CON_ERROR "Invalid player %d\n",line_num,keyw[g_tw],var2);break;} + if ((var2<0 || var2>=ud.multimode) && checkCON) {OSD_Printf(CON_ERROR "Invalid player %d\n",line_num,keyw[g_tw],var2);break;} operateactivators(var1, var2); break; case CON_SETASPECT: @@ -5573,13 +5573,13 @@ static int parse(void) Bstrcpy(fta_quotes[i],fta_quotes[j]); break; case CON_CHANGESPRITESTAT: - if ((i<0 || i>=MAXSPRITES) && checkCON){OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;} + if ((i<0 || i>=MAXSPRITES) && checkCON) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;} if ((j<0 || j>=MAXSTATUS) && checkCON) {OSD_Printf(CON_ERROR "Invalid status %d\n",line_num,keyw[g_tw],j);break;} changespritestat(i,j); break; case CON_CHANGESPRITESECT: - if ((i<0 || i>=MAXSPRITES) && checkCON){OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;} - if ((j<0 || j>=numsectors) && checkCON){OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],j);break;} + if ((i<0 || i>=MAXSPRITES) && checkCON) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;} + if ((j<0 || j>=numsectors) && checkCON) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],j);break;} changespritesect(i,j); break; } @@ -7025,10 +7025,12 @@ static int parse(void) } } j = nextspritestat[j]; - } while (j>=0); + } + while (j>=0); if ((tw==CON_FINDNEARACTOR||tw==CON_FINDNEARACTOR3D) || j == MAXSPRITES) break; - } while (k--); + } + while (k--); SetGameVarID(lVarID, lFound, g_i, g_p); break; } @@ -7067,10 +7069,12 @@ static int parse(void) } } j = nextspritestat[j]; - } while (j >= 0); + } + while (j >= 0); if ((tw==CON_FINDNEARACTORVAR||tw==CON_FINDNEARACTOR3DVAR) || j == MAXSPRITES) break; - } while (k--); + } + while (k--); SetGameVarID(lVarID, lFound, g_i, g_p); break; } @@ -7109,10 +7113,12 @@ static int parse(void) } } j = nextspritestat[j]; - } while (j>=0); + } + while (j>=0); if (tw==CON_FINDNEARACTORZVAR || j == MAXSPRITES) break; - } while (k--); + } + while (k--); SetGameVarID(lVarID, lFound, g_i, g_p); break; @@ -7152,10 +7158,12 @@ static int parse(void) } } j = nextspritestat[j]; - } while (j>=0); + } + while (j>=0); if (tw==CON_FINDNEARACTORZ || j == MAXSPRITES) break; - } while (k--); + } + while (k--); SetGameVarID(lVarID, lFound, g_i, g_p); break; } diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 8427d9b77..2145f7b57 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -666,7 +666,8 @@ void CONTROL_PollDevices(ControlInfo *info) CONTROL_ScaleAxis(i, controldevice_mouse); LIMITCONTROL(&CONTROL_MouseAxes[i].analog); CONTROL_ApplyAxis(i, info, controldevice_mouse); - } while (--i >= 0); + } + while (--i >= 0); } if (CONTROL_JoystickEnabled) @@ -684,7 +685,8 @@ void CONTROL_PollDevices(ControlInfo *info) CONTROL_ScaleAxis(i, controldevice_joystick); LIMITCONTROL(&CONTROL_JoyAxes[i].analog); CONTROL_ApplyAxis(i, info, controldevice_joystick); - } while (--i >= 0); + } + while (--i >= 0); } CONTROL_GetDeviceButtons(); @@ -707,7 +709,8 @@ void CONTROL_AxisFunctionState(int32 *p1) if (j != AXISUNDEFINED) p1[j] = 1; - } while (--i >= 0); + } + while (--i >= 0); } if (CONTROL_NumJoyAxes) @@ -725,7 +728,8 @@ void CONTROL_AxisFunctionState(int32 *p1) if (j != AXISUNDEFINED) p1[j] = 1; - } while (--i >= 0); + } + while (--i >= 0); } } @@ -735,16 +739,6 @@ void CONTROL_ButtonFunctionState(int32 *p1) do { - if (bindsenabled) - { - if (mousebind[i].cmd[0] && CONTROL_MouseButtonState[i]) - { - if (mousebind[i].repeat || (mousebind[i].laststate == 0)) - OSD_Dispatch(mousebind[i].cmd); - } - mousebind[i].laststate = CONTROL_MouseButtonState[i]; - } - if (!mousebind[i].cmd[0]) { j = CONTROL_MouseButtonMapping[i].doubleclicked; @@ -755,7 +749,18 @@ void CONTROL_ButtonFunctionState(int32 *p1) if (j != KEYUNDEFINED) p1[j] |= CONTROL_MouseButtonState[i]; } - } while (--i >= 0); + + if (!bindsenabled) + continue; + + if (mousebind[i].cmd[0] && CONTROL_MouseButtonState[i]) + { + if (mousebind[i].repeat || (mousebind[i].laststate == 0)) + OSD_Dispatch(mousebind[i].cmd); + } + mousebind[i].laststate = CONTROL_MouseButtonState[i]; + } + while (--i >= 0); i=CONTROL_NumJoyButtons-1; do @@ -767,7 +772,8 @@ void CONTROL_ButtonFunctionState(int32 *p1) j = CONTROL_JoyButtonMapping[i].singleclicked; if (j != KEYUNDEFINED) p1[j] |= CONTROL_JoyButtonState[i]; - } while (--i >= 0); + } + while (--i >= 0); } /* void CONTROL_GetUserInput( UserInput *info ) @@ -876,7 +882,8 @@ void CONTROL_ProcessBinds(void) OSD_Dispatch(boundkeys[i].cmd); } boundkeys[i].laststate = KB_KeyPressed(i); - } while (--i); + } + while (--i); if (boundkeys[0].cmd[0] && KB_KeyPressed(0)) { @@ -912,7 +919,8 @@ void CONTROL_GetInput(ControlInfo *info) if (CONTROL_Flags[i].cleared == false) BUTTONSET(i, CONTROL_Flags[i].active); else if (CONTROL_Flags[i].active == false) CONTROL_Flags[i].cleared = 0; - } while (--i); + } + while (--i); CONTROL_SetFlag(0, CONTROL_KeyboardFunctionPressed(0) | periphs[0] | extinput[0]); if (CONTROL_Flags[0].cleared == false) BUTTONSET(0, CONTROL_Flags[0].active); diff --git a/polymer/eduke32/source/osdfuncs.c b/polymer/eduke32/source/osdfuncs.c index c7885570d..0a6829a35 100644 --- a/polymer/eduke32/source/osdfuncs.c +++ b/polymer/eduke32/source/osdfuncs.c @@ -43,10 +43,11 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal) // use the format byte if the text falls within the bounds of the console buffer rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, (*(ch-ptr+fmt)&~0x1F)>>4, - *(ch-ptr+fmt)&~0xE0, 8|16, 0, 0, xdim-1, ydim-1); + *(ch-ptr+fmt)&~0xE0, 8|16, 0, 0, xdim-1, ydim-1); x += OSDCHAR_WIDTH+1; ch++; - } while (--len); + } + while (--len); usehightile = ht; return; @@ -66,7 +67,8 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal) rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, shade, pal, 8|16, 0, 0, xdim-1, ydim-1); x += OSDCHAR_WIDTH+1; ch++; - } while (--len); + } + while (--len); usehightile = ht; }