diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/PIL_time.h | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/time.c | 15 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 4404182192e..b103995e449 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -860,14 +860,14 @@ void BKE_image_memorypack(Image *ima) void BKE_image_tag_time(Image *ima) { - ima->lastused = (int)PIL_check_seconds_timer(); + ima->lastused = PIL_check_seconds_timer_i(); } #if 0 static void tag_all_images_time() { Image *ima; - int ctime = (int)PIL_check_seconds_timer(); + int ctime = PIL_check_seconds_timer_i(); ima = G.main->image.first; while (ima) { diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 158559fa3d9..6e347339980 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -37,7 +37,7 @@ extern "C" { #endif -extern +extern /** Return an indication of time, expressed as * seconds since some fixed point. Successive calls * are guaranteed to generate values greater than or @@ -45,6 +45,12 @@ extern */ double PIL_check_seconds_timer(void); +extern +/** + * int version of #PIL_check_seconds_timer + */ +long int PIL_check_seconds_timer_i(void); + /** * Platform-independent sleep function. * \param ms Number of milliseconds to sleep diff --git a/source/blender/blenlib/intern/time.c b/source/blender/blenlib/intern/time.c index 078fc2c295b..3a20d3ee920 100644 --- a/source/blender/blenlib/intern/time.c +++ b/source/blender/blenlib/intern/time.c @@ -70,6 +70,11 @@ double PIL_check_seconds_timer(void) } } +long int PIL_check_seconds_timer_i(void) +{ + return (long int)PIL_check_seconds_timer(); +} + void PIL_sleep_ms(int ms) { Sleep(ms); @@ -90,6 +95,16 @@ double PIL_check_seconds_timer(void) return ((double) tv.tv_sec + tv.tv_usec / 1000000.0); } +long int PIL_check_seconds_timer_i(void) +{ + struct timeval tv; + struct timezone tz; + + gettimeofday(&tv, &tz); + + return tv.tv_sec; +} + void PIL_sleep_ms(int ms) { if (ms >= 1000) { diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 5f58e3fe65b..6ff076bb02b 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1324,7 +1324,7 @@ void GPU_free_images_old(void) { Image *ima; static int lasttime = 0; - int ctime = (int)PIL_check_seconds_timer(); + int ctime = PIL_check_seconds_timer_i(); /* * Run garbage collector once for every collecting period of time |