|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* $Id: sysfunc.c,v 1.11 2003/05/07 20:19:20 stpohle Exp $
|
|
|
|
|
/* $Id: sysfunc.c,v 1.12 2003/05/07 23:57:19 stpohle Exp $
|
|
|
|
|
sysfunc.c - this file hold some routines for the system functions..
|
|
|
|
|
like d_delay
|
|
|
|
|
*/
|
|
|
|
@ -6,23 +6,19 @@
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
|
#include "sysfunc.h"
|
|
|
|
|
|
|
|
|
|
/* i have no banned usleep completly, even usleep would
|
|
|
|
|
bring the cpu usage more down. but i found out that
|
|
|
|
|
usleep is not as excact as select is. */
|
|
|
|
|
void
|
|
|
|
|
s_delay (int ms)
|
|
|
|
|
{
|
|
|
|
|
fd_set selectset;
|
|
|
|
|
struct timeval tval;
|
|
|
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
if (ms < 20) {
|
|
|
|
|
#endif
|
|
|
|
|
FD_ZERO (&selectset);
|
|
|
|
|
tval.tv_sec = 0;
|
|
|
|
|
tval.tv_usec = ms * 1000;
|
|
|
|
|
select (1, &selectset, NULL, NULL, &tval);
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
}
|
|
|
|
|
else usleep (1000 * ms);
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|