Well, yes, you can simply shift to fixed since t is difference which I should be around 20. But what's the point? I'm using floating point exclusively for calculations, and really do not have problems with performance. If you do not perform heavy calculations it doesn't matter, and if you do interpreter overhead will kill your performance anyway.
-- Bart Janusz www.beepstreet.com On Dec 29, 4:25 pm, Mika <mts...@googlemail.com> wrote: > 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: > 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: > 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. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en