Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clan::GameTime fault #108

Closed
rombust opened this issue Nov 6, 2018 · 1 comment
Closed

clan::GameTime fault #108

rombust opened this issue Nov 6, 2018 · 1 comment

Comments

@rombust
Copy link
Collaborator

rombust commented Nov 6, 2018

There is an issue with clan::GameTime.
If you sum 30 seconds of samples from GameTime::get_time_elapsed_ms(), this does not equal GameTime::get_current_time_ms()

Demonstrated by:

    game_time.update();
    static int total = 0;
    total += game_time.get_time_elapsed_ms();
    printf("%d\n", (int) ( game_time.get_current_time_ms() - total));

There is a fault with the usage of time_elapsed_ms_microsecond_adjustment.

This can be trivially fixed by having a "updated_current_time_ms" variable and the elapsed time is the delta from before it was set.

Unfortunately I currently don't have time to fix it.

@rombust
Copy link
Collaborator Author

rombust commented Oct 2, 2020

Fixed - "Fix accuracy of clan::GameTime get_time_elapsed_ms() by separating the mathematics between microseconds and milliseconds to avoid cumulative rounding errors"

@rombust rombust closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant