Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Best way to handle System.currentTimeMillis() to fp format

Best way to handle System.currentTimeMillis() to fp format

Put your problem here if it does not fit any of the other categories.

Best way to handle System.currentTimeMillis() to fp format

Postby Skywhy » Sun Dec 27, 2009 1:09 pm

Like the topic of the thread says. In my game I would like to turn all the calculations into FP format. I can eliminate pretty much everything else but I still need to do the the following calculation in long format.

Code: Select all
long t = this.lastUpdateTime - System.currentTimeMillis();


The value I get from this is the time passed since last frame, which is like.. two digit millisecond value, which naturally is more than good for FP stuff. After that calculation I turn the resulting value into FP integer and use it with the rest of my calculations but I'd like to get rid of that long calculation too. Any ideas how to go around this to do it in FP format?

I mean, I'm pretty sure I cannot just go and do a normal conversion to FP format in this style:
Code: Select all
int fpT = t * (1<<16);

because there is always the change that it'll overflow and as the numbers that System.currentTimeMillis() give out are BIG.

So any advice how to keep the same "accuracy" of the timer but get rid of the long calculation and have it replaced with nice and fast FP calculation. Any advices on how to trim down the System.currentTimeMillis() or what ever to get around this are greatly appreciated.

Cheers guys.


// SkyWhy
Skywhy
Developer
Developer
 
Posts: 35
Joined: Tue Oct 20, 2009 7:55 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests