-
Notifications
You must be signed in to change notification settings - Fork 793
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
Global resource tracking #7191
Open
glebm
wants to merge
2
commits into
diasurgical:master
Choose a base branch
from
glebm:clx-store
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Global resource tracking #7191
Conversation
This file contains 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
glebm
force-pushed
the
clx-store
branch
4 times, most recently
from
August 5, 2024 20:59
34e83f8
to
ad38d72
Compare
auto-merge was automatically disabled
August 5, 2024 21:03
Pull request was converted to draft
glebm
force-pushed
the
clx-store
branch
10 times, most recently
from
August 6, 2024 08:33
c661fb6
to
eae7353
Compare
glebm
added a commit
to glebm/devilutionX
that referenced
this pull request
Aug 6, 2024
glebm
added a commit
that referenced
this pull request
Aug 6, 2024
Keeps track of all the currently loaded resources (currently only sprites but can be extended to sounds). This should eventually allow Lua to access them by name. Not sure if name-based access to currently-loaded sprites is something that we'll ever want (might be too unstructured), but at least this is useful for debugging sprite issues. If this only ends up useful for debugging, we can add a couple of `ifdefs` to only keep track of the sprites in debug mode.
This is neat to have in debug builds and is easy to get rid of if we want to in the future, so I'm marking this a ready for review. |
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.
Keeps track of all the currently loaded sprites. Can be extended in the future to also keep track of sounds.
This does introduce some overhead (timedemo goes from 6.4s to 6.9s on my machine), so we currently only enable it in debug builds.
If we ever want to revert this, it's as simple as removing all the
/#ifdef DEVILUTIONX_RESOURCE_TRACKING_ENABLED.*?#endif/
blocks.Sprites from the screenshot above (
dev.resources.listLoaded()
):