-
Notifications
You must be signed in to change notification settings - Fork 65
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
Make SFML example with globalClock.restart() extend globalClock.getElapsedTime() #73
Conversation
Thanks for the contribution! |
} | ||
tile.ID = itr->tileID; | ||
if(itr == as.animTile.animation.frames.end() - 1) | ||
time = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by setting this static var to zero.. you are resetting all tile animations (if there are multiple)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I've addressed that here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what was the original problem with Clock.getElapsedTime() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I haven't worked much on the SFML example, it has mostly been updated by contributors, so I don't know. Perhaps @DmitruMoth can expand either here or on #72 and comment on whether or not this fixes the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is not very convenient using getElapsedTime, because the time variable will be always grow up, so, my solution is bad, I just suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that using restart to get discrete time slices (fixed or otherwise) is, in my experience at least, a more common technique so I see your point of view. If the example works in its current state for everyone I have no problem with that.
No description provided.