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

Godot 4.0 adaption (Windows + MacOS) #123

Merged
merged 93 commits into from
Feb 3, 2023
Merged

Conversation

bitbrain
Copy link
Contributor

@bitbrain bitbrain commented Jul 27, 2022

logo_large_monochrome_dark

Goal

This pull request aims to make this addon compatible with Godot 4.0+, relates to #121

Todo list

Currently known issues

  • 🐛 timeline beat signals do not seem to work quite @CedNaru
  • 🐛 missing FMOD_ constants @bitbrain
  • 🐛 iOS build does not work (@2shady4u is investigating this)

Testing

  • test finished branch on WINDOWS (including demo project)
  • test finished branch on MACOS (including demo project)
  • will be done in seperate PR: test finished branch on LINUX (including demo project)
  • will be done in seperate PR: test finished branch on ANDROID (including demo project)
  • will be done in seperate PR: test finished branch on iOS (including demo project)

Additional notes

To work on this PR update the godot-cpp submodule to latest master:

git submodule update --init --recursive

then build this project, e.g.:

# 32bit for Windows
scons target=editor platform=windows arch=x86_32 generate_bindings=yes
# 64bit for Windows
scons target=editor platform=windows arch=x86_64 generate_bindings=yes

@bitbrain bitbrain requested a review from piiertho July 27, 2022 20:22
@bitbrain

This comment was marked as outdated.

src/godot_fmod.h Outdated Show resolved Hide resolved
src/register_types.cpp Outdated Show resolved Hide resolved
src/godot_fmod.cpp Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@piiertho
Copy link
Member

piiertho commented Jul 28, 2022

Hello @bitbrain !
Thanks for starting this big work.
In Godot 4 classes have been renamed for consistency purpose.
ˋTransformis nowTransform3D, but this should not change how we manage between 2D and 3D, we already have distinct methods for this. Spatialhas been renamedNode3D, for consistency with Node2D`.

Edit: maybe this would be a good idea to split 2D and 3D for fmod too, I think this can be done fast using a CRTP. What do you think about this idea @CedNaru ?

src/godot_fmod.cpp Outdated Show resolved Hide resolved
src/helpers/constants.h Outdated Show resolved Hide resolved
@bitbrain
Copy link
Contributor Author

bitbrain commented Jul 28, 2022

Both FIND_AND_CHECK and ERROR_CHECK are currently failing (these macros resolve into invalid syntax) - need to figure out what is causing it.

I also added additional TODOs. For example, the SConstruct file does not seem to work correctly with the new godot-cpp version - it simply fails to discover the includes correctly:

cl /Fosrc\godot_fmod.obj /c src\godot_fmod.cpp /TP /nologo /O2 /EHsc /DNDEBUG /MD /IC:\Users\Miguel\git\fmod-project\godot-cpp\godot-headers /IC:\Users\Miguel\git\fmod-project\godot-cpp\include /IC:\Users\Miguel\git\fmod-project\godot-cpp\include\core /IC:\Users\Miguel\git\fmod-project\godot-cpp\include\gen /IC:\Users\Miguel\git\fmod-project\libs\fmod\windows\core\inc /IC:\Users\Miguel\git\fmod-project\libs\fmod\windows\studio\inc
godot_fmod.cpp
C:\Users\Miguel\git\fmod-project\fmod-gdnative\src\godot_fmod.h(4): fatal error C1083: Cannot open include file: 'godot.hpp': No such file or directory
scons: *** [src\godot_fmod.obj] Error 2
scons: building terminated because of errors.

It doesn't seem to check for the correct godot-cpp\include\godot_cpp path where this file exists:
Capture

SConstruct Outdated Show resolved Hide resolved
@bitbrain

This comment was marked as outdated.

@bitbrain bitbrain mentioned this pull request Jul 29, 2022
15 tasks
@bitbrain

This comment was marked as resolved.

src/godot_fmod.cpp Outdated Show resolved Hide resolved
@bitbrain bitbrain changed the title [WIP] Godot 4.0 adaption Godot 4.0 adaption (Windows + MacOS) Jan 3, 2023
@bitbrain bitbrain marked this pull request as ready for review January 3, 2023 00:42
@bitbrain bitbrain removed need-test-ingame Need to be tested in game need-test-crossplatform labels Jan 3, 2023
@bitbrain
Copy link
Contributor Author

bitbrain commented Jan 3, 2023

Tested this on both Windows and MacOS without issues (apart from the signal issue @CedNaru is looking into)

@@ -391,7 +391,7 @@ bool Fmod::_is_dead(Object* node) {
if (!node) {
return true;
}
return UtilityFunctions::is_instance_valid(Object::cast_to<Node>(node)->get_owner());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@piiertho absolute legend!!!!

@CedNaru CedNaru self-requested a review February 3, 2023 16:17
@bitbrain bitbrain merged commit 5baf5d8 into godot-4.x Feb 3, 2023
@bitbrain bitbrain deleted the godot-4.0-adaption branch February 3, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
godot4 This pull request or feature is meant for Godot 4
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Upgrade to Godot 4.0 (GDExtension)
5 participants