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

Reduce code duplication in FileAccess #92167

Conversation

BlueCube3310
Copy link
Contributor

#84107 added a lot of duplicate code to FileAccess classes. This PR moves most of that into the base FileAccess.
The child classes now only have to override the get_buffer and store_buffer virtual methods to function properly, while the rest is handled by the base class.

This needs testing on all platforms, but it should work without issues.

@BlueCube3310 BlueCube3310 force-pushed the file-access-the-final-season-part3-ep2 branch from b289773 to 71bce19 Compare May 20, 2024 16:33
@AThousandShips AThousandShips added this to the 4.x milestone May 20, 2024
@bruvzg bruvzg self-requested a review May 21, 2024 10:59
@BlueCube3310 BlueCube3310 marked this pull request as ready for review June 8, 2024 09:31
@BlueCube3310 BlueCube3310 requested review from a team as code owners June 8, 2024 09:31
Copy link
Member

@lawnjelly lawnjelly left a comment

Choose a reason for hiding this comment

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

This looks great from a quick look.

The FileAccess classes were a mess and moving everything possible to base classes, and simplifying the derived classes makes sense imo (providing there are no downsides in some of the more esoteric versions like zip).

Could do with a secondary review and obviously lots of testing.

This is something I would like to do in 3.x too, along with adding caching in the wrapper, which speeds up loading by 2-3x in practice (OS caching doesn't appear very good in my tests when I last looked at this).

Copy link
Contributor

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

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

The Android logic looks good, and from a quick round of testing, it doesn't seem to introduce any regressions on Android.

@clayjohn clayjohn modified the milestones: 4.x, 4.4 Sep 1, 2024
@akien-mga
Copy link
Member

Should be good to merge soon for 4.4. I'd suggest a rebase for good measure though.

@BlueCube3310 BlueCube3310 force-pushed the file-access-the-final-season-part3-ep2 branch from 71bce19 to 205a10e Compare September 1, 2024 10:45
@akien-mga akien-mga merged commit 527c716 into godotengine:master Sep 2, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@BlueCube3310 BlueCube3310 deleted the file-access-the-final-season-part3-ep2 branch November 28, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants