Diff for games/_shared/standart-linux.c between version 1.4 and 1.5
| version 1.4, 2003/10/07 12:19:52 |
version 1.5, 2003/10/21 10:23:43 |
|
|
| * |
* |
| */ |
*/ |
| |
|
| /* $Platon: games/_shared/standart-linux.c,v 1.3 2003/08/03 21:34:18 nepto Exp $ */ |
/* $Platon: games/_shared/standart-linux.c,v 1.4 2003/10/07 12:19:52 nepto Exp $ */ |
| |
|
| /* NOTE: incorrect "standart" word in filename is kept |
/* NOTE: incorrect "standart" word in filename is kept |
| from historical reasons; correct word is "standard" */ |
from historical reasons; correct word is "standard" */ |
|
|
| #include <typedef.h> |
#include <typedef.h> |
| #include <dos2linux.h> |
#include <dos2linux.h> |
| #include <time.h> |
#include <time.h> |
| |
#include <sys/times.h> |
| |
|
| #include "standart.h" |
#include "standart.h" |
| |
|
| Line 37 void mouse_status_update(void); |
|
| Line 38 void mouse_status_update(void); |
|
| |
|
| #include "stshared.c" |
#include "stshared.c" |
| |
|
| |
static void wait_clocks_dummy_func(void) |
| |
{ |
| |
return; |
| |
} |
| |
|
| |
static void wait_clocks(clock_t total, void (*user_fnc)()) |
| |
{ |
| |
clock_t start = times(NULL); |
| |
while (times(NULL) - start < total) |
| |
user_fnc(); |
| |
} |
| |
|
| void wait(double sec) |
void wait(double sec) |
| { |
{ |
| wait_clocks(max(1, sec * CLOCKS_PER_SEC), |
wait_clocks(max(1, sec * sysconf(_SC_CLK_TCK)), |
| #if defined(MOUSE_SUPPORT_IN_WAIT) && MOUSE_SUPPORT_IN_WAIT |
#if defined(MOUSE_SUPPORT_IN_WAIT) && MOUSE_SUPPORT_IN_WAIT |
| mouse_status_update |
mouse_status_update |
| #else |
#else |
Platon Group <platon@platon.org> http://platon.org/
|
|