From 8123b45e489d19a44e875fd89003575d491d6b06 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 29 May 2024 23:07:31 +0200 Subject: [PATCH] 2024-05-29 23:07 --- html/files.html | 2 +- html/game__mode_8hpp_source.html | 6 +- html/game__root_8hpp_source.html | 6 +- html/game__state_8hpp_source.html | 6 +- html/godot__macros_8hpp_source.html | 131 ++++++++++++++++++++++++++++ html/level_8hpp_source.html | 6 +- html/menudata.js | 5 +- html/player__input_8hpp_source.html | 6 +- html/search/all_6.js | 32 +++---- html/search/searchdata.js | 24 ++--- 10 files changed, 167 insertions(+), 57 deletions(-) create mode 100644 html/godot__macros_8hpp_source.html diff --git a/html/files.html b/html/files.html index eb39841..3cba61a 100644 --- a/html/files.html +++ b/html/files.html @@ -79,7 +79,7 @@ $(function() {  game_mode.hpp  game_root.hpp  game_state.hpp - godot_macros.hC-style preprocessor macros to simplify using godot's C++ API + godot_macros.hpp  level.hpp  player.hpp  player_input.hpp diff --git a/html/game__mode_8hpp_source.html b/html/game__mode_8hpp_source.html index 1b1c802..6626868 100644 --- a/html/game__mode_8hpp_source.html +++ b/html/game__mode_8hpp_source.html @@ -74,8 +74,8 @@ $(function() {
game_mode.hpp
-
1#ifndef GAME_MODE_HPP
-
2#define GAME_MODE_HPP
+
1#ifndef UTILS_GAME_MODE_HPP
+
2#define UTILS_GAME_MODE_HPP
3
4#include <godot_cpp/classes/packed_scene.hpp>
5#include <godot_cpp/classes/resource.hpp>
@@ -97,7 +97,7 @@ $(function() {
26};
27}
28
-
29#endif // !GAME_MODE_HPP
+
29#endif // !UTILS_GAME_MODE_HPP
Stores session-relevant data.
Definition game_mode.hpp:15
gd::Ref< gd::PackedScene > player_scene
The scene to instantiate when spawning a player.
Definition game_mode.hpp:25
virtual void _begin()
Called when the match begins.
Definition game_mode.cpp:13
diff --git a/html/game__root_8hpp_source.html b/html/game__root_8hpp_source.html index 02404cb..fff8bdc 100644 --- a/html/game__root_8hpp_source.html +++ b/html/game__root_8hpp_source.html @@ -74,8 +74,8 @@ $(function() {
game_root.hpp
-
1#ifndef GAME_ROOT_HPP
-
2#define GAME_ROOT_HPP
+
1#ifndef UTILS_GAME_ROOT_HPP
+
2#define UTILS_GAME_ROOT_HPP
3
4#include "game_mode.hpp"
5#include "game_state.hpp"
@@ -159,7 +159,7 @@ $(function() {
146};
147}
148
-
149#endif // !GAME_ROOT_HPP
+
149#endif // !UTILS_GAME_ROOT_HPP
Stores session-relevant data.
Definition game_mode.hpp:15
The root of a game.
Definition game_root.hpp:28
void grab_singleton()
Attempt to make 'this' the current singleton instance.
Definition game_root.cpp:249
diff --git a/html/game__state_8hpp_source.html b/html/game__state_8hpp_source.html index e705f51..1188d5e 100644 --- a/html/game__state_8hpp_source.html +++ b/html/game__state_8hpp_source.html @@ -74,8 +74,8 @@ $(function() {
game_state.hpp
-
1#ifndef GAME_STATE_HPP
-
2#define GAME_STATE_HPP
+
1#ifndef UTILS_GAME_STATE_HPP
+
2#define UTILS_GAME_STATE_HPP
3
4#include <godot_cpp/classes/resource.hpp>
5
@@ -87,7 +87,7 @@ $(function() {
15};
16}
17
-
18#endif // !GAME_STATE_HPP
+
18#endif // !UTILS_GAME_STATE_HPP
Parent class for saved game state.
Definition game_state.hpp:11
diff --git a/html/godot__macros_8hpp_source.html b/html/godot__macros_8hpp_source.html new file mode 100644 index 0000000..e086f2e --- /dev/null +++ b/html/godot__macros_8hpp_source.html @@ -0,0 +1,131 @@ + + + + + + + +godot-cpp-utils: godot_macros.hpp Source File + + + + + + + + + + +
+
+ + + + + + +
+
godot-cpp-utils +
+
A collection of utility classes, functions and macros for use with Godot and GDExtension.
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
godot_macros.hpp
+
+
+
1#ifndef UTILS_GODOT_MACROS_HPP
+
2#define UTILS_GODOT_MACROS_HPP
+
3
+
8#include "godot_cpp/classes/engine.hpp"
+
9#include "godot_cpp/core/class_db.hpp"
+
10#include "godot_cpp/variant/string.hpp"
+
11
+
12
+
13#define MACRO_STRING_INNER(_Arg) #_Arg
+
14#define MACRO_STRING(_Arg) MACRO_STRING_INNER(_Arg)
+
15
+
22#define GDPROPERTY(PropName_, PropType_) \
+
23 godot::ClassDB::bind_method(godot::D_METHOD("get_" #PropName_), &CLASSNAME::get_##PropName_); \
+
24 godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \
+
25 godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_), "set_" #PropName_, "get_" #PropName_)
+
26
+
33#define GDPROPERTY_HINTED(PropName_, PropType_, ...) \
+
34 godot::ClassDB::bind_method(godot::D_METHOD("get_" #PropName_), &CLASSNAME::get_##PropName_); \
+
35 godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \
+
36 godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_, __VA_ARGS__), "set_" #PropName_, "get_" #PropName_)
+
37
+
43#define GDFUNCTION(FnName_) godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)
+
44
+
50#define GDFUNCTION_ARGS(FnName_, ...) godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
+
51
+
57#define GDFUNCTION_STATIC(FnName_) godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)
+
58
+
64#define GDFUNCTION_STATIC_ARGS(FnName_, ...) godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)
+
65
+
69#define GDSIGNAL(...) godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))
+
70
+
76#define GDRESOURCETYPE(Class_) godot::vformat("%s/%s:%s", godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)
+
77
+
83#define GDEDITORONLY() if(!godot::Engine::get_singleton()->is_editor_hint()) return;
+
89#define GDGAMEONLY() if(godot::Engine::get_singleton()->is_editor_hint()) return;
+
90
+
96#define GDENUM(Name_, ...)\
+
97struct Name_ {\
+
98 enum Value {__VA_ARGS__};\
+
99 private:\
+
100 Value value{};\
+
101 public:\
+
102 static inline godot::String get_property_hint() { return godot::String(#__VA_ARGS__); }\
+
103 inline Name_(Value value): value{value} {}\
+
104 inline Name_(Name_ const &value): value{value.value} {}\
+
105}
+
106
+
107#endif // !UTILS_GODOT_MACROS_HPP
+
+ + + + diff --git a/html/level_8hpp_source.html b/html/level_8hpp_source.html index 791d44b..e180c01 100644 --- a/html/level_8hpp_source.html +++ b/html/level_8hpp_source.html @@ -74,8 +74,8 @@ $(function() {
level.hpp
-
1#ifndef LEVEL_HPP
-
2#define LEVEL_HPP
+
1#ifndef UTILS_LEVEL_HPP
+
2#define UTILS_LEVEL_HPP
3
4#include "game_mode.hpp"
5#include <godot_cpp/classes/node3d.hpp>
@@ -94,7 +94,7 @@ $(function() {
22};
23}
24
-
25#endif // !LEVEL_HPP
+
25#endif // !UTILS_LEVEL_HPP
3D level root to be used with GameRoot3D.
Definition level.hpp:14
gd::Ref< GameMode > game_mode_prototype
The starting state of the game mode to instantiate if this is the "leading" level.
Definition level.hpp:21
diff --git a/html/menudata.js b/html/menudata.js index bf1a310..bc5b835 100644 --- a/html/menudata.js +++ b/html/menudata.js @@ -63,7 +63,4 @@ var menudata={children:[ {text:"u",url:"functions_func.html#index_u"}]}, {text:"Variables",url:"functions_vars.html"}]}]}, {text:"Files",url:"files.html",children:[ -{text:"File List",url:"files.html"}, -{text:"File Members",url:"globals.html",children:[ -{text:"All",url:"globals.html"}, -{text:"Macros",url:"globals_defs.html"}]}]}]} +{text:"File List",url:"files.html"}]}]} diff --git a/html/player__input_8hpp_source.html b/html/player__input_8hpp_source.html index 50be70c..02aa647 100644 --- a/html/player__input_8hpp_source.html +++ b/html/player__input_8hpp_source.html @@ -74,8 +74,8 @@ $(function() {
player_input.hpp
-
1#ifndef PLAYER_INPUT_HPP
-
2#define PLAYER_INPUT_HPP
+
1#ifndef UTILS_PLAYER_INPUT_HPP
+
2#define UTILS_PLAYER_INPUT_HPP
3
4#include <optional>
5#include <godot_cpp/classes/input.hpp>
@@ -137,7 +137,7 @@ $(function() {
107}
108
109
-
110#endif // !PLAYER_INPUT_HPP
+
110#endif // !UTILS_PLAYER_INPUT_HPP
An event-driven input observer.
Definition player_input.hpp:18
bool isPrimary
Is this the primary instance.
Definition player_input.hpp:100
void clear_listeners()
Remove all listeners.
Definition player_input.cpp:132
diff --git a/html/search/all_6.js b/html/search/all_6.js index 0f74490..81fef78 100644 --- a/html/search/all_6.js +++ b/html/search/all_6.js @@ -7,26 +7,14 @@ var searchData= ['gamemode_4',['GameMode',['../classutils_1_1GameMode.html',1,'utils']]], ['gameroot3d_5',['GameRoot3D',['../classutils_1_1GameRoot3D.html',1,'utils']]], ['gamestate_6',['GameState',['../classutils_1_1GameState.html',1,'utils']]], - ['gdeditoronly_7',['GDEDITORONLY',['../godot__macros_8h.html#a36c0da7ac54da4b5a5a9fe754e68eaa1',1,'godot_macros.h']]], - ['gdenum_8',['GDENUM',['../godot__macros_8h.html#a069154a04e2e9e1df6cbbec0a0fc8829',1,'godot_macros.h']]], - ['gdfunction_9',['GDFUNCTION',['../godot__macros_8h.html#aec4c8284cb9ea77c97a7037176081801',1,'godot_macros.h']]], - ['gdfunction_5fargs_10',['GDFUNCTION_ARGS',['../godot__macros_8h.html#abb5f0f48b26566dab84ff075fdc9fb4e',1,'godot_macros.h']]], - ['gdfunction_5fstatic_11',['GDFUNCTION_STATIC',['../godot__macros_8h.html#ab1d89a5d5f8e83ed25d64195e8e432b6',1,'godot_macros.h']]], - ['gdfunction_5fstatic_5fargs_12',['GDFUNCTION_STATIC_ARGS',['../godot__macros_8h.html#a26ae27fbaa531f900a2e3a2c339975df',1,'godot_macros.h']]], - ['gdgameonly_13',['GDGAMEONLY',['../godot__macros_8h.html#a33ac9c3bfce05f857cfdd472cb00ca89',1,'godot_macros.h']]], - ['gdproperty_14',['GDPROPERTY',['../godot__macros_8h.html#a3dab0009fb317e0fce558e09edd4964c',1,'godot_macros.h']]], - ['gdproperty_5fhinted_15',['GDPROPERTY_HINTED',['../godot__macros_8h.html#a9e70408fe612616931e2c251eb149114',1,'godot_macros.h']]], - ['gdresourcetype_16',['GDRESOURCETYPE',['../godot__macros_8h.html#ae0818ebba543d3c6e8a61f460509451f',1,'godot_macros.h']]], - ['gdsignal_17',['GDSIGNAL',['../godot__macros_8h.html#abed0b44fb9b7da904a745cd09219ddea',1,'godot_macros.h']]], - ['get_5fgame_5fmode_18',['get_game_mode',['../classutils_1_1GameRoot3D.html#a896b4e4d3b9465a83a10249dbd559662',1,'utils::GameRoot3D']]], - ['get_5fgame_5fstate_19',['get_game_state',['../classutils_1_1GameRoot3D.html#a105011a591cf09368958d4be350ed352',1,'utils::GameRoot3D']]], - ['get_5flast_5fmouse_5fmotion_20',['get_last_mouse_motion',['../classutils_1_1PlayerInput.html#a689cc968b84d6a92c10c541b97e3477e',1,'utils::PlayerInput']]], - ['get_5flevels_21',['get_levels',['../classutils_1_1GameRoot3D.html#aa9ed453a0b416641dfa5154a0b69c79e',1,'utils::GameRoot3D']]], - ['get_5fplayer_22',['get_player',['../classutils_1_1GameRoot3D.html#a27492f37140fa8af6c6955f2147f5521',1,'utils::GameRoot3D']]], - ['get_5fplayer_5fid_23',['get_player_id',['../classutils_1_1IPlayer.html#ad697b5e89246178d99a4c281eaf313af',1,'utils::IPlayer']]], - ['get_5fplayers_24',['get_players',['../classutils_1_1GameRoot3D.html#af176a558f2a3b972c970087c2a1e3d7b',1,'utils::GameRoot3D']]], - ['get_5fsingleton_25',['get_singleton',['../classutils_1_1GameRoot3D.html#ad1c9387dee7919a8ab5d60b19cba2140',1,'utils::GameRoot3D']]], - ['godot_20c_2b_2b_20utilities_26',['Godot C++ Utilities',['../md_README.html',1,'']]], - ['godot_5fmacros_2eh_27',['godot_macros.h',['../godot__macros_8h.html',1,'']]], - ['grab_5fsingleton_28',['grab_singleton',['../classutils_1_1GameRoot3D.html#a0fc164bad77a192ff2209eee18e5104b',1,'utils::GameRoot3D']]] + ['get_5fgame_5fmode_7',['get_game_mode',['../classutils_1_1GameRoot3D.html#a896b4e4d3b9465a83a10249dbd559662',1,'utils::GameRoot3D']]], + ['get_5fgame_5fstate_8',['get_game_state',['../classutils_1_1GameRoot3D.html#a105011a591cf09368958d4be350ed352',1,'utils::GameRoot3D']]], + ['get_5flast_5fmouse_5fmotion_9',['get_last_mouse_motion',['../classutils_1_1PlayerInput.html#a689cc968b84d6a92c10c541b97e3477e',1,'utils::PlayerInput']]], + ['get_5flevels_10',['get_levels',['../classutils_1_1GameRoot3D.html#aa9ed453a0b416641dfa5154a0b69c79e',1,'utils::GameRoot3D']]], + ['get_5fplayer_11',['get_player',['../classutils_1_1GameRoot3D.html#a27492f37140fa8af6c6955f2147f5521',1,'utils::GameRoot3D']]], + ['get_5fplayer_5fid_12',['get_player_id',['../classutils_1_1IPlayer.html#ad697b5e89246178d99a4c281eaf313af',1,'utils::IPlayer']]], + ['get_5fplayers_13',['get_players',['../classutils_1_1GameRoot3D.html#af176a558f2a3b972c970087c2a1e3d7b',1,'utils::GameRoot3D']]], + ['get_5fsingleton_14',['get_singleton',['../classutils_1_1GameRoot3D.html#ad1c9387dee7919a8ab5d60b19cba2140',1,'utils::GameRoot3D']]], + ['godot_20c_2b_2b_20utilities_15',['Godot C++ Utilities',['../md_README.html',1,'']]], + ['grab_5fsingleton_16',['grab_singleton',['../classutils_1_1GameRoot3D.html#a0fc164bad77a192ff2209eee18e5104b',1,'utils::GameRoot3D']]] ]; diff --git a/html/search/searchdata.js b/html/search/searchdata.js index 866c8b6..9acf566 100644 --- a/html/search/searchdata.js +++ b/html/search/searchdata.js @@ -2,32 +2,26 @@ var indexSectionsWithContent = { 0: "_acdefghilnprstu", 1: "gilps", - 2: "g", - 3: "_cefghilprstu", - 4: "acdfgilnprs", - 5: "g", - 6: "g" + 2: "_cefghilprstu", + 3: "acdfgilnprs", + 4: "g" }; var indexSectionNames = { 0: "all", 1: "classes", - 2: "files", - 3: "functions", - 4: "variables", - 5: "defines", - 6: "pages" + 2: "functions", + 3: "variables", + 4: "pages" }; var indexSectionLabels = { 0: "All", 1: "Classes", - 2: "Files", - 3: "Functions", - 4: "Variables", - 5: "Macros", - 6: "Pages" + 2: "Functions", + 3: "Variables", + 4: "Pages" };