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

This commit is contained in:
terminx 2008-08-24 06:17:09 +00:00
parent 57c3cea591
commit 52bb6e84c9
7 changed files with 80 additions and 55 deletions

View file

@ -146,7 +146,8 @@ const char *stripcolorcodes(const char *in, char *out)
continue; continue;
} }
*(out++) = *(in++); *(out++) = *(in++);
} while (*in); }
while (*in);
*out = '\0'; *out = '\0';
return(ptr); 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 (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"); if (OSD_errors == MAX_ERRORS+1) Bstrcpy(tmpstr,OSD_ERROR "\nToo many errors. Logging errors stopped.\n");
else else
{ {
OSD_errors=MAX_ERRORS+2; OSD_errors=MAX_ERRORS+2;
return; return;
} }
} }
if (linecnt<logcutoff) if (linecnt<logcutoff)
@ -1483,7 +1484,8 @@ void OSD_Printf(const char *fmt, ...)
osdpos = 0; osdpos = 0;
linefeed(); linefeed();
} }
} while (*(++chp)); }
while (*(++chp));
} }

View file

@ -4472,13 +4472,15 @@ RECHECK:
updatesector(tspr->x+x,tspr->y+y,&datempsectnum); updatesector(tspr->x+x,tspr->y+y,&datempsectnum);
} }
for (i=4;i>-1;i--) i = 4;
do
{ {
cullcheckcnt++; cullcheckcnt++;
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x+x, tspr->y+y, tspr->z-(j*i)-512, datempsectnum)) tspr->x+x, tspr->y+y, tspr->z-(j*i)-512, datempsectnum))
return 1; return 1;
} }
while (--i > -1);
if (x != y && x == oldx) if (x != y && x == oldx)
{ {

View file

@ -7593,8 +7593,10 @@ void moveobjects(void)
pl=findplayer(&sprite[i],&p); pl=findplayer(&sprite[i],&p);
OnEvent(EVENT_GAME,i, pl, p); OnEvent(EVENT_GAME,i, pl, p);
i = j; i = j;
} while (i >= 0); }
} while (--k); while (i >= 0);
}
while (--k);
} }
doanimations(); doanimations();

View file

@ -7437,20 +7437,21 @@ PALONLY:
do do
{ {
if (display_mirror) tsprite[j].statnum = TSPR_MIRROR; if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
spriteext[tsprite[j].owner].tspr = NULL; spriteext[tsprite[j].owner].tspr = NULL;
} }
} while (--j > 0); }
while (--j > 0);
if (j < 0) return; if (j < 0) return;
if (display_mirror) tsprite[j].statnum = TSPR_MIRROR; if (display_mirror) tsprite[j].statnum = TSPR_MIRROR;
if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0) if (spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS && tsprite[j].owner < MAXSPRITES && tsprite[j].owner > 0)
{ {
OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
spriteext[tsprite[j].owner].tspr = NULL; spriteext[tsprite[j].owner].tspr = NULL;
} }
} }
#ifdef _MSC_VER #ifdef _MSC_VER

View file

@ -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); SetGameVarID(lVar2, spriteext[iActor].tspr->owner,g_i,g_p);
return; return;
#if 1 #if 1
case ACTOR_XVEL: case ACTOR_XVEL:
if (iSet) 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); SetGameVarID(lVar2, spriteext[iActor].tspr->lotag,g_i,g_p);
return; return;
case ACTOR_HITAG: case ACTOR_HITAG:
if (iSet) if (iSet)
{ {
@ -5313,7 +5313,7 @@ static int parse(void)
operatesectors(var1, var2); operatesectors(var1, var2);
break; break;
case CON_OPERATEACTIVATORS: 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); operateactivators(var1, var2);
break; break;
case CON_SETASPECT: case CON_SETASPECT:
@ -5573,13 +5573,13 @@ static int parse(void)
Bstrcpy(fta_quotes[i],fta_quotes[j]); Bstrcpy(fta_quotes[i],fta_quotes[j]);
break; break;
case CON_CHANGESPRITESTAT: 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;} if ((j<0 || j>=MAXSTATUS) && checkCON) {OSD_Printf(CON_ERROR "Invalid status %d\n",line_num,keyw[g_tw],j);break;}
changespritestat(i,j); changespritestat(i,j);
break; break;
case CON_CHANGESPRITESECT: 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 ((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 ((j<0 || j>=numsectors) && checkCON) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],j);break;}
changespritesect(i,j); changespritesect(i,j);
break; break;
} }
@ -7025,10 +7025,12 @@ static int parse(void)
} }
} }
j = nextspritestat[j]; j = nextspritestat[j];
} while (j>=0); }
while (j>=0);
if ((tw==CON_FINDNEARACTOR||tw==CON_FINDNEARACTOR3D) || j == MAXSPRITES) if ((tw==CON_FINDNEARACTOR||tw==CON_FINDNEARACTOR3D) || j == MAXSPRITES)
break; break;
} while (k--); }
while (k--);
SetGameVarID(lVarID, lFound, g_i, g_p); SetGameVarID(lVarID, lFound, g_i, g_p);
break; break;
} }
@ -7067,10 +7069,12 @@ static int parse(void)
} }
} }
j = nextspritestat[j]; j = nextspritestat[j];
} while (j >= 0); }
while (j >= 0);
if ((tw==CON_FINDNEARACTORVAR||tw==CON_FINDNEARACTOR3DVAR) || j == MAXSPRITES) if ((tw==CON_FINDNEARACTORVAR||tw==CON_FINDNEARACTOR3DVAR) || j == MAXSPRITES)
break; break;
} while (k--); }
while (k--);
SetGameVarID(lVarID, lFound, g_i, g_p); SetGameVarID(lVarID, lFound, g_i, g_p);
break; break;
} }
@ -7109,10 +7113,12 @@ static int parse(void)
} }
} }
j = nextspritestat[j]; j = nextspritestat[j];
} while (j>=0); }
while (j>=0);
if (tw==CON_FINDNEARACTORZVAR || j == MAXSPRITES) if (tw==CON_FINDNEARACTORZVAR || j == MAXSPRITES)
break; break;
} while (k--); }
while (k--);
SetGameVarID(lVarID, lFound, g_i, g_p); SetGameVarID(lVarID, lFound, g_i, g_p);
break; break;
@ -7152,10 +7158,12 @@ static int parse(void)
} }
} }
j = nextspritestat[j]; j = nextspritestat[j];
} while (j>=0); }
while (j>=0);
if (tw==CON_FINDNEARACTORZ || j == MAXSPRITES) if (tw==CON_FINDNEARACTORZ || j == MAXSPRITES)
break; break;
} while (k--); }
while (k--);
SetGameVarID(lVarID, lFound, g_i, g_p); SetGameVarID(lVarID, lFound, g_i, g_p);
break; break;
} }

View file

@ -666,7 +666,8 @@ void CONTROL_PollDevices(ControlInfo *info)
CONTROL_ScaleAxis(i, controldevice_mouse); CONTROL_ScaleAxis(i, controldevice_mouse);
LIMITCONTROL(&CONTROL_MouseAxes[i].analog); LIMITCONTROL(&CONTROL_MouseAxes[i].analog);
CONTROL_ApplyAxis(i, info, controldevice_mouse); CONTROL_ApplyAxis(i, info, controldevice_mouse);
} while (--i >= 0); }
while (--i >= 0);
} }
if (CONTROL_JoystickEnabled) if (CONTROL_JoystickEnabled)
@ -684,7 +685,8 @@ void CONTROL_PollDevices(ControlInfo *info)
CONTROL_ScaleAxis(i, controldevice_joystick); CONTROL_ScaleAxis(i, controldevice_joystick);
LIMITCONTROL(&CONTROL_JoyAxes[i].analog); LIMITCONTROL(&CONTROL_JoyAxes[i].analog);
CONTROL_ApplyAxis(i, info, controldevice_joystick); CONTROL_ApplyAxis(i, info, controldevice_joystick);
} while (--i >= 0); }
while (--i >= 0);
} }
CONTROL_GetDeviceButtons(); CONTROL_GetDeviceButtons();
@ -707,7 +709,8 @@ void CONTROL_AxisFunctionState(int32 *p1)
if (j != AXISUNDEFINED) if (j != AXISUNDEFINED)
p1[j] = 1; p1[j] = 1;
} while (--i >= 0); }
while (--i >= 0);
} }
if (CONTROL_NumJoyAxes) if (CONTROL_NumJoyAxes)
@ -725,7 +728,8 @@ void CONTROL_AxisFunctionState(int32 *p1)
if (j != AXISUNDEFINED) if (j != AXISUNDEFINED)
p1[j] = 1; p1[j] = 1;
} while (--i >= 0); }
while (--i >= 0);
} }
} }
@ -735,16 +739,6 @@ void CONTROL_ButtonFunctionState(int32 *p1)
do 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]) if (!mousebind[i].cmd[0])
{ {
j = CONTROL_MouseButtonMapping[i].doubleclicked; j = CONTROL_MouseButtonMapping[i].doubleclicked;
@ -755,7 +749,18 @@ void CONTROL_ButtonFunctionState(int32 *p1)
if (j != KEYUNDEFINED) if (j != KEYUNDEFINED)
p1[j] |= CONTROL_MouseButtonState[i]; 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; i=CONTROL_NumJoyButtons-1;
do do
@ -767,7 +772,8 @@ void CONTROL_ButtonFunctionState(int32 *p1)
j = CONTROL_JoyButtonMapping[i].singleclicked; j = CONTROL_JoyButtonMapping[i].singleclicked;
if (j != KEYUNDEFINED) if (j != KEYUNDEFINED)
p1[j] |= CONTROL_JoyButtonState[i]; p1[j] |= CONTROL_JoyButtonState[i];
} while (--i >= 0); }
while (--i >= 0);
} }
/* /*
void CONTROL_GetUserInput( UserInput *info ) void CONTROL_GetUserInput( UserInput *info )
@ -876,7 +882,8 @@ void CONTROL_ProcessBinds(void)
OSD_Dispatch(boundkeys[i].cmd); OSD_Dispatch(boundkeys[i].cmd);
} }
boundkeys[i].laststate = KB_KeyPressed(i); boundkeys[i].laststate = KB_KeyPressed(i);
} while (--i); }
while (--i);
if (boundkeys[0].cmd[0] && KB_KeyPressed(0)) 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); if (CONTROL_Flags[i].cleared == false) BUTTONSET(i, CONTROL_Flags[i].active);
else if (CONTROL_Flags[i].active == false) CONTROL_Flags[i].cleared = 0; 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]); CONTROL_SetFlag(0, CONTROL_KeyboardFunctionPressed(0) | periphs[0] | extinput[0]);
if (CONTROL_Flags[0].cleared == false) BUTTONSET(0, CONTROL_Flags[0].active); if (CONTROL_Flags[0].cleared == false) BUTTONSET(0, CONTROL_Flags[0].active);

View file

@ -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 // 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, 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; x += OSDCHAR_WIDTH+1;
ch++; ch++;
} while (--len); }
while (--len);
usehightile = ht; usehightile = ht;
return; 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); rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, shade, pal, 8|16, 0, 0, xdim-1, ydim-1);
x += OSDCHAR_WIDTH+1; x += OSDCHAR_WIDTH+1;
ch++; ch++;
} while (--len); }
while (--len);
usehightile = ht; usehightile = ht;
} }