Add facilities to manage scenes#30
Draft
LumpBloom7 wants to merge 96 commits intoBloomCreativeWorks:masterfrom
Draft
Add facilities to manage scenes#30LumpBloom7 wants to merge 96 commits intoBloomCreativeWorks:masterfrom
LumpBloom7 wants to merge 96 commits intoBloomCreativeWorks:masterfrom
Conversation
WIP and not ready.
This prevents circular dependency when including them in Game.h
This prevents the program from continuously allocating memory, resulting in increased memory usage as time passes.
The class dtor would take care of it.
Also fix a build error in which an attempts to use `unload()` was made.
These functions will also set `m_sceneLoaded` to `true`
This change allows `Scene`s to be swapped out while retaining their state. (Something like suspend) Of course something would need to store the Scene or it'll just simply unload.
as it's stable and doesnэt use extra memory
Don't sort the `renderQueue` every frame. Instead, sort the whole GO list on every new `GameObject`. This should provide the same effect, while improving performance.
I'm not quite clear on how the registry sorting works, so I'm playing safe here.
This reverts commit 88c4f94.
This doesn't check whether the arguments provided are valid though
Protect eardrums and reduce scares XD.
`SDL_RenderClear()` caused the texture to be the set render color and it'll blend onto whatever that is underneath the scene. (Didn't happen with all colors, but still a problem.
Contributor
Author
|
I'm considering dumping this PR in favor of the pure ECS model.. That is for GameObjects and Systems. Right now the alternative I'm thinking of is to use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the facilities needed to manage Scenes properly.
Instead of placing GameObject, Registries, and Systems right in
main()and "trying to" manage them,Scenesare object which contains everything needed for a particular scenario and blackboards are also easily created.SceneManagerhandles the switching, update and rendering of aScene.Other changes:
GameObjects can be assigned priorities, which makes them render on the top,bottom or in between other objects.GameObjects can be assigned tags, which let's individual objects easy to access.Spritescan also be rotated.TODO:
initfunction, instead the user should be able to provide their own.