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

Custom FileSystem callbacks #67

Merged
merged 9 commits into from
Jan 28, 2021
Merged

Custom FileSystem callbacks #67

merged 9 commits into from
Jan 28, 2021

Conversation

CedNaru
Copy link
Member

@CedNaru CedNaru commented Jan 26, 2021

Implement #49

This PR implements FMOD filesystem callbacks. They replace the default behavior of FMOD when it tries to open files. Now, Godot will be the one opening the files and sending their content to FMOD.
With this, it's possible to open any file as you would normally do with Godot. Exported projects should work as well, it's no longer necessary to have the files next to the game executable, the pck file is enough.

When exporting a project, don't forget to add .bank and .ogg files in the options, otherwise Godot won't include them.
A draft, for now, I need to properly test that on Android and tidy the code a little.

@CedNaru CedNaru marked this pull request as ready for review January 27, 2021 09:53
@CedNaru CedNaru requested a review from piiertho January 27, 2021 09:53
@CedNaru
Copy link
Member Author

CedNaru commented Jan 27, 2021

I confirm that it properly runs on Android.

src/callback/file_callbacks.cpp Show resolved Hide resolved
src/callback/file_callbacks.h Show resolved Hide resolved
src/callback/file_callbacks.cpp Outdated Show resolved Hide resolved
src/gdlibrary.cpp Outdated Show resolved Hide resolved
src/callback/event_callbacks.cpp Show resolved Hide resolved
@piiertho
Copy link
Member

Only few changes but overall looks good !

@CedNaru CedNaru requested a review from piiertho January 27, 2021 18:30
@CedNaru CedNaru merged commit 4572b6f into master Jan 28, 2021
}

extern "C" void GDN_EXPORT fmod_gdnative_terminate(godot_gdnative_terminate_options *o){
delete Callbacks::GodotFileRunner::get_singleton();
Copy link
Member

Choose a reason for hiding this comment

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

Approved too quickly, singleton is now on stack

@piiertho piiertho deleted the feature/filesystem branch February 18, 2021 18:55
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