mirror of
https://github.com/dyne/FreeJ.git
synced 2026-06-16 12:59:33 +02:00
modified remaining fps rate declaration from int to float
- In FPS::FPS and destructor, commented out the mutex creation.
This commit is contained in:
+7
-7
@@ -42,26 +42,26 @@ FPS::FPS() {
|
||||
|
||||
wake_ts.tv_sec = wake_ts.tv_nsec = 0;
|
||||
|
||||
if(pthread_mutex_init (&_mutex,NULL) == -1)
|
||||
error("error initializing POSIX thread feed mutex");
|
||||
if(pthread_cond_init (&_cond, NULL) == -1)
|
||||
error("error initializing POSIX thread feed condtition");
|
||||
// if(pthread_mutex_init (&_mutex,NULL) == -1)
|
||||
// error("error initializing POSIX thread feed mutex");
|
||||
// if(pthread_cond_init (&_cond, NULL) == -1)
|
||||
// error("error initializing POSIX thread feed condtition");
|
||||
|
||||
}
|
||||
|
||||
FPS::~FPS() {
|
||||
free(fpsd.data);
|
||||
|
||||
if(pthread_mutex_destroy(&_mutex) == -1)
|
||||
/* if(pthread_mutex_destroy(&_mutex) == -1)
|
||||
error("error destroying POSIX thread feed mutex");
|
||||
if(pthread_cond_destroy(&_cond) == -1)
|
||||
error("error destroying POSIX thread feed attribute");
|
||||
error("error destroying POSIX thread feed attribute");*/
|
||||
|
||||
}
|
||||
void FPS::init(float rate) {
|
||||
|
||||
|
||||
this->set(25);
|
||||
this->set(rate);
|
||||
|
||||
for (int i=0; i<30; i++) {
|
||||
fpsd.data[i] = 0;
|
||||
|
||||
@@ -164,7 +164,7 @@ class Context {
|
||||
/* Set the interval (in frames) after
|
||||
the fps counter is updated */
|
||||
FPS fps;
|
||||
int fps_speed;
|
||||
float fps_speed;
|
||||
|
||||
bool clear_all;
|
||||
bool start_running;
|
||||
|
||||
+2
-2
@@ -53,8 +53,8 @@ class FPS {
|
||||
struct timeval start_tv;
|
||||
|
||||
/* mutex and conditional for the delay */
|
||||
pthread_mutex_t _mutex;
|
||||
pthread_cond_t _cond;
|
||||
// pthread_mutex_t _mutex;
|
||||
// pthread_cond_t _cond;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user