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

1.13 anvil #124

Merged
merged 2 commits into from
Oct 22, 2019
Merged

1.13 anvil #124

merged 2 commits into from
Oct 22, 2019

Conversation

TheDuckCow
Copy link
Contributor

Textures are exported faster now due to:

  1. Only exporting norm or spec maps if the file is known to exist in the zip file ahead of time (a memory copy of the zip contents is made up front, so that the zip file is opened once, instead of always opening a new zip stream even if the texture does not exist)
  2. By switching to directly loading the asset from the zip file instead of iterating over all files in the zip until a path matches (ie using getEntry(imagePath) instead of a loop of getNextEntry())
  3. By skipping image sets where the default diffuse image is not present at all, whereas before if there was an error in loading the default diffuse image, it will still attempt to continue with the following operations. This is done via the continue line here.

I did some tests on some local resource packs, ones with and without normal/spec, and compared the output (ie number of files in the texture output folder and matching names) against the most recently released code, but worth checking on some more packs or doing your own spot checks.

This is in response to the issue thread here: #122

Textures are exported faster now due to 1) only exporting norm or spec maps if the file is known to exist in the zip file ahead of time (a memory copy of the zip contents is checked for once inistead of multiple times, 2) by switching to directly loading the asset from the zip file instead of iterating over files in the zip until a path matches, and 3) by skipping (sooner) image sets where the default diffuse image is not present at all, whereas before if there was an error in loading the default diffuse image, it will still attempt to continue with the following operations.
@danijel3
Copy link
Member

Okay, I'll trust you tested everything.

@danijel3 danijel3 merged commit e89fe7d into jmc2obj:1.13Anvil Oct 22, 2019
@TheDuckCow
Copy link
Contributor Author

@danijel3 quick follow up, I see this was merged into the Anvil 1.13 branch, though the master and latest release is up to 1.14 and doesn't have the changes here; just want to make sure this gets included in the next release to make use of this optimization! Will be important for an embedded use case I am working on.

@danijel3
Copy link
Member

I just merged it into master. Is it okay now?

@TheDuckCow
Copy link
Contributor Author

Just ran a local test and confirmed, it's included and running fine. Thanks for the quick response!

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.

2 participants