-
Notifications
You must be signed in to change notification settings - Fork 5
Refactoring and optimizations #35
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
base: master
Are you sure you want to change the base?
Conversation
Before it would complain about Nuget packages not being installed because it wasn't looking for it relative to `$(SolutionDir)`.
Don't have to change TestBench includes and enTT directory because it is more reliable to use the current paths.
Use default ctor and ctor with the specified params
Also: - Make GameObject's dtor virtual - Make the c_gameInstance pointer constant - Assign Size to the game object's entity automatically
- Move some funcs definitions to the header files - Remove blank line between `pragma` and first `include` - Use ternary operator in some returns - Remove extra blank lines at the end of the files - Make some iterators (in conditions) constant - Small fixes to `Game`
We don't need this at all since it makes animations inaccurate. Nobody expects animations to be rounded just like nobody don't expect your TV to render the next frame before it should.
- Make unused params anonymous - Remove std::optional for deltaTime param - Remove extra conversions in RenderSystem::update - Simplify RandomPositionSystem::update - Minor fixes and improvements
Removed unused `this` from lambda, remove blank line at the end of file, remove gap between type name and ref symbol
- Remove check on `SDL_WINDOW_FULLSCREEN` (can't reproduce graphic bug) - Combine and pack params (by using components::Size, components::Position, std::pair and std::tuple) - Prevent SDL to be unloaded if there are alive Game objects - Fix messages - Determine what image formats were not loaded - Move some funcs definition inside the class definition - Add simple docs (OMG, really?) for most functions
- Use uint64_t for time instead of double - Make Timer header-only - Mark `Timer::start` as deprecated
It also allows us to use the Windows subsystem without issues.
This will result in a cross-dependent situation where the packages cannot be downloaded without loading the project, but the projects need the packages to be downloaded before being able to load.
936cb45 to
06b8f54
Compare
Storing time into `int` is always a bad idea. There are honestly times where we need to use times lower than 1ms. The performance/memory improvements of using an integer is not worth the accuracy loss.
| // std::unordered_map<int, Sprite> animationFrames; // Frames can be inserted in any order as long as the correct number is given. | ||
|
|
||
| private: | ||
| double m_lastUpdateTime = 0.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.
Why?
| double m_lastUpdateTime = 0.0; | ||
| double m_lastUpdateTime = 0; | ||
| size_t m_currentFrame = 0; | ||
| double m_frameTime = 0.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.
But why?
| } | ||
|
|
||
| void setFPS(double fps) { | ||
| setFrameTime(1000 / fps); |
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.
Why did you remove .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.
Oops. Strangely I don't remember doing any of that since I am in the habit of adding the .0s.
Maybe it's because of my quick revert in the timer..
- Remove blank line between #pragma once and #include - Remove unused headres - Game::exit now will signal if exit was successful or not. - Add some missed .0 for double values - Remove explicit values in TextStyle::BlendingMode - Make renderer as const in TextureStore's ctor - Fix indentations - Use array instead of vector in AnimationChangerSystem
| namespace bloom::components { | ||
| struct Size { | ||
| Size(int w = 1, int h = 1) : w(w), h(h) {} | ||
| Size() : w(0), h(0) {} // or -1? |
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.
No, use {0;0} here
fda73b8 to
392fd7d
Compare
Uh oh!
There was an error while loading. Please reload this page.