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

navmesh io and compression fix #39

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

kasuriax8
Copy link
Contributor

two fixes for navmesh files:

  1. files were not being truncated prior to writing (vnavmesh/NavmeshManager.cs)
  2. brotli compression is now applied to navmesh cache files (vnavmesh/Navmesh.cs) (around 85% reduction in file size)

using var decompressedReader = new BinaryReader(decompressedStream);

var mesh = DeserializeMesh(decompressedReader);
var volume = DeserializeVolume(decompressedReader);
Copy link
Owner

Choose a reason for hiding this comment

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

Oh wow, that's a good catch - so (de)compress streams were created, but not used, lol.

Is there a reason why you did it this way (with extra memory buffer) rather than just passing compressedReader / compressedWriter to the (de)serialize functions?

Copy link
Owner

Choose a reason for hiding this comment

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

Just tried it locally and it seems to work as well btw...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, good catch, i believe i had that before files were truncated to prevent errors

@awgil awgil merged commit 64f2594 into awgil:master Aug 18, 2024
@awgil
Copy link
Owner

awgil commented Aug 18, 2024

Thanks a ton for noticing this!

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