Page MenuHomeWildfire Games

Combine Frame functions
Needs ReviewPublic

Authored by phosit on Mar 8 2024, 6:26 PM.

Details

Reviewers
vladislavbelov
Summary

This removes some redundancy
Also move the static functions in main.cpp in to an ananymous namespace.
Remove the old way of the realTimeSinceLastFrame calculation.

Test Plan

Run visual and non visual mode.
Run with and without rlInterface

Event Timeline

phosit created this revision.Mar 8 2024, 6:26 PM
phosit edited the summary of this revision. (Show Details)
phosit published this revision for review.Mar 9 2024, 9:43 AM
sera added a subscriber: sera.Mar 9 2024, 2:42 PM
sera added inline comments.
source/main.cpp
365

Without reading the code it's impossible to guess what the function does based on the name, also breaks intent if called from anywhere else or more than once per "frame"

phosit added inline comments.Mar 9 2024, 3:00 PM
source/main.cpp
365

Do you suggest to change the name? What name do you suggest?
Or Should I leave it inside Frame, so that it can't be used outside of Frame?

sera added inline comments.Mar 9 2024, 4:52 PM
source/main.cpp
365

The function returns realTimeSinceLastFrame, so maybe calculateRealTimeSinceLastFrame?

As it's a "static" function probably a comment is good enough, tho keeping it inside of Frame works for me as well.

phosit updated this revision to Diff 22826.Mar 13 2024, 12:24 PM
phosit marked 2 inline comments as done.
phosit edited the summary of this revision. (Show Details)

Move the realTimeSinceLastFrame calculation back in to Frame.