mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Initialize class/struct variables with default values in modules/
This commit is contained in:
parent
57e2822a05
commit
f7209b459b
100 changed files with 533 additions and 772 deletions
|
|
@ -51,8 +51,8 @@ struct NativeScriptDesc {
|
|||
struct Method {
|
||||
godot_nativescript_instance_method method;
|
||||
MethodInfo info;
|
||||
int rpc_mode;
|
||||
uint16_t rpc_method_id;
|
||||
int rpc_mode = 0;
|
||||
uint16_t rpc_method_id = 0;
|
||||
String documentation;
|
||||
};
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ struct NativeScriptDesc {
|
|||
godot_nativescript_property_get_func getter;
|
||||
PropertyInfo info;
|
||||
Variant default_value;
|
||||
int rset_mode;
|
||||
int rset_mode = 0;
|
||||
uint16_t rset_property_id;
|
||||
String documentation;
|
||||
};
|
||||
|
|
@ -78,7 +78,7 @@ struct NativeScriptDesc {
|
|||
Map<StringName, Signal> signals_; // QtCreator doesn't like the name signals
|
||||
StringName base;
|
||||
StringName base_native_type;
|
||||
NativeScriptDesc *base_data;
|
||||
NativeScriptDesc *base_data = nullptr;
|
||||
godot_nativescript_instance_create_func create_func;
|
||||
godot_nativescript_instance_destroy_func destroy_func;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ struct NativeScriptDesc {
|
|||
|
||||
const void *type_tag = nullptr;
|
||||
|
||||
bool is_tool;
|
||||
bool is_tool = false;
|
||||
|
||||
inline NativeScriptDesc() {
|
||||
zeromem(&create_func, sizeof(godot_nativescript_instance_create_func));
|
||||
|
|
@ -254,7 +254,7 @@ class NativeScriptLanguage : public ScriptLanguage {
|
|||
|
||||
private:
|
||||
static NativeScriptLanguage *singleton;
|
||||
int lang_idx;
|
||||
int lang_idx = 0;
|
||||
|
||||
void _unload_stuff(bool p_reload = false);
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ private:
|
|||
#ifndef NO_THREADS
|
||||
Set<Ref<GDNativeLibrary>> libs_to_init;
|
||||
Set<NativeScript *> scripts_to_register;
|
||||
volatile bool has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed
|
||||
volatile bool has_objects_to_register = false; // so that we don't lock mutex every frame - it's rarely needed
|
||||
void defer_init_library(Ref<GDNativeLibrary> lib, NativeScript *script);
|
||||
#endif
|
||||
|
||||
|
|
@ -279,19 +279,19 @@ private:
|
|||
|
||||
struct ProfileData {
|
||||
StringName signature;
|
||||
uint64_t call_count;
|
||||
uint64_t self_time;
|
||||
uint64_t total_time;
|
||||
uint64_t frame_call_count;
|
||||
uint64_t frame_self_time;
|
||||
uint64_t frame_total_time;
|
||||
uint64_t last_frame_call_count;
|
||||
uint64_t last_frame_self_time;
|
||||
uint64_t last_frame_total_time;
|
||||
uint64_t call_count = 0;
|
||||
uint64_t self_time = 0;
|
||||
uint64_t total_time = 0;
|
||||
uint64_t frame_call_count = 0;
|
||||
uint64_t frame_self_time = 0;
|
||||
uint64_t frame_total_time = 0;
|
||||
uint64_t last_frame_call_count = 0;
|
||||
uint64_t last_frame_self_time = 0;
|
||||
uint64_t last_frame_total_time = 0;
|
||||
};
|
||||
|
||||
Map<StringName, ProfileData> profile_data;
|
||||
bool profiling;
|
||||
bool profiling = false;
|
||||
|
||||
public:
|
||||
// These two maps must only be touched on the main thread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue