Skip to content
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

Fix unused resources clean up to keep resources used in effects #5560

Merged
merged 8 commits into from
Aug 16, 2023

Conversation

D8H
Copy link
Collaborator

@D8H D8H commented Aug 11, 2023

Changes

  • Extracted Project::ExposeResources into ResourceExposer and make it use ProjectBrowserHelper.
  • Expose object and layer effect resources (unit tested).

@D8H D8H changed the title Refactor Project::ExposeResources to use ProjectBrowserHelper Fix unused resources clean up to keep resources used in effects Aug 14, 2023
@D8H D8H marked this pull request as ready for review August 14, 2023 17:23
@D8H D8H requested a review from 4ian as a code owner August 14, 2023 17:23
Copy link
Collaborator

@ClementPasteau ClementPasteau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as the tests are clean, but I'll let 4ian approve this one on the logic side

ExposeVideo(resourceName);
return;
}
gd::LogWarning("Unexpected resource type: " + resourceType + " for: " + resourceName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a LogError? This feels more important than just a warning to me

REQUIRE(worker.bitmapFonts.size() == 1);
REQUIRE(worker.bitmapFonts[0] == "res3");
REQUIRE(worker.images.size() == 1);
REQUIRE(worker.images[0] == "res1");
REQUIRE(worker.audios.size() == 1);
REQUIRE(worker.audios[0] == "res4");
}

SECTION("Can find resource usage in external events") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love the tests

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, nice and clear

@D8H D8H merged commit 6a26e2c into master Aug 16, 2023
5 checks passed
@D8H D8H deleted the layout-resources branch August 16, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants