Skip to content

Conversation

@LumpBloom7
Copy link
Contributor

@LumpBloom7 LumpBloom7 commented Aug 16, 2019

  • SDL and other components have been updated to the latest
  • Optimizations and refactoring

LumpBloom7 and others added 22 commits March 30, 2019 12:52
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.
@LumpBloom7 LumpBloom7 added the enhancement New feature or request label Aug 16, 2019
@LumpBloom7 LumpBloom7 changed the title Retarget and refactor projects Refactoring and optimizations Aug 16, 2019
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;
Copy link
Collaborator

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;
Copy link
Collaborator

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);
Copy link
Collaborator

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?

Copy link
Contributor Author

@LumpBloom7 LumpBloom7 Oct 1, 2019

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..

LumpBloom7 and others added 3 commits October 2, 2019 21:03
- 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
kasmacioma
kasmacioma previously approved these changes Oct 5, 2019
namespace bloom::components {
struct Size {
Size(int w = 1, int h = 1) : w(w), h(h) {}
Size() : w(0), h(0) {} // or -1?
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants