diff options
author | deva <deva> | 2005-05-16 13:25:52 +0000 |
---|---|---|
committer | deva <deva> | 2005-05-16 13:25:52 +0000 |
commit | 3b5893ffa6d4a761eff0d97c7223eecd4fc123c9 (patch) | |
tree | acb7217f941c4a066e756d70eb41af1cb700f601 /src/server_status.cc | |
parent | 3f9ab7f6476ecfb9feef5380e3be6d280f1de76d (diff) |
Moved video setting to configuration file.
Fine tuned setting for 2.4ghz server
Diffstat (limited to 'src/server_status.cc')
-rw-r--r-- | src/server_status.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/server_status.cc b/src/server_status.cc index 1e58ee7..7583cc9 100644 --- a/src/server_status.cc +++ b/src/server_status.cc @@ -31,6 +31,11 @@ /* * $Log$ + * Revision 1.5 2005/05/16 13:25:52 deva + * + * Moved video setting to configuration file. + * Fine tuned setting for 2.4ghz server + * * Revision 1.4 2005/05/09 16:40:20 deva * * Added optimize yuv conversion code @@ -47,12 +52,15 @@ #include <stdio.h> +#define UPD 25 ServerStatus::ServerStatus() { + gettimeofday(&oldtime, NULL); + for(int cnt = 0; cnt < BUFFERSIZE; cnt++) { - frametime[cnt] = 0; + frametime[cnt] = 41660 * UPD; } - gettimeofday(&oldtime, NULL); + gettimeofday(&time, NULL); } @@ -62,6 +70,9 @@ ServerStatus::~ServerStatus() void ServerStatus::checkPoint() { + static int frame = 0; + frame++; + if(frame % UPD != 0) return; for(int cnt = BUFFERSIZE - 1; cnt > 0; cnt--) { frametime[cnt] = frametime[cnt-1]; } @@ -76,7 +87,7 @@ void ServerStatus::checkPoint() for(int cnt = 0; cnt < BUFFERSIZE; cnt++) { total += (double)frametime[cnt]; } - fprintf(stderr, "[ms: %d, fps: %f]\n", frametime[0], 1000000.0 / (total / (double)BUFFERSIZE) ); + fprintf(stderr, "[ms: %d, fps: %f]\n", frametime[0] / UPD, (1000000.0 / (total / (double)BUFFERSIZE)) * UPD ); } |