Author Topic: fps capping  (Read 7035 times)

0 Members and 1 Guest are viewing this topic.

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: fps capping
« Reply #60 on: June 01, 2010, 09:00:08 am »
Think widely, there is no sense to hold a result of (1000/maxFPS) as float because it's comparing with timer value (ms).

fpsCurrentTime, fpsLastFrame, fpsTimePassed, etc. all are based on timeGetTime and are integer.

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: fps capping
« Reply #61 on: June 01, 2010, 11:50:41 am »
nah..
Enesce, just change maxFPS and fpsTimePassed to floats, it gonna fix it.

and really you should use something more exact, since milliseconds are too big really :-S

From: June 01, 2010, 12:28:33 pm
btw
changing this
Code: [Select]
  if (fpsTimePassed >= fpsStep) then begin
    RenderFrame;
    fpsTimePassed := fpsTimePassed - fpsStep;
  end;

to this

Code: [Select]
if (fpsTimePassed >= fpsStep) then begin
    RenderFrame;
    fpsTimePassed := fpsTimePassed - Trunc(fpsTimePassed/fpsStep)*fpsStep;
  end;

Will fix a problem when fps goes higher than expected after a lag.
« Last Edit: June 01, 2010, 12:34:23 pm by Neosano »
KAWAAAAAAAIIIIIIIIII

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6142
    • Ultimate 13 Soldat
Re: fps capping
« Reply #62 on: June 03, 2010, 03:39:59 pm »
no.... when time is 481029, and fps step is 100, the next frame will be 481030, that is still greater than 100, so that frame will also be drawn.

adding time to fps step would probably work tho.
What are you talking about, retard?
Did you notice this line
timePassed= timePassed-fpsStep
?

Warned for inflammatory posts.