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
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
c0c87ea
:construction: initial setup, includes and gdscript not adjusted yet
bitbrain Jul 27, 2022
bf5db0f
adjust includes
bitbrain Jul 27, 2022
8f21002
more header fixes
bitbrain Jul 27, 2022
094e8f6
fix up godot_fmod.cpp
bitbrain Jul 27, 2022
f06097c
:bug: copy-paste mistake in header file
bitbrain Jul 27, 2022
1b79601
:bug: more fixes
bitbrain Jul 27, 2022
63e4bae
Update README.md (WIP)
bitbrain Jul 27, 2022
2857401
:bug: more compilation fixes
bitbrain Jul 28, 2022
c8ea76c
:bug: some more progress
bitbrain Jul 28, 2022
f25a709
:bug: fix alloc_c_string and map access
bitbrain Jul 29, 2022
e2c62b8
:bug: more fixes
bitbrain Jul 29, 2022
916d82d
:recycle: improve code style and fix instance check
bitbrain Jul 29, 2022
cd380e1
:recycle: migrate most of gdscript over to Godot 4
bitbrain Jul 30, 2022
fdcda25
Update GUT to Godot 4
bitbrain Jul 30, 2022
4af00de
Merge branch 'godot-4.x' into godot-4.0-adaption
bitbrain Jul 31, 2022
d9cb241
:bug: fix PackedByteArray issue
bitbrain Jul 31, 2022
866c3ee
:bug: temporarily get rid of String cast issue
bitbrain Jul 31, 2022
adcacdc
:boom: delete gdscript Fmod type. Not longer required with GDExtension
bitbrain Jul 31, 2022
b4ce89e
add method descriptions
bitbrain Aug 1, 2022
b50a112
Merge branch 'godot-4.0-adaption' of github.com:utopia-rise/fmod-gdna…
bitbrain Aug 1, 2022
c9a21be
:recycle: change constant binding
bitbrain Aug 1, 2022
afe2697
:bug: fix SConstruct compilation errors on Windows
bitbrain Aug 10, 2022
6aa9257
:bug: fix file callback import and type conversion
bitbrain Aug 10, 2022
aca811b
:boom: migrate to new SConstruct format
bitbrain Aug 11, 2022
f7ff7dc
Update docs
bitbrain Aug 11, 2022
bac6d28
:bug: additional fixes for Gut
bitbrain Aug 11, 2022
bf34b44
Fix SConstruct build
bitbrain Aug 11, 2022
6bcd880
attempt to fix project (does not work)
bitbrain Aug 11, 2022
3855d16
adjust gdextension
bitbrain Aug 11, 2022
570d13e
:bug: fix gdextension file
bitbrain Aug 12, 2022
6be8657
fix remaining issues with Windows
bitbrain Aug 12, 2022
2894958
:sparkles: introduce Fmod singleton
bitbrain Aug 12, 2022
703e124
:bug: solve remaining loading issues for GDExtension
bitbrain Aug 13, 2022
8904b7c
Port Github Actions to gd-extension for Windows, Linux & MacOS
2shady4u Aug 14, 2022
d6e44a0
:bug: fix remaining gdscript errors
bitbrain Aug 14, 2022
f592423
Add Android & iOS compilation to Github Actions
2shady4u Aug 14, 2022
92bf656
temporarily disable filerunner join
bitbrain Aug 14, 2022
07c8530
Add 'godot-4.x'-branch to trigger workflow on push
2shady4u Aug 14, 2022
04e0202
Merge pull request #127 from utopia-rise/godot-4.0-adaption-actions-2
2shady4u Aug 14, 2022
daad9f3
fix further gdscript issues
bitbrain Aug 14, 2022
6bd7326
Merge branch 'godot-4.0-adaption' of github.com:utopia-rise/fmod-gdna…
bitbrain Aug 14, 2022
da1e436
:sparkles: introduce FmodEventEmitter2D
bitbrain Aug 14, 2022
fcfe1b2
expose properties on FmodEventEmitter2D
bitbrain Aug 14, 2022
ff2953a
Pause/Unpause node
bitbrain Aug 15, 2022
8a3ad1a
add FMOD icon
bitbrain Aug 15, 2022
27e6d09
Still broken...
bitbrain Aug 16, 2022
bc97741
fix gdextension loading error
bitbrain Aug 25, 2022
69e73af
fix name of getter
bitbrain Aug 25, 2022
687752b
:bookmark: upgrade Gut
bitbrain Aug 28, 2022
ddcde48
Update GUT again
bitbrain Sep 3, 2022
7ad86d1
Upgrade GUT
bitbrain Sep 10, 2022
110e542
additional fixes (still crashes with Godot 4
bitbrain Sep 10, 2022
c118020
:bug: Godot 4.0 beta1 compatibility fixes
bitbrain Sep 23, 2022
bdadd68
:recycle: add icon and prevent FMOD loading on startup
bitbrain Sep 24, 2022
93197dc
:bug: ensure we only run the FileRunner within the game
bitbrain Sep 24, 2022
965758c
update Gut
bitbrain Oct 8, 2022
d020659
upgrade SConstruct to latest Beta 2
bitbrain Oct 8, 2022
18bd472
attempt to fix Github workflow
bitbrain Oct 8, 2022
221b446
fix gdextension to use editor
bitbrain Oct 8, 2022
d8e452c
manually call _init to fix issues
bitbrain Oct 8, 2022
a8175d0
additional fixes
bitbrain Oct 8, 2022
9a3e331
dirty hack to make autoload work
bitbrain Oct 8, 2022
0862bae
simplify autoload logic
bitbrain Oct 8, 2022
1b5015e
upgrade to latest Godot
bitbrain Oct 14, 2022
1175bf9
Change registered constant names
CedNaru Oct 14, 2022
033b842
Format with new clang format
CedNaru Oct 14, 2022
4cbcbd9
Improve header imports
CedNaru Oct 14, 2022
872f9d7
generate bindings in github actions
CedNaru Oct 14, 2022
5386fec
fix added source directory in Sconstruct
CedNaru Oct 15, 2022
4c8d44f
Try more recent macos version for ios build
CedNaru Oct 15, 2022
5dc5fa5
:bookmark: bump Gut
bitbrain Oct 15, 2022
5f3fc58
update to latest Godot
bitbrain Nov 14, 2022
8ace992
Update Fmod to 2.02.10 to see if it fixes IOS symbol issues
CedNaru Dec 1, 2022
948fc57
Update scons script
CedNaru Dec 1, 2022
68de599
Remove Cocoa
CedNaru Dec 1, 2022
0353ab8
upgrade to latest Gut
bitbrain Dec 5, 2022
1ac8294
Merge branch 'godot-4.0-adaption' of github.com:utopia-rise/fmod-gdna…
bitbrain Dec 5, 2022
9296ea5
:bug: upgrade to latest godot-cpp
bitbrain Dec 30, 2022
587897d
additional fixes
bitbrain Dec 30, 2022
95c886b
Fix Macos build
CedNaru Dec 30, 2022
29b8fe6
Fix Macos build
CedNaru Dec 30, 2022
05f56a8
Fix Macos build
CedNaru Dec 30, 2022
82aadf2
Update fmod.gdextension
bitbrain Jan 2, 2023
f2a23cc
:bug: fix Windows build (32bit)
bitbrain Jan 2, 2023
2239ad6
update fmod.gdextension
bitbrain Jan 3, 2023
af1f674
ignore .exp and .lib
bitbrain Jan 3, 2023
ad96868
:bug: add missing constants
bitbrain Jan 3, 2023
4a0e0b0
:recycle: make naming consistent
bitbrain Jan 3, 2023
904db6a
FmodEventEmitter2D: stop events when exiting tree
bitbrain Jan 3, 2023
e769f22
:bug: use correct filename for MacOS
bitbrain Jan 15, 2023
d1bbfd3
:bookmark: update to latest Godot 4 Beta 14
bitbrain Jan 21, 2023
2b51f80
fix inverted is_dead method
piiertho Jan 31, 2023
61c1c8e
upgrade Godot
bitbrain Feb 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/callback/event_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmod_common.h>
#include <fmod_studio_common.h>
#include <core/Dictionary.hpp>
#include <variant/dictionary.hpp>
#include <mutex>

namespace Callbacks {
Expand Down
19 changes: 0 additions & 19 deletions src/gdlibrary.cpp

This file was deleted.

282 changes: 142 additions & 140 deletions src/godot_fmod.cpp

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions src/godot_fmod.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#ifndef GODOTFMOD_GODOT_FMOD_H
#define GODOTFMOD_GODOT_FMOD_H

#include <Godot.hpp>
#include <GodotGlobal.hpp>
#include <godot.hpp>
#include <classes/global_constants.hpp>
#include <fmod_common.h>
#include <fmod_errors.h>
#include <fmod_studio.hpp>
#include <fmod.hpp>
#include <Spatial.hpp>
bitbrain marked this conversation as resolved.
Show resolved Hide resolved
#include <Object.hpp>
#include <CanvasItem.hpp>
#include <Node.hpp>
#include <gen/Mutex.hpp>
#include <core/object.hpp>
#include <classes/canvas_item.hpp>
#include <classes/node.hpp>
#include <classes/mutex.hpp>
#include "callback/event_callbacks.h"
#include "callback/file_callbacks.h"
#include "helpers/containers.h"
#include "helpers/constants.h"
#include "helpers/current_function.h"
#include <variant/utility_functions.hpp>

#define CUSTOM_FILESYSTEM

Expand Down Expand Up @@ -44,13 +44,13 @@ namespace godot {
#define GODOT_LOG(level, message)\
switch (level) {\
case 0:\
Godot::print(message);\
UtilityFunctions::print(message);\
break;\
case 1:\
Godot::print_warning(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
UtilityFunctions::print(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
bitbrain marked this conversation as resolved.
Show resolved Hide resolved
break;\
case 2:\
Godot::print_error(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
UtilityFunctions::printerr(message, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__);\
break;\
}\

Expand Down Expand Up @@ -95,9 +95,12 @@ namespace godot {
};

class Fmod : public Node {
GODOT_CLASS(Fmod, Node)
GDCLASS(Fmod, Node)
DECLARE_ALL_CONSTANTS

protected:
static void _bind_methods();

private:
FMOD::Studio::System *system;
FMOD::System *coreSystem;
Expand Down Expand Up @@ -161,8 +164,6 @@ namespace godot {

~Fmod();

static void _register_methods();

void _init();
void _process(float delta);
void shutdown();
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef GODOTFMOD_POINTERARRAY_H
#define GODOTFMOD_POINTERARRAY_H

#include <core/Godot.hpp>
#include <core/Array.hpp>
#include <godot.hpp>
#include <variant/array.hpp>
#include "current_function.h"

namespace godot {
Expand Down
42 changes: 42 additions & 0 deletions src/register_types.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "register_types.h"

#include <godot/gdnative_interface.h>

#include <core/class_db.hpp>
#include <core/defs.hpp>
#include <godot.hpp>

#include "godot_fmod.h"

using namespace godot;

void initialize_fmod_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}

Callbacks::GodotFileRunner::get_singleton();
bitbrain marked this conversation as resolved.
Show resolved Hide resolved

ClassDB::register_class<Fmod>();
}

void uninitialize_fmod_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}

extern "C" {

// Initialization.

GDNativeBool GDN_EXPORT fmod_library_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) {
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);

init_obj.register_initializer(initialize_fmod_module);
init_obj.register_terminator(uninitialize_fmod_module);
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);

return init_obj.init();
}
}
11 changes: 11 additions & 0 deletions src/register_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef FMOD_REGISTER_TYPES_H
#define FMOD_REGISTER_TYPES_H

#include <core/class_db.hpp>

using namespace godot;

void initialize_fmod_module(ModuleInitializationLevel p_level);
void uninitialize_fmod_module(ModuleInitializationLevel p_level);

#endif // ! FMOD_REGISTER_TYPES_H