Initialize class/struct variables with default values in platform/ and editor/

This commit is contained in:
Rafał Mikrut 2020-11-24 10:12:55 +01:00
parent d1231be1c8
commit e1811b689b
87 changed files with 411 additions and 540 deletions

View File

@ -89,7 +89,7 @@ public:
struct ConstantDoc { struct ConstantDoc {
String name; String name;
String value; String value;
bool is_value_valid; bool is_value_valid = false;
String enumeration; String enumeration;
String description; String description;
bool operator<(const ConstantDoc &p_const) const { bool operator<(const ConstantDoc &p_const) const {

View File

@ -111,10 +111,10 @@ class AnimationBezierTrackEdit : public Control {
Vector2 menu_insert_key; Vector2 menu_insert_key;
struct AnimMoveRestore { struct AnimMoveRestore {
int track; int track = 0;
float time; float time = 0;
Variant key; Variant key;
float transition; float transition = 0;
}; };
AnimationTrackEditor *editor; AnimationTrackEditor *editor;

View File

@ -44,7 +44,7 @@ class AnimationTrackKeyEdit : public Object {
GDCLASS(AnimationTrackKeyEdit, Object); GDCLASS(AnimationTrackKeyEdit, Object);
public: public:
bool setting; bool setting = false;
bool _hide_script_from_inspector() { bool _hide_script_from_inspector() {
return true; return true;
@ -622,15 +622,15 @@ public:
} }
} }
UndoRedo *undo_redo; UndoRedo *undo_redo = nullptr;
Ref<Animation> animation; Ref<Animation> animation;
int track; int track = -1;
float key_ofs; float key_ofs = 0;
Node *root_path; Node *root_path = nullptr;
PropertyInfo hint; PropertyInfo hint;
NodePath base; NodePath base;
bool use_fps; bool use_fps = false;
void notify_change() { void notify_change() {
_change_notify(); _change_notify();
@ -644,21 +644,13 @@ public:
use_fps = p_enable; use_fps = p_enable;
_change_notify(); _change_notify();
} }
AnimationTrackKeyEdit() {
use_fps = false;
key_ofs = 0;
track = -1;
setting = false;
root_path = nullptr;
}
}; };
class AnimationMultiTrackKeyEdit : public Object { class AnimationMultiTrackKeyEdit : public Object {
GDCLASS(AnimationMultiTrackKeyEdit, Object); GDCLASS(AnimationMultiTrackKeyEdit, Object);
public: public:
bool setting; bool setting = false;
bool _hide_script_from_inspector() { bool _hide_script_from_inspector() {
return true; return true;
@ -1276,11 +1268,11 @@ public:
Map<int, NodePath> base_map; Map<int, NodePath> base_map;
PropertyInfo hint; PropertyInfo hint;
Node *root_path; Node *root_path = nullptr;
bool use_fps; bool use_fps = false;
UndoRedo *undo_redo; UndoRedo *undo_redo = nullptr;
void notify_change() { void notify_change() {
_change_notify(); _change_notify();
@ -1294,12 +1286,6 @@ public:
use_fps = p_enable; use_fps = p_enable;
_change_notify(); _change_notify();
} }
AnimationMultiTrackKeyEdit() {
use_fps = false;
setting = false;
root_path = nullptr;
}
}; };
void AnimationTimelineEdit::_zoom_changed(double) { void AnimationTimelineEdit::_zoom_changed(double) {
@ -4669,10 +4655,10 @@ void AnimationTrackEditor::_move_selection(float p_offset) {
} }
struct _AnimMoveRestore { struct _AnimMoveRestore {
int track; int track = 0;
float time; float time = 0;
Variant key; Variant key;
float transition; float transition = 0;
}; };
//used for undo/redo //used for undo/redo

View File

@ -253,8 +253,8 @@ class AnimationTrackEditGroup : public Control {
Ref<Texture2D> icon; Ref<Texture2D> icon;
String node_name; String node_name;
NodePath node; NodePath node;
Node *root; Node *root = nullptr;
AnimationTimelineEdit *timeline; AnimationTimelineEdit *timeline = nullptr;
void _zoom_changed(); void _zoom_changed();
@ -354,10 +354,10 @@ class AnimationTrackEditor : public VBoxContainer {
struct InsertData { struct InsertData {
Animation::TrackType type; Animation::TrackType type;
NodePath path; NodePath path;
int track_idx; int track_idx = 0;
Variant value; Variant value;
String query; String query;
bool advance; bool advance = false;
}; /* insert_data;*/ }; /* insert_data;*/
Label *insert_confirm_text; Label *insert_confirm_text;
@ -392,13 +392,13 @@ class AnimationTrackEditor : public VBoxContainer {
//selection //selection
struct SelectedKey { struct SelectedKey {
int track; int track = 0;
int key; int key = 0;
bool operator<(const SelectedKey &p_key) const { return track == p_key.track ? key < p_key.key : track < p_key.track; }; bool operator<(const SelectedKey &p_key) const { return track == p_key.track ? key < p_key.key : track < p_key.track; };
}; };
struct KeyInfo { struct KeyInfo {
float pos; float pos = 0;
}; };
Map<SelectedKey, KeyInfo> selection; Map<SelectedKey, KeyInfo> selection;
@ -467,15 +467,15 @@ class AnimationTrackEditor : public VBoxContainer {
struct TrackClipboard { struct TrackClipboard {
NodePath full_path; NodePath full_path;
NodePath base_path; NodePath base_path;
Animation::TrackType track_type; Animation::TrackType track_type = Animation::TrackType::TYPE_ANIMATION;
Animation::InterpolationType interp_type; Animation::InterpolationType interp_type = Animation::InterpolationType::INTERPOLATION_CUBIC;
Animation::UpdateMode update_mode; Animation::UpdateMode update_mode = Animation::UpdateMode::UPDATE_CAPTURE;
bool loop_wrap; bool loop_wrap = false;
bool enabled; bool enabled = false;
struct Key { struct Key {
float time; float time = 0;
float transition; float transition = 0;
Variant value; Variant value;
}; };
Vector<Key> keys; Vector<Key> keys;

View File

@ -60,9 +60,9 @@ class AudioStreamPreviewGenerator : public Node {
Ref<AudioStreamPreview> preview; Ref<AudioStreamPreview> preview;
Ref<AudioStream> base_stream; Ref<AudioStream> base_stream;
Ref<AudioStreamPlayback> playback; Ref<AudioStreamPlayback> playback;
volatile bool generating; volatile bool generating = false;
ObjectID id; ObjectID id;
Thread *thread; Thread *thread = nullptr;
}; };
Map<ObjectID, Preview> previews; Map<ObjectID, Preview> previews;

View File

@ -81,6 +81,8 @@ GotoLineDialog::GotoLineDialog() {
register_text_enter(line); register_text_enter(line);
text_editor = nullptr; text_editor = nullptr;
line_label = nullptr;
set_hide_on_ok(false); set_hide_on_ok(false);
} }

View File

@ -45,27 +45,27 @@ class EditorProfiler : public VBoxContainer {
public: public:
struct Metric { struct Metric {
bool valid; bool valid = false;
int frame_number; int frame_number = 0;
float frame_time; float frame_time = 0;
float idle_time; float idle_time = 0;
float physics_time; float physics_time = 0;
float physics_frame_time; float physics_frame_time = 0;
struct Category { struct Category {
StringName signature; StringName signature;
String name; String name;
float total_time; //total for category float total_time = 0; //total for category
struct Item { struct Item {
StringName signature; StringName signature;
String name; String name;
String script; String script;
int line; int line = 0;
float self; float self = 0;
float total; float total = 0;
int calls; int calls = 0;
}; };
Vector<Item> items; Vector<Item> items;
@ -75,11 +75,6 @@ public:
Map<StringName, Category *> category_ptrs; Map<StringName, Category *> category_ptrs;
Map<StringName, Category::Item *> item_ptrs; Map<StringName, Category::Item *> item_ptrs;
Metric() {
valid = false;
frame_number = 0;
}
}; };
enum DisplayMode { enum DisplayMode {

View File

@ -46,9 +46,9 @@ class EditorVisualProfiler : public VBoxContainer {
public: public:
struct Metric { struct Metric {
bool valid; bool valid = false;
uint64_t frame_number; uint64_t frame_number = 0;
struct Area { struct Area {
String name; String name;
@ -59,10 +59,6 @@ public:
}; };
Vector<Area> areas; Vector<Area> areas;
Metric() {
valid = false;
}
}; };
enum DisplayTimeMode { enum DisplayTimeMode {

View File

@ -626,6 +626,8 @@ DependencyErrorDialog::DependencyErrorDialog() {
vb->add_child(text); vb->add_child(text);
text->set_text(TTR("Which action should be taken?")); text->set_text(TTR("Which action should be taken?"));
mode = Mode::MODE_RESOURCE;
fdep = add_button(TTR("Fix Dependencies"), true, "fixdeps"); fdep = add_button(TTR("Fix Dependencies"), true, "fixdeps");
set_title(TTR("Errors loading!")); set_title(TTR("Errors loading!"));

View File

@ -41,23 +41,23 @@ public:
struct Chart { struct Chart {
Vector<Vector2> vertices; Vector<Vector2> vertices;
struct Face { struct Face {
int vertex[3]; int vertex[3] = { 0 };
}; };
Vector<Face> faces; Vector<Face> faces;
bool can_transpose; bool can_transpose = false;
Vector2 final_offset; Vector2 final_offset;
bool transposed; bool transposed = false;
}; };
private: private:
struct PlottedBitmap { struct PlottedBitmap {
int chart_index; int chart_index = 0;
Vector2i offset; Vector2i offset;
int area; int area = 0;
Vector<int> top_heights; Vector<int> top_heights;
Vector<int> bottom_heights; Vector<int> bottom_heights;
bool transposed; bool transposed = false;
Vector2 final_pos; Vector2 final_pos;

View File

@ -61,13 +61,13 @@ class EditorAudioBus : public PanelContainer {
static const int CHANNELS_MAX = 4; static const int CHANNELS_MAX = 4;
struct { struct {
bool prev_active; bool prev_active = false;
float peak_l; float peak_l = 0;
float peak_r; float peak_r = 0;
TextureProgress *vu_l; TextureProgress *vu_l = nullptr;
TextureProgress *vu_r; TextureProgress *vu_r = nullptr;
} channel[CHANNELS_MAX]; } channel[CHANNELS_MAX];
OptionButton *send; OptionButton *send;
@ -214,9 +214,9 @@ class EditorAudioMeterNotches : public Control {
private: private:
struct AudioNotch { struct AudioNotch {
float relative_position; float relative_position = 0;
float db_value; float db_value = 0;
bool render_db_value; bool render_db_value = false;
_FORCE_INLINE_ AudioNotch(float r_pos, float db_v, bool rndr_val) { _FORCE_INLINE_ AudioNotch(float r_pos, float db_v, bool rndr_val) {
relative_position = r_pos; relative_position = r_pos;

View File

@ -50,20 +50,14 @@ class EditorAutoloadSettings : public VBoxContainer {
struct AutoLoadInfo { struct AutoLoadInfo {
String name; String name;
String path; String path;
bool is_singleton; bool is_singleton = false;
bool in_editor; bool in_editor = false;
int order; int order = 0;
Node *node; Node *node = nullptr;
bool operator==(const AutoLoadInfo &p_info) const { bool operator==(const AutoLoadInfo &p_info) const {
return order == p_info.order; return order == p_info.order;
} }
AutoLoadInfo() {
is_singleton = false;
in_editor = false;
node = nullptr;
}
}; };
List<AutoLoadInfo> autoload_cache; List<AutoLoadInfo> autoload_cache;

View File

@ -47,12 +47,12 @@ class EditorHistory {
REF ref; REF ref;
ObjectID object; ObjectID object;
String property; String property;
bool inspector_only; bool inspector_only = false;
}; };
struct History { struct History {
Vector<Obj> path; Vector<Obj> path;
int level; int level = 0;
}; };
friend class EditorData; friend class EditorData;
@ -109,14 +109,14 @@ public:
}; };
struct EditedScene { struct EditedScene {
Node *root; Node *root = nullptr;
String path; String path;
Dictionary editor_states; Dictionary editor_states;
List<Node *> selection; List<Node *> selection;
Vector<EditorHistory::History> history_stored; Vector<EditorHistory::History> history_stored;
int history_current; int history_current = 0;
Dictionary custom_state; Dictionary custom_state;
uint64_t version; uint64_t version = 0;
NodePath live_edit_root; NodePath live_edit_root;
}; };

View File

@ -169,9 +169,9 @@ public:
private: private:
struct SavedData { struct SavedData {
uint64_t ofs; uint64_t ofs = 0;
uint64_t size; uint64_t size = 0;
bool encrypted; bool encrypted = false;
Vector<uint8_t> md5; Vector<uint8_t> md5;
CharString path_utf8; CharString path_utf8;
@ -181,15 +181,15 @@ private:
}; };
struct PackData { struct PackData {
FileAccess *f; FileAccess *f = nullptr;
Vector<SavedData> file_ofs; Vector<SavedData> file_ofs;
EditorProgress *ep; EditorProgress *ep = nullptr;
Vector<SharedObject> *so_files; Vector<SharedObject> *so_files = nullptr;
}; };
struct ZipData { struct ZipData {
void *zip; void *zip = nullptr;
EditorProgress *ep; EditorProgress *ep = nullptr;
}; };
struct FeatureContainers { struct FeatureContainers {
@ -294,7 +294,7 @@ class EditorExportPlugin : public Reference {
struct ExtraFile { struct ExtraFile {
String path; String path;
Vector<uint8_t> data; Vector<uint8_t> data;
bool remap; bool remap = false;
}; };
Vector<ExtraFile> extra_files; Vector<ExtraFile> extra_files;
bool skipped; bool skipped;

View File

@ -52,12 +52,12 @@ class EditorFileSystemDirectory : public Object {
struct FileInfo { struct FileInfo {
String file; String file;
StringName type; StringName type;
uint64_t modified_time; uint64_t modified_time = 0;
uint64_t import_modified_time; uint64_t import_modified_time = 0;
bool import_valid; bool import_valid = false;
String import_group_file; String import_group_file;
Vector<String> deps; Vector<String> deps;
bool verified; //used for checking changes bool verified = false; //used for checking changes
String script_class_name; String script_class_name;
String script_class_extends; String script_class_extends;
String script_class_icon_path; String script_class_icon_path;
@ -119,18 +119,11 @@ class EditorFileSystem : public Node {
ACTION_FILE_RELOAD ACTION_FILE_RELOAD
}; };
Action action; Action action = ACTION_NONE;
EditorFileSystemDirectory *dir; EditorFileSystemDirectory *dir = nullptr;
String file; String file;
EditorFileSystemDirectory *new_dir; EditorFileSystemDirectory *new_dir = nullptr;
EditorFileSystemDirectory::FileInfo *new_file; EditorFileSystemDirectory::FileInfo *new_file = nullptr;
ItemAction() {
action = ACTION_NONE;
dir = nullptr;
new_dir = nullptr;
new_file = nullptr;
}
}; };
bool use_threads; bool use_threads;
@ -162,10 +155,10 @@ class EditorFileSystem : public Node {
/* Used for reading the filesystem cache file */ /* Used for reading the filesystem cache file */
struct FileCache { struct FileCache {
String type; String type;
uint64_t modification_time; uint64_t modification_time = 0;
uint64_t import_modification_time; uint64_t import_modification_time = 0;
Vector<String> deps; Vector<String> deps;
bool import_valid; bool import_valid = false;
String import_group_file; String import_group_file;
String script_class_name; String script_class_name;
String script_class_extends; String script_class_extends;
@ -175,9 +168,9 @@ class EditorFileSystem : public Node {
HashMap<String, FileCache> file_cache; HashMap<String, FileCache> file_cache;
struct ScanProgress { struct ScanProgress {
float low; float low = 0;
float hi; float hi = 0;
mutable EditorProgressBG *progress; mutable EditorProgressBG *progress = nullptr;
void update(int p_current, int p_total) const; void update(int p_current, int p_total) const;
ScanProgress get_sub(int p_current, int p_total) const; ScanProgress get_sub(int p_current, int p_total) const;
}; };
@ -220,7 +213,7 @@ class EditorFileSystem : public Node {
struct ImportFile { struct ImportFile {
String path; String path;
int order; int order = 0;
bool operator<(const ImportFile &p_if) const { bool operator<(const ImportFile &p_if) const {
return order < p_if.order; return order < p_if.order;
} }

View File

@ -98,7 +98,7 @@ class EditorHelpSearch::Runner : public Reference {
struct ClassMatch { struct ClassMatch {
DocData::ClassDoc *doc; DocData::ClassDoc *doc;
bool name; bool name = false;
Vector<DocData::MethodDoc *> methods; Vector<DocData::MethodDoc *> methods;
Vector<DocData::MethodDoc *> signals; Vector<DocData::MethodDoc *> signals;
Vector<DocData::ConstantDoc *> constants; Vector<DocData::ConstantDoc *> constants;
@ -118,12 +118,12 @@ class EditorHelpSearch::Runner : public Reference {
Ref<Texture2D> empty_icon; Ref<Texture2D> empty_icon;
Color disabled_color; Color disabled_color;
Map<String, DocData::ClassDoc>::Element *iterator_doc; Map<String, DocData::ClassDoc>::Element *iterator_doc = nullptr;
Map<String, ClassMatch> matches; Map<String, ClassMatch> matches;
Map<String, ClassMatch>::Element *iterator_match; Map<String, ClassMatch>::Element *iterator_match = nullptr;
TreeItem *root_item; TreeItem *root_item = nullptr;
Map<String, TreeItem *> class_items; Map<String, TreeItem *> class_items;
TreeItem *matched_item; TreeItem *matched_item = nullptr;
bool _is_class_disabled_by_feature_profile(const StringName &p_class); bool _is_class_disabled_by_feature_profile(const StringName &p_class);

View File

@ -963,6 +963,7 @@ EditorProperty::EditorProperty() {
selected_focusable = -1; selected_focusable = -1;
label_reference = nullptr; label_reference = nullptr;
bottom_editor = nullptr; bottom_editor = nullptr;
delete_hover = false;
} }
//////////////////////////////////////////////// ////////////////////////////////////////////////

View File

@ -176,7 +176,7 @@ class EditorInspectorPlugin : public Reference {
friend class EditorInspector; friend class EditorInspector;
struct AddedEditor { struct AddedEditor {
Control *property_editor; Control *property_editor = nullptr;
Vector<String> properties; Vector<String> properties;
String label; String label;
}; };

View File

@ -107,10 +107,10 @@ public:
String path; String path;
List<String> args; List<String> args;
String output; String output;
Thread *execute_output_thread; Thread *execute_output_thread = nullptr;
Mutex execute_output_mutex; Mutex execute_output_mutex;
int exitcode; int exitcode = 0;
volatile bool done; volatile bool done = false;
}; };
private: private:
@ -409,8 +409,8 @@ private:
struct BottomPanelItem { struct BottomPanelItem {
String name; String name;
Control *control; Control *control = nullptr;
Button *button; Button *button = nullptr;
}; };
Vector<BottomPanelItem> bottom_panel_items; Vector<BottomPanelItem> bottom_panel_items;
@ -554,8 +554,8 @@ private:
struct ExportDefer { struct ExportDefer {
String preset; String preset;
String path; String path;
bool debug; bool debug = false;
bool pack_only; bool pack_only = false;
} export_defer; } export_defer;
bool cmdline_export_mode; bool cmdline_export_mode;

View File

@ -41,7 +41,7 @@
class EditorPropertyNil : public EditorProperty { class EditorPropertyNil : public EditorProperty {
GDCLASS(EditorPropertyNil, EditorProperty); GDCLASS(EditorPropertyNil, EditorProperty);
LineEdit *text; LineEdit *text = nullptr;
public: public:
virtual void update_property() override; virtual void update_property() override;

View File

@ -77,9 +77,9 @@ class EditorResourcePreview : public Node {
struct Item { struct Item {
Ref<Texture2D> preview; Ref<Texture2D> preview;
Ref<Texture2D> small_preview; Ref<Texture2D> small_preview;
int order; int order = 0;
uint32_t last_hash; uint32_t last_hash = 0;
uint64_t modified_time; uint64_t modified_time = 0;
}; };
int order; int order;

View File

@ -35,9 +35,9 @@
class SectionedInspectorFilter : public Object { class SectionedInspectorFilter : public Object {
GDCLASS(SectionedInspectorFilter, Object); GDCLASS(SectionedInspectorFilter, Object);
Object *edited; Object *edited = nullptr;
String section; String section;
bool allow_sub; bool allow_sub = false;
bool _set(const StringName &p_name, const Variant &p_value) { bool _set(const StringName &p_name, const Variant &p_value) {
if (!edited) { if (!edited) {
@ -123,10 +123,6 @@ public:
edited = p_edited; edited = p_edited;
_change_notify(); _change_notify();
} }
SectionedInspectorFilter() {
edited = nullptr;
}
}; };
void SectionedInspector::_bind_methods() { void SectionedInspector::_bind_methods() {

View File

@ -158,10 +158,10 @@ void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_val
struct _EVCSort { struct _EVCSort {
String name; String name;
Variant::Type type; Variant::Type type = Variant::Type::NIL;
int order; int order = 0;
bool save; bool save = false;
bool restart_if_changed; bool restart_if_changed = false;
bool operator<(const _EVCSort &p_vcs) const { return order < p_vcs.order; } bool operator<(const _EVCSort &p_vcs) const { return order < p_vcs.order; }
}; };
@ -1540,8 +1540,8 @@ Ref<Shortcut> ED_GET_SHORTCUT(const String &p_path) {
} }
struct ShortcutMapping { struct ShortcutMapping {
const char *path; const char *path = nullptr;
uint32_t keycode; uint32_t keycode = 0;
}; };
Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode) { Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode) {

View File

@ -47,13 +47,13 @@ class EditorSettings : public Resource {
public: public:
struct Plugin { struct Plugin {
EditorPlugin *instance; EditorPlugin *instance = nullptr;
String path; String path;
String name; String name;
String author; String author;
String version; String version;
String description; String description;
bool installs; bool installs = false;
String script; String script;
Vector<String> install_files; Vector<String> install_files;
}; };

View File

@ -47,11 +47,11 @@ class EditorFileServer : public Object {
}; };
struct ClientData { struct ClientData {
Thread *thread; Thread *thread = nullptr;
Ref<StreamPeerTCP> connection; Ref<StreamPeerTCP> connection;
Map<int, FileAccess *> files; Map<int, FileAccess *> files;
EditorFileServer *efs; EditorFileServer *efs = nullptr;
bool quit; bool quit = false;
}; };
Ref<TCP_Server> server; Ref<TCP_Server> server;

View File

@ -270,8 +270,8 @@ private:
String path; String path;
StringName type; StringName type;
Vector<String> sources; Vector<String> sources;
bool import_broken; bool import_broken = false;
uint64_t modified_time; uint64_t modified_time = 0;
bool operator<(const FileInfo &fi) const { bool operator<(const FileInfo &fi) const {
return NaturalNoCaseComparator()(name, fi.name); return NaturalNoCaseComparator()(name, fi.name);

View File

@ -86,11 +86,6 @@ static bool find_next(const String &line, String pattern, int from, bool match_c
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
FindInFiles::FindInFiles() {
_searching = false;
_whole_words = true;
_match_case = true;
}
void FindInFiles::set_search_text(String p_pattern) { void FindInFiles::set_search_text(String p_pattern) {
_pattern = p_pattern; _pattern = p_pattern;

View File

@ -42,8 +42,6 @@ public:
static const char *SIGNAL_RESULT_FOUND; static const char *SIGNAL_RESULT_FOUND;
static const char *SIGNAL_FINISHED; static const char *SIGNAL_FINISHED;
FindInFiles();
void set_search_text(String p_pattern); void set_search_text(String p_pattern);
void set_whole_words(bool p_whole_word); void set_whole_words(bool p_whole_word);
void set_match_case(bool p_match_case); void set_match_case(bool p_match_case);
@ -76,15 +74,15 @@ private:
String _pattern; String _pattern;
Set<String> _extension_filter; Set<String> _extension_filter;
String _root_dir; String _root_dir;
bool _whole_words; bool _whole_words = true;
bool _match_case; bool _match_case = true;
// State // State
bool _searching; bool _searching = false;
String _current_dir; String _current_dir;
Vector<PackedStringArray> _folders_stack; Vector<PackedStringArray> _folders_stack;
Vector<String> _files_to_scan; Vector<String> _files_to_scan;
int _initial_files_count; int _initial_files_count = 0;
}; };
class LineEdit; class LineEdit;
@ -188,10 +186,10 @@ private:
void _on_replace_all_clicked(); void _on_replace_all_clicked();
struct Result { struct Result {
int line_number; int line_number = 0;
int begin; int begin = 0;
int end; int end = 0;
int begin_trimmed; int begin_trimmed = 0;
}; };
void apply_replaces_in_file(String fpath, const Vector<Result> &locations, String new_text); void apply_replaces_in_file(String fpath, const Vector<Result> &locations, String new_text);

View File

@ -128,7 +128,7 @@ public:
String name; String name;
struct Source { struct Source {
Vector<float> array; Vector<float> array;
int stride; int stride = 0;
}; };
Map<String, Source> sources; Map<String, Source> sources;
@ -142,15 +142,15 @@ public:
struct Primitives { struct Primitives {
struct SourceRef { struct SourceRef {
String source; String source;
int offset; int offset = 0;
}; };
String material; String material;
Map<String, SourceRef> sources; Map<String, SourceRef> sources;
Vector<float> polygons; Vector<float> polygons;
Vector<float> indices; Vector<float> indices;
int count; int count = 0;
int vertex_size; int vertex_size = 0;
}; };
Vector<Primitives> primitives; Vector<Primitives> primitives;
@ -168,7 +168,7 @@ public:
struct Source { struct Source {
Vector<String> sarray; Vector<String> sarray;
Vector<float> array; Vector<float> array;
int stride; int stride = 0;
}; };
Map<String, Source> sources; Map<String, Source> sources;
@ -200,14 +200,14 @@ public:
struct Weights { struct Weights {
struct SourceRef { struct SourceRef {
String source; String source;
int offset; int offset = 0;
}; };
String material; String material;
Map<String, SourceRef> sources; Map<String, SourceRef> sources;
Vector<float> sets; Vector<float> sets;
Vector<float> indices; Vector<float> indices;
int count; int count = 0;
} weights; } weights;
Map<String, Transform> bone_rest_map; Map<String, Transform> bone_rest_map;
@ -242,8 +242,8 @@ public:
Color color; Color color;
int uid = 0; int uid = 0;
struct Weight { struct Weight {
int bone_idx; int bone_idx = 0;
float weight; float weight = 0;
bool operator<(const Weight w) const { return weight > w.weight; } //heaviest first bool operator<(const Weight w) const { return weight > w.weight; } //heaviest first
}; };
@ -331,7 +331,7 @@ public:
}; };
String id; String id;
Op op; Op op = OP_ROTATE;
Vector<float> data; Vector<float> data;
}; };
@ -375,7 +375,7 @@ public:
}; };
struct NodeGeometry : public Node { struct NodeGeometry : public Node {
bool controller; bool controller = false;
String source; String source;
struct Material { struct Material {
@ -438,7 +438,7 @@ public:
TYPE_MATRIX TYPE_MATRIX
}; };
float time; float time = 0;
Vector<float> data; Vector<float> data;
Point2 in_tangent; Point2 in_tangent;
Point2 out_tangent; Point2 out_tangent;
@ -463,10 +463,10 @@ public:
float unit_scale = 1.0; float unit_scale = 1.0;
Vector3::Axis up_axis = Vector3::AXIS_Y; Vector3::Axis up_axis = Vector3::AXIS_Y;
bool z_up; bool z_up = false;
struct Version { struct Version {
int major, minor, rev; int major = 0, minor = 0, rev = 0;
bool operator<(const Version &p_ver) const { return (major == p_ver.major) ? ((minor == p_ver.minor) ? (rev < p_ver.rev) : minor < p_ver.minor) : major < p_ver.major; } bool operator<(const Version &p_ver) const { return (major == p_ver.major) ? ((minor == p_ver.minor) ? (rev < p_ver.rev) : minor < p_ver.minor) : major < p_ver.major; }
Version(int p_major = 0, int p_minor = 0, int p_rev = 0) { Version(int p_major = 0, int p_minor = 0, int p_rev = 0) {

View File

@ -46,29 +46,24 @@
struct ColladaImport { struct ColladaImport {
Collada collada; Collada collada;
Node3D *scene; Node3D *scene = nullptr;
Vector<Ref<Animation>> animations; Vector<Ref<Animation>> animations;
struct NodeMap { struct NodeMap {
//String path; //String path;
Node3D *node; Node3D *node = nullptr;
int bone; int bone = -1;
List<int> anim_tracks; List<int> anim_tracks;
NodeMap() {
node = nullptr;
bone = -1;
}
}; };
bool found_ambient; bool found_ambient = false;
Color ambient; Color ambient;
bool found_directional; bool found_directional = false;
bool force_make_tangents; bool force_make_tangents = false;
bool apply_mesh_xform_to_vertices; bool apply_mesh_xform_to_vertices = true;
bool use_mesh_builtin_materials; bool use_mesh_builtin_materials = false;
float bake_fps; float bake_fps = 15;
Map<String, NodeMap> node_map; //map from collada node to engine node Map<String, NodeMap> node_map; //map from collada node to engine node
Map<String, String> node_name_map; //map from collada node to engine node Map<String, String> node_name_map; //map from collada node to engine node
@ -98,14 +93,6 @@ struct ColladaImport {
Vector<String> missing_textures; Vector<String> missing_textures;
void _pre_process_lights(Collada::Node *p_node); void _pre_process_lights(Collada::Node *p_node);
ColladaImport() {
found_ambient = false;
found_directional = false;
force_make_tangents = false;
apply_mesh_xform_to_vertices = true;
bake_fps = 15;
}
}; };
Error ColladaImport::_populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) { Error ColladaImport::_populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) {

View File

@ -116,8 +116,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
GLTFNodeIndex fake_joint_parent = -1; GLTFNodeIndex fake_joint_parent = -1;
GLTFLightIndex light = -1; GLTFLightIndex light = -1;
GLTFNode() {}
}; };
struct GLTFBufferView { struct GLTFBufferView {
@ -127,8 +125,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int byte_stride = 0; int byte_stride = 0;
bool indices = false; bool indices = false;
//matrices need to be transformed to this //matrices need to be transformed to this
GLTFBufferView() {}
}; };
struct GLTFAccessor { struct GLTFAccessor {
@ -137,7 +133,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int component_type = 0; int component_type = 0;
bool normalized = false; bool normalized = false;
int count = 0; int count = 0;
GLTFType type; GLTFType type = GLTFType::TYPE_SCALAR;
float min = 0; float min = 0;
float max = 0; float max = 0;
int sparse_count = 0; int sparse_count = 0;
@ -146,8 +142,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int sparse_indices_component_type = 0; int sparse_indices_component_type = 0;
int sparse_values_buffer_view = 0; int sparse_values_buffer_view = 0;
int sparse_values_byte_offset = 0; int sparse_values_byte_offset = 0;
GLTFAccessor() {}
}; };
struct GLTFTexture { struct GLTFTexture {
GLTFImageIndex src_image; GLTFImageIndex src_image;
@ -166,8 +160,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
// Set of unique bone names for the skeleton // Set of unique bone names for the skeleton
Set<String> unique_names; Set<String> unique_names;
GLTFSkeleton() {}
}; };
struct GLTFSkin { struct GLTFSkin {
@ -204,8 +196,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
// The Actual Skin that will be created as a mapping between the IBM's of this skin // The Actual Skin that will be created as a mapping between the IBM's of this skin
// to the generated skeleton for the mesh instances. // to the generated skeleton for the mesh instances.
Ref<Skin> godot_skin; Ref<Skin> godot_skin;
GLTFSkin() {}
}; };
struct GLTFMesh { struct GLTFMesh {
@ -218,8 +208,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
float fov_size = 64; float fov_size = 64;
float zfar = 500; float zfar = 500;
float znear = 0.1; float znear = 0.1;
GLTFCamera() {}
}; };
struct GLTFLight { struct GLTFLight {
@ -229,8 +217,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
float range = Math_INF; float range = Math_INF;
float inner_cone_angle = 0.0f; float inner_cone_angle = 0.0f;
float outer_cone_angle = Math_PI / 4.0; float outer_cone_angle = Math_PI / 4.0;
GLTFLight() {}
}; };
struct GLTFAnimation { struct GLTFAnimation {
@ -264,11 +250,11 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
struct GLTFState { struct GLTFState {
Dictionary json; Dictionary json;
int major_version; int major_version = 0;
int minor_version; int minor_version = 0;
Vector<uint8_t> glb_data; Vector<uint8_t> glb_data;
bool use_named_skin_binds; bool use_named_skin_binds = false;
Vector<GLTFNode *> nodes; Vector<GLTFNode *> nodes;
Vector<Vector<uint8_t>> buffers; Vector<Vector<uint8_t>> buffers;

View File

@ -60,13 +60,9 @@ protected:
Mutex mutex; Mutex mutex;
struct MakeInfo { struct MakeInfo {
int flags; int flags = 0;
String normal_path_for_roughness; String normal_path_for_roughness;
RS::TextureDetectRoughnessChannel channel_for_roughness; RS::TextureDetectRoughnessChannel channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
MakeInfo() {
flags = 0;
channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
}
}; };
Map<StringName, MakeInfo> make_flags; Map<StringName, MakeInfo> make_flags;

View File

@ -38,7 +38,7 @@ class ResourceImporterTextureAtlas : public ResourceImporter {
struct PackData { struct PackData {
Rect2 region; Rect2 region;
bool is_mesh; bool is_mesh = false;
Vector<int> chart_pieces; //one for region, many for mesh Vector<int> chart_pieces; //one for region, many for mesh
Vector<Vector<Vector2>> chart_vertices; //for mesh Vector<Vector<Vector2>> chart_vertices; //for mesh
Ref<Image> image; Ref<Image> image;

View File

@ -38,7 +38,7 @@ class MultiNodeEdit : public Reference {
List<NodePath> nodes; List<NodePath> nodes;
struct PLData { struct PLData {
int uses; int uses = 0;
PropertyInfo info; PropertyInfo info;
}; };

View File

@ -113,9 +113,9 @@ class AnimationPlayerEditor : public VBoxContainer {
int current_option; int current_option;
struct BlendEditor { struct BlendEditor {
AcceptDialog *dialog; AcceptDialog *dialog = nullptr;
Tree *tree; Tree *tree = nullptr;
OptionButton *next; OptionButton *next = nullptr;
} blend_editor; } blend_editor;
@ -131,13 +131,13 @@ class AnimationPlayerEditor : public VBoxContainer {
// Onion skinning. // Onion skinning.
struct { struct {
// Settings. // Settings.
bool enabled; bool enabled = false;
bool past; bool past = false;
bool future; bool future = false;
int steps; int steps = 0;
bool differences_only; bool differences_only = false;
bool force_white_modulate; bool force_white_modulate = false;
bool include_gizmos; bool include_gizmos = false;
int get_needed_capture_count() const { int get_needed_capture_count() const {
// 'Differences only' needs a capture of the present. // 'Differences only' needs a capture of the present.
@ -145,8 +145,8 @@ class AnimationPlayerEditor : public VBoxContainer {
} }
// Rendering. // Rendering.
int64_t last_frame; int64_t last_frame = 0;
int can_overlay; int can_overlay = 0;
Size2 capture_size; Size2 capture_size;
Vector<RID> captures; Vector<RID> captures;
Vector<bool> captures_valid; Vector<bool> captures_valid;

View File

@ -126,10 +126,10 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin {
Vector2 to; Vector2 to;
AnimationNodeStateMachineTransition::SwitchMode mode; AnimationNodeStateMachineTransition::SwitchMode mode;
StringName advance_condition_name; StringName advance_condition_name;
bool advance_condition_state; bool advance_condition_state = false;
bool disabled; bool disabled = false;
bool auto_advance; bool auto_advance = false;
float width; float width = 0;
}; };
Vector<TransitionLine> transition_lines; Vector<TransitionLine> transition_lines;

View File

@ -89,10 +89,10 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog {
PanelContainer *previews_bg; PanelContainer *previews_bg;
struct Preview { struct Preview {
int id; int id = 0;
bool is_video; bool is_video = false;
String video_link; String video_link;
Button *button; Button *button = nullptr;
Ref<Texture2D> image; Ref<Texture2D> image;
}; };
@ -234,12 +234,12 @@ class EditorAssetLibrary : public PanelContainer {
}; };
struct ImageQueue { struct ImageQueue {
bool active; bool active = false;
int queue_id; int queue_id = 0;
ImageType image_type; ImageType image_type = ImageType::IMAGE_QUEUE_ICON;
int image_index; int image_index = 0;
String image_url; String image_url;
HTTPRequest *request; HTTPRequest *request = nullptr;
ObjectID target; ObjectID target;
}; };

View File

@ -288,9 +288,9 @@ private:
MenuOption last_option; MenuOption last_option;
struct _SelectResult { struct _SelectResult {
CanvasItem *item; CanvasItem *item = nullptr;
float z_index; float z_index = 0;
bool has_z; bool has_z = true;
_FORCE_INLINE_ bool operator<(const _SelectResult &p_rr) const { _FORCE_INLINE_ bool operator<(const _SelectResult &p_rr) const {
return has_z && p_rr.has_z ? p_rr.z_index < z_index : p_rr.has_z; return has_z && p_rr.has_z ? p_rr.z_index < z_index : p_rr.has_z;
} }
@ -308,8 +308,6 @@ private:
Transform2D xform; Transform2D xform;
float length = 0.f; float length = 0.f;
uint64_t last_pass = 0; uint64_t last_pass = 0;
BoneList() {}
}; };
uint64_t bone_last_frame; uint64_t bone_last_frame;
@ -331,7 +329,7 @@ private:
struct PoseClipboard { struct PoseClipboard {
Vector2 pos; Vector2 pos;
Vector2 scale; Vector2 scale;
float rot; float rot = 0;
ObjectID id; ObjectID id;
}; };
List<PoseClipboard> pose_clipboard; List<PoseClipboard> pose_clipboard;

View File

@ -563,6 +563,8 @@ CollisionShape2DEditor::CollisionShape2DEditor(EditorNode *p_editor) {
edit_handle = -1; edit_handle = -1;
pressed = false; pressed = false;
shape_type = 0;
} }
void CollisionShape2DEditorPlugin::edit(Object *p_obj) { void CollisionShape2DEditorPlugin::edit(Object *p_obj) {

View File

@ -90,7 +90,7 @@ class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2; RID light2;
RID light_instance2; RID light_instance2;
RID camera; RID camera;
mutable volatile bool preview_done; mutable volatile bool preview_done = false;
void _preview_done(const Variant &p_udata); void _preview_done(const Variant &p_udata);
@ -134,7 +134,7 @@ class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2; RID light2;
RID light_instance2; RID light_instance2;
RID camera; RID camera;
mutable volatile bool preview_done; mutable volatile bool preview_done = false;
void _preview_done(const Variant &p_udata); void _preview_done(const Variant &p_udata);
@ -156,7 +156,7 @@ class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator {
RID viewport_texture; RID viewport_texture;
RID canvas; RID canvas;
RID canvas_item; RID canvas_item;
mutable volatile bool preview_done; mutable volatile bool preview_done = false;
void _preview_done(const Variant &p_udata); void _preview_done(const Variant &p_udata);

View File

@ -301,4 +301,6 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
mesh_library_editor->set_anchors_and_margins_preset(Control::PRESET_TOP_WIDE); mesh_library_editor->set_anchors_and_margins_preset(Control::PRESET_TOP_WIDE);
mesh_library_editor->set_end(Point2(0, 22)); mesh_library_editor->set_end(Point2(0, 22));
mesh_library_editor->hide(); mesh_library_editor->hide();
editor = nullptr;
} }

View File

@ -61,16 +61,10 @@ public:
Ref<Material> material; Ref<Material> material;
Ref<SkinReference> skin_reference; Ref<SkinReference> skin_reference;
RID skeleton; RID skeleton;
bool billboard; bool billboard = false;
bool unscaled; bool unscaled = false;
bool can_intersect; bool can_intersect = false;
bool extra_margin; bool extra_margin = false;
Instance() {
billboard = false;
unscaled = false;
can_intersect = false;
extra_margin = false;
}
void create_instance(Node3D *p_base, bool p_hidden = false); void create_instance(Node3D *p_base, bool p_hidden = false);
}; };
@ -80,7 +74,7 @@ public:
struct Handle { struct Handle {
Vector3 pos; Vector3 pos;
bool billboard; bool billboard = false;
}; };
Vector<Vector3> handles; Vector<Vector3> handles;
@ -296,9 +290,9 @@ private:
Label *fps_label; Label *fps_label;
struct _RayResult { struct _RayResult {
Node3D *item; Node3D *item = nullptr;
float depth; float depth = 0;
int handle; int handle = 0;
_FORCE_INLINE_ bool operator<(const _RayResult &p_rr) const { return depth < p_rr.depth; } _FORCE_INLINE_ bool operator<(const _RayResult &p_rr) const { return depth < p_rr.depth; }
}; };
@ -375,11 +369,11 @@ private:
Vector3 click_ray_pos; Vector3 click_ray_pos;
Vector3 center; Vector3 center;
Vector3 orig_gizmo_pos; Vector3 orig_gizmo_pos;
int edited_gizmo; int edited_gizmo = 0;
Point2 mouse_pos; Point2 mouse_pos;
bool snap; bool snap = false;
Ref<EditorNode3DGizmo> gizmo; Ref<EditorNode3DGizmo> gizmo;
int gizmo_handle; int gizmo_handle = 0;
Variant gizmo_initial_value; Variant gizmo_initial_value;
Vector3 gizmo_initial_pos; Vector3 gizmo_initial_pos;
} _edit; } _edit;
@ -625,8 +619,8 @@ private:
AABB preview_bounds; AABB preview_bounds;
struct Gizmo { struct Gizmo {
bool visible; bool visible = false;
float scale; float scale = 0;
Transform transform; Transform transform;
} gizmo; } gizmo;

View File

@ -290,6 +290,8 @@ void Path3DGizmo::redraw() {
Path3DGizmo::Path3DGizmo(Path3D *p_path) { Path3DGizmo::Path3DGizmo(Path3D *p_path) {
path = p_path; path = p_path;
set_spatial_node(p_path); set_spatial_node(p_path);
orig_in_length = 0;
orig_out_length = 0;
} }
bool Path3DEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { bool Path3DEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {

View File

@ -234,15 +234,15 @@ static bool _is_built_in_script(Script *p_script) {
class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache { class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache {
struct Cache { struct Cache {
uint64_t time_loaded; uint64_t time_loaded = 0;
RES cache; RES cache;
}; };
Map<String, Cache> cached; Map<String, Cache> cached;
public: public:
uint64_t max_time_cache; uint64_t max_time_cache = 5 * 60 * 1000; //minutes, five
int max_cache_size; int max_cache_size = 128;
void cleanup() { void cleanup() {
List<Map<String, Cache>::Element *> to_clean; List<Map<String, Cache>::Element *> to_clean;
@ -292,11 +292,6 @@ public:
return E->get().cache; return E->get().cache;
} }
EditorScriptCodeCompletionCache() {
max_cache_size = 128;
max_time_cache = 5 * 60 * 1000; //minutes, five
}
virtual ~EditorScriptCodeCompletionCache() {} virtual ~EditorScriptCodeCompletionCache() {}
}; };
@ -1723,11 +1718,11 @@ struct _ScriptEditorItemData {
String name; String name;
String sort_key; String sort_key;
Ref<Texture2D> icon; Ref<Texture2D> icon;
int index; int index = 0;
String tooltip; String tooltip;
bool used; bool used = false;
int category; int category = 0;
Node *ref; Node *ref = nullptr;
bool operator<(const _ScriptEditorItemData &id) const { bool operator<(const _ScriptEditorItemData &id) const {
if (category == id.category) { if (category == id.category) {

View File

@ -291,7 +291,7 @@ class ScriptEditor : public PanelContainer {
Vector<Ref<EditorSyntaxHighlighter>> syntax_highlighters; Vector<Ref<EditorSyntaxHighlighter>> syntax_highlighters;
struct ScriptHistory { struct ScriptHistory {
Control *control; Control *control = nullptr;
Variant state; Variant state;
}; };

View File

@ -714,6 +714,8 @@ ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) {
shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE);
button = editor->add_bottom_panel_item(TTR("Shader"), shader_editor); button = editor->add_bottom_panel_item(TTR("Shader"), shader_editor);
button->hide(); button->hide();
_2d = false;
} }
ShaderEditorPlugin::~ShaderEditorPlugin() { ShaderEditorPlugin::~ShaderEditorPlugin() {

View File

@ -264,12 +264,7 @@ void BoneTransformEditor::_update_transform_properties(Transform tform) {
} }
BoneTransformEditor::BoneTransformEditor(Skeleton3D *p_skeleton) : BoneTransformEditor::BoneTransformEditor(Skeleton3D *p_skeleton) :
skeleton(p_skeleton), skeleton(p_skeleton) {
key_button(nullptr),
enabled_checkbox(nullptr),
keyable(false),
toggle_enabled(false),
updating(false) {
undo_redo = EditorNode::get_undo_redo(); undo_redo = EditorNode::get_undo_redo();
} }

View File

@ -47,13 +47,13 @@ class EditorPropertyVector3;
class BoneTransformEditor : public VBoxContainer { class BoneTransformEditor : public VBoxContainer {
GDCLASS(BoneTransformEditor, VBoxContainer); GDCLASS(BoneTransformEditor, VBoxContainer);
EditorInspectorSection *section; EditorInspectorSection *section = nullptr;
EditorPropertyVector3 *translation_property; EditorPropertyVector3 *translation_property = nullptr;
EditorPropertyVector3 *rotation_property; EditorPropertyVector3 *rotation_property = nullptr;
EditorPropertyVector3 *scale_property; EditorPropertyVector3 *scale_property = nullptr;
EditorInspectorSection *transform_section; EditorInspectorSection *transform_section = nullptr;
EditorPropertyTransform *transform_property; EditorPropertyTransform *transform_property = nullptr;
Rect2 background_rects[5]; Rect2 background_rects[5];
@ -62,12 +62,12 @@ class BoneTransformEditor : public VBoxContainer {
UndoRedo *undo_redo; UndoRedo *undo_redo;
Button *key_button; Button *key_button = nullptr;
CheckBox *enabled_checkbox; CheckBox *enabled_checkbox = nullptr;
bool keyable; bool keyable = false;
bool toggle_enabled; bool toggle_enabled = false;
bool updating; bool updating = false;
String label; String label;
@ -128,7 +128,6 @@ class Skeleton3DEditor : public VBoxContainer {
struct BoneInfo { struct BoneInfo {
PhysicalBone3D *physical_bone = nullptr; PhysicalBone3D *physical_bone = nullptr;
Transform relative_rest; // Relative to skeleton node Transform relative_rest; // Relative to skeleton node
BoneInfo() {}
}; };
EditorNode *editor; EditorNode *editor;
@ -136,20 +135,20 @@ class Skeleton3DEditor : public VBoxContainer {
Skeleton3D *skeleton; Skeleton3D *skeleton;
Tree *joint_tree; Tree *joint_tree = nullptr;
BoneTransformEditor *rest_editor; BoneTransformEditor *rest_editor = nullptr;
BoneTransformEditor *pose_editor; BoneTransformEditor *pose_editor = nullptr;
BoneTransformEditor *custom_pose_editor; BoneTransformEditor *custom_pose_editor = nullptr;
MenuButton *options; MenuButton *options = nullptr;
EditorFileDialog *file_dialog; EditorFileDialog *file_dialog = nullptr;
UndoRedo *undo_redo; UndoRedo *undo_redo = nullptr;
void _on_click_option(int p_option); void _on_click_option(int p_option);
void _file_selected(const String &p_file); void _file_selected(const String &p_file);
EditorFileDialog *file_export_lib; EditorFileDialog *file_export_lib = nullptr;
void update_joint_tree(); void update_joint_tree();
void update_editors(); void update_editors();

View File

@ -409,7 +409,7 @@ void TileMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
// In modern C++ this could have been inside its body. // In modern C++ this could have been inside its body.
namespace { namespace {
struct _PaletteEntry { struct _PaletteEntry {
int id; int id = 0;
String name; String name;
bool operator<(const _PaletteEntry &p_rhs) const { bool operator<(const _PaletteEntry &p_rhs) const {

View File

@ -131,8 +131,6 @@ class TileMapEditor : public VBoxContainer {
bool yf = false; bool yf = false;
bool tr = false; bool tr = false;
Vector2 ac; Vector2 ac;
CellOp() {}
}; };
Map<Point2i, CellOp> paint_undo; Map<Point2i, CellOp> paint_undo;
@ -144,8 +142,6 @@ class TileMapEditor : public VBoxContainer {
bool flip_v = false; bool flip_v = false;
bool transpose = false; bool transpose = false;
Point2i autotile_coord; Point2i autotile_coord;
TileData() {}
}; };
List<TileData> copydata; List<TileData> copydata;

View File

@ -49,7 +49,7 @@
struct FloatConstantDef { struct FloatConstantDef {
String name; String name;
float value; float value = 0;
String desc; String desc;
}; };
@ -4062,9 +4062,6 @@ void VisualShaderNodePortPreview::_notification(int p_what) {
void VisualShaderNodePortPreview::_bind_methods() { void VisualShaderNodePortPreview::_bind_methods() {
} }
VisualShaderNodePortPreview::VisualShaderNodePortPreview() {
}
////////////////////////////////// //////////////////////////////////
String VisualShaderConversionPlugin::converts_to() const { String VisualShaderConversionPlugin::converts_to() const {

View File

@ -56,26 +56,26 @@ class VisualShaderGraphPlugin : public Reference {
private: private:
struct InputPort { struct InputPort {
Button *default_input_button; Button *default_input_button = nullptr;
}; };
struct Port { struct Port {
TextureButton *preview_button; TextureButton *preview_button = nullptr;
}; };
struct Link { struct Link {
VisualShader::Type type; VisualShader::Type type = VisualShader::Type::TYPE_MAX;
VisualShaderNode *visual_node; VisualShaderNode *visual_node = nullptr;
GraphNode *graph_node; GraphNode *graph_node = nullptr;
bool preview_visible; bool preview_visible = 0;
int preview_pos; int preview_pos = 0;
Map<int, InputPort> input_ports; Map<int, InputPort> input_ports;
Map<int, Port> output_ports; Map<int, Port> output_ports;
VBoxContainer *preview_box; VBoxContainer *preview_box = nullptr;
LineEdit *uniform_name; LineEdit *uniform_name = nullptr;
OptionButton *const_op; OptionButton *const_op = nullptr;
CodeEdit *expression_edit; CodeEdit *expression_edit = nullptr;
CurveEditor *curve_editor; CurveEditor *curve_editor = nullptr;
}; };
Ref<VisualShader> visual_shader; Ref<VisualShader> visual_shader;
@ -206,16 +206,16 @@ class VisualShaderEditor : public VBoxContainer {
String category; String category;
String type; String type;
String description; String description;
int sub_func; int sub_func = 0;
String sub_func_str; String sub_func_str;
Ref<Script> script; Ref<Script> script;
int mode; int mode = 0;
int return_type; int return_type = 0;
int func; int func = 0;
float value; float value = 0;
bool highend; bool highend = false;
bool is_custom; bool is_custom = false;
int temp_idx; int temp_idx = 0;
AddOption(const String &p_name = String(), const String &p_category = String(), const String &p_sub_category = String(), const String &p_type = String(), const String &p_description = String(), int p_sub_func = -1, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) { AddOption(const String &p_name = String(), const String &p_category = String(), const String &p_sub_category = String(), const String &p_type = String(), const String &p_description = String(), int p_sub_func = -1, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) {
name = p_name; name = p_name;
@ -283,8 +283,8 @@ class VisualShaderEditor : public VBoxContainer {
static VisualShaderEditor *singleton; static VisualShaderEditor *singleton;
struct DragOp { struct DragOp {
VisualShader::Type type; VisualShader::Type type = VisualShader::Type::TYPE_MAX;
int node; int node = 0;
Vector2 from; Vector2 from;
Vector2 to; Vector2 to;
}; };
@ -462,9 +462,9 @@ public:
class VisualShaderNodePortPreview : public Control { class VisualShaderNodePortPreview : public Control {
GDCLASS(VisualShaderNodePortPreview, Control); GDCLASS(VisualShaderNodePortPreview, Control);
Ref<VisualShader> shader; Ref<VisualShader> shader;
VisualShader::Type type; VisualShader::Type type = VisualShader::Type::TYPE_MAX;
int node; int node = 0;
int port; int port = 0;
void _shader_changed(); //must regen void _shader_changed(); //must regen
protected: protected:
void _notification(int p_what); void _notification(int p_what);
@ -473,7 +473,6 @@ protected:
public: public:
virtual Size2 get_minimum_size() const override; virtual Size2 get_minimum_size() const override;
void setup(const Ref<VisualShader> &p_shader, VisualShader::Type p_type, int p_node, int p_port); void setup(const Ref<VisualShader> &p_shader, VisualShader::Type p_type, int p_node, int p_port);
VisualShaderNodePortPreview();
}; };
class VisualShaderConversionPlugin : public EditorResourceConversionPlugin { class VisualShaderConversionPlugin : public EditorResourceConversionPlugin {

View File

@ -43,8 +43,8 @@ class BackgroundProgress : public HBoxContainer {
_THREAD_SAFE_CLASS_ _THREAD_SAFE_CLASS_
struct Task { struct Task {
HBoxContainer *hb; HBoxContainer *hb = nullptr;
ProgressBar *progress; ProgressBar *progress = nullptr;
}; };
Map<String, Task> tasks; Map<String, Task> tasks;
@ -70,9 +70,9 @@ class ProgressDialog : public PopupPanel {
GDCLASS(ProgressDialog, PopupPanel); GDCLASS(ProgressDialog, PopupPanel);
struct Task { struct Task {
String task; String task;
VBoxContainer *vb; VBoxContainer *vb = nullptr;
ProgressBar *progress; ProgressBar *progress = nullptr;
Label *state; Label *state = nullptr;
}; };
HBoxContainer *cancel_hb; HBoxContainer *cancel_hb;
Button *cancel; Button *cancel;

View File

@ -984,13 +984,13 @@ public:
String path; String path;
String icon; String icon;
String main_scene; String main_scene;
uint64_t last_edited; uint64_t last_edited = 0;
bool favorite; bool favorite = false;
bool grayed; bool grayed = false;
bool missing; bool missing = false;
int version; int version = 0;
ProjectListItemControl *control; ProjectListItemControl *control = nullptr;
Item() {} Item() {}
@ -1076,7 +1076,7 @@ private:
}; };
struct ProjectListComparator { struct ProjectListComparator {
FilterOption order_option; FilterOption order_option = FilterOption::EDIT_DATE;
// operator< // operator<
_FORCE_INLINE_ bool operator()(const ProjectList::Item &a, const ProjectList::Item &b) const { _FORCE_INLINE_ bool operator()(const ProjectList::Item &a, const ProjectList::Item &b) const {

View File

@ -49,7 +49,7 @@ class EditorQuickOpen : public ConfirmationDialog {
struct Entry { struct Entry {
String path; String path;
float score; float score = 0;
}; };
struct EntryComparator { struct EntryComparator {

View File

@ -86,8 +86,8 @@ class ScriptCreateDialog : public ConfirmationDialog {
SCRIPT_ORIGIN_EDITOR, SCRIPT_ORIGIN_EDITOR,
}; };
struct ScriptTemplateInfo { struct ScriptTemplateInfo {
int id; int id = 0;
ScriptOrigin origin; ScriptOrigin origin = ScriptOrigin::SCRIPT_ORIGIN_EDITOR;
String dir; String dir;
String name; String name;
String extension; String extension;

View File

@ -42,7 +42,7 @@ private:
Color color; Color color;
String start_key; String start_key;
String end_key; String end_key;
bool line_only; bool line_only = false;
}; };
Vector<ColorRegion> color_regions; Vector<ColorRegion> color_regions;
Map<int, int> color_region_cache; Map<int, int> color_region_cache;

View File

@ -45,7 +45,7 @@ class BindingsGenerator {
struct ConstantInterface { struct ConstantInterface {
String name; String name;
String proxy_name; String proxy_name;
int value; int value = 0;
const DocData::ConstantDoc *const_doc; const DocData::ConstantDoc *const_doc;
ConstantInterface() {} ConstantInterface() {}
@ -75,7 +75,7 @@ class BindingsGenerator {
struct PropertyInterface { struct PropertyInterface {
StringName cname; StringName cname;
String proxy_name; String proxy_name;
int index; int index = 0;
StringName setter; StringName setter;
StringName getter; StringName getter;
@ -480,7 +480,7 @@ class BindingsGenerator {
String im_type_out; // Return type for the C# method declaration. Also used as companion of [unique_siq] String im_type_out; // Return type for the C# method declaration. Also used as companion of [unique_siq]
String im_sig; // Signature for the C# method declaration String im_sig; // Signature for the C# method declaration
String unique_sig; // Unique signature to avoid duplicates in containers String unique_sig; // Unique signature to avoid duplicates in containers
bool editor_only; bool editor_only = false;
InternalCall() {} InternalCall() {}

View File

@ -55,10 +55,10 @@ MonoAssemblyName *new_mono_assembly_name() {
struct AssemblyRefInfo { struct AssemblyRefInfo {
String name; String name;
uint16_t major; uint16_t major = 0;
uint16_t minor; uint16_t minor = 0;
uint16_t build; uint16_t build = 0;
uint16_t revision; uint16_t revision = 0;
}; };
AssemblyRefInfo get_assemblyref_name(MonoImage *p_image, int index) { AssemblyRefInfo get_assemblyref_name(MonoImage *p_image, int index) {

View File

@ -45,22 +45,22 @@ public:
}; };
String name; String name;
Type type; Type type = NAMESPACE_DECL;
}; };
struct ClassDecl { struct ClassDecl {
String name; String name;
String namespace_; String namespace_;
Vector<String> base; Vector<String> base;
bool nested; bool nested = false;
}; };
private: private:
String code; String code;
int idx; int idx = 0;
int line; int line = 0;
String error_str; String error_str;
bool error; bool error = false;
Variant value; Variant value;
Vector<ClassDecl> classes; Vector<ClassDecl> classes;

View File

@ -35,8 +35,8 @@
#include <core/os/keyboard.h> #include <core/os/keyboard.h>
struct _WinTranslatePair { struct _WinTranslatePair {
unsigned int keysym; unsigned int keysym = 0;
unsigned int keycode; unsigned int keycode = 0;
}; };
static _WinTranslatePair _ak_to_keycode[] = { static _WinTranslatePair _ak_to_keycode[] = {

View File

@ -66,10 +66,10 @@ class JavaClass : public Reference {
Map<StringName, Variant> constant_map; Map<StringName, Variant> constant_map;
struct MethodInfo { struct MethodInfo {
bool _static; bool _static = false;
Vector<uint32_t> param_types; Vector<uint32_t> param_types;
Vector<StringName> param_sigs; Vector<StringName> param_sigs;
uint32_t return_type; uint32_t return_type = 0;
jmethodID method; jmethodID method;
}; };

View File

@ -339,6 +339,4 @@ void AudioDriverOpenSL::set_pause(bool p_pause) {
AudioDriverOpenSL::AudioDriverOpenSL() { AudioDriverOpenSL::AudioDriverOpenSL() {
s_ad = this; s_ad = this;
pause = false;
active = false;
} }

View File

@ -38,19 +38,19 @@
#include <SLES/OpenSLES_Android.h> #include <SLES/OpenSLES_Android.h>
class AudioDriverOpenSL : public AudioDriver { class AudioDriverOpenSL : public AudioDriver {
bool active; bool active = false;
Mutex mutex; Mutex mutex;
enum { enum {
BUFFER_COUNT = 2 BUFFER_COUNT = 2
}; };
bool pause; bool pause = false;
uint32_t buffer_size; uint32_t buffer_size = 0;
int16_t *buffers[BUFFER_COUNT]; int16_t *buffers[BUFFER_COUNT] = {};
int32_t *mixdown_buffer; int32_t *mixdown_buffer = nullptr;
int last_free; int last_free = 0;
Vector<int16_t> rec_buffer; Vector<int16_t> rec_buffer;

View File

@ -41,7 +41,7 @@ class RenderingDeviceVulkan;
class DisplayServerAndroid : public DisplayServer { class DisplayServerAndroid : public DisplayServer {
public: public:
struct TouchPos { struct TouchPos {
int id; int id = 0;
Point2 pos; Point2 pos;
}; };
@ -52,12 +52,12 @@ public:
}; };
struct JoypadEvent { struct JoypadEvent {
int device; int device = 0;
int type; int type = 0;
int index; int index = 0;
bool pressed; bool pressed = false;
float value; float value = 0;
int hat; int hat = 0;
}; };
private: private:

View File

@ -205,7 +205,7 @@ static const char *SPLASH_BG_COLOR_PATH = "res/drawable/splash_bg_color.png";
struct LauncherIcon { struct LauncherIcon {
const char *export_path; const char *export_path;
int dimensions; int dimensions = 0;
}; };
static const int icon_densities_count = 6; static const int icon_densities_count = 6;
@ -250,12 +250,12 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
String id; String id;
String name; String name;
String description; String description;
int api_level; int api_level = 0;
}; };
struct APKExportData { struct APKExportData {
zipFile apk; zipFile apk;
EditorProgress *ep; EditorProgress *ep = nullptr;
}; };
Vector<PluginConfig> plugins; Vector<PluginConfig> plugins;

View File

@ -157,11 +157,6 @@ bool FileAccessAndroid::file_exists(const String &p_path) {
return true; return true;
} }
FileAccessAndroid::FileAccessAndroid() {
a = nullptr;
eof = false;
}
FileAccessAndroid::~FileAccessAndroid() { FileAccessAndroid::~FileAccessAndroid() {
close(); close();
} }

View File

@ -39,10 +39,10 @@
class FileAccessAndroid : public FileAccess { class FileAccessAndroid : public FileAccess {
static FileAccess *create_android(); static FileAccess *create_android();
mutable AAsset *a; mutable AAsset *a = nullptr;
mutable size_t len; mutable size_t len = 0;
mutable size_t pos; mutable size_t pos = 0;
mutable bool eof; mutable bool eof = false;
public: public:
static AAssetManager *asset_manager; static AAssetManager *asset_manager;
@ -74,7 +74,6 @@ public:
//static void make_default(); //static void make_default();
FileAccessAndroid();
~FileAccessAndroid(); ~FileAccessAndroid();
}; };

View File

@ -314,6 +314,7 @@ OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_god
#if defined(OPENGL_ENABLED) #if defined(OPENGL_ENABLED)
gl_extensions = nullptr; gl_extensions = nullptr;
use_gl2 = false; use_gl2 = false;
use_16bits_fbo = false;
#endif #endif
#if defined(VULKAN_ENABLED) #if defined(VULKAN_ENABLED)

View File

@ -94,8 +94,8 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
struct IOSExportAsset { struct IOSExportAsset {
String exported_path; String exported_path;
bool is_framework; // framework is anything linked to the binary, otherwise it's a resource bool is_framework = false; // framework is anything linked to the binary, otherwise it's a resource
bool should_embed; bool should_embed = false;
}; };
String _get_additional_plist_content(); String _get_additional_plist_content();
@ -314,9 +314,9 @@ Vector<EditorExportPlatformIOS::ExportArchitecture> EditorExportPlatformIOS::_ge
struct LoadingScreenInfo { struct LoadingScreenInfo {
const char *preset_key; const char *preset_key;
const char *export_name; const char *export_name;
int width; int width = 0;
int height; int height = 0;
bool rotate; bool rotate = false;
}; };
static const LoadingScreenInfo loading_screen_infos[] = { static const LoadingScreenInfo loading_screen_infos[] = {
@ -667,7 +667,7 @@ struct IconInfo {
const char *actual_size_side; const char *actual_size_side;
const char *scale; const char *scale;
const char *unscaled_size; const char *unscaled_size;
bool is_required; bool is_required = false;
}; };
static const IconInfo icon_infos[] = { static const IconInfo icon_infos[] = {
@ -962,7 +962,7 @@ Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler
struct CodesignData { struct CodesignData {
const Ref<EditorExportPreset> &preset; const Ref<EditorExportPreset> &preset;
bool debug; bool debug = false;
CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) : CodesignData(const Ref<EditorExportPreset> &p_preset, bool p_debug) :
preset(p_preset), preset(p_preset),

View File

@ -56,7 +56,7 @@ typedef GLXContext (*GLXCREATECONTEXTATTRIBSARBPROC)(Display *, GLXFBConfig, GLX
struct vendor { struct vendor {
const char *glxvendor; const char *glxvendor;
int priority; int priority = 0;
}; };
vendor vendormap[] = { vendor vendormap[] = {

View File

@ -63,25 +63,25 @@
// Hints for X11 fullscreen // Hints for X11 fullscreen
typedef struct { typedef struct {
unsigned long flags; unsigned long flags = 0;
unsigned long functions; unsigned long functions = 0;
unsigned long decorations; unsigned long decorations = 0;
long inputMode; long inputMode = 0;
unsigned long status; unsigned long status = 0;
} Hints; } Hints;
typedef struct _xrr_monitor_info { typedef struct _xrr_monitor_info {
Atom name; Atom name;
Bool primary; Bool primary = false;
Bool automatic; Bool automatic = false;
int noutput; int noutput = 0;
int x; int x = 0;
int y; int y = 0;
int width; int width = 0;
int height; int height = 0;
int mwidth; int mwidth = 0;
int mheight; int mheight = 0;
RROutput *outputs; RROutput *outputs = nullptr;
} xrr_monitor_info; } xrr_monitor_info;
#undef CursorShape #undef CursorShape

View File

@ -49,15 +49,6 @@
static const char *ignore_str = "/dev/input/js"; static const char *ignore_str = "/dev/input/js";
#endif #endif
JoypadLinux::Joypad::Joypad() {
fd = -1;
dpad = 0;
devpath = "";
for (int i = 0; i < MAX_ABS; i++) {
abs_info[i] = nullptr;
}
}
JoypadLinux::Joypad::~Joypad() { JoypadLinux::Joypad::~Joypad() {
for (int i = 0; i < MAX_ABS; i++) { for (int i = 0; i < MAX_ABS; i++) {
if (abs_info[i]) { if (abs_info[i]) {

View File

@ -56,17 +56,16 @@ private:
Input::JoyAxis curr_axis[MAX_ABS]; Input::JoyAxis curr_axis[MAX_ABS];
int key_map[MAX_KEY]; int key_map[MAX_KEY];
int abs_map[MAX_ABS]; int abs_map[MAX_ABS];
int dpad; int dpad = 0;
int fd; int fd = -1;
String devpath; String devpath;
input_absinfo *abs_info[MAX_ABS]; input_absinfo *abs_info[MAX_ABS] = {};
bool force_feedback; bool force_feedback = false;
int ff_effect_id; int ff_effect_id = 0;
uint64_t ff_effect_timestamp; uint64_t ff_effect_timestamp = 0;
Joypad();
~Joypad(); ~Joypad();
void reset(); void reset();
}; };

View File

@ -77,13 +77,13 @@ public:
struct KeyEvent { struct KeyEvent {
WindowID window_id; WindowID window_id;
unsigned int osx_state; unsigned int osx_state = false;
bool pressed; bool pressed = false;
bool echo; bool echo = false;
bool raw; bool raw = false;
uint32_t keycode; uint32_t keycode = 0;
uint32_t physical_keycode; uint32_t physical_keycode = 0;
uint32_t unicode; uint32_t unicode = 0;
}; };
struct WarpEvent { struct WarpEvent {

View File

@ -48,7 +48,7 @@
class EditorExportPlatformOSX : public EditorExportPlatform { class EditorExportPlatformOSX : public EditorExportPlatform {
GDCLASS(EditorExportPlatformOSX, EditorExportPlatform); GDCLASS(EditorExportPlatformOSX, EditorExportPlatform);
int version_code; int version_code = 0;
Ref<ImageTexture> logo; Ref<ImageTexture> logo;

View File

@ -37,14 +37,6 @@
static JoypadOSX *self = nullptr; static JoypadOSX *self = nullptr;
joypad::joypad() { joypad::joypad() {
device_ref = nullptr;
ff_device = nullptr;
ff_axes = nullptr;
ff_directions = nullptr;
ffservice = 0;
ff_timestamp = 0;
id = 0;
ff_constant_force.lMagnitude = 10000; ff_constant_force.lMagnitude = 10000;
ff_effect.dwDuration = 0; ff_effect.dwDuration = 0;
ff_effect.dwSamplePeriod = 0; ff_effect.dwSamplePeriod = 0;

View File

@ -46,10 +46,10 @@ struct rec_element {
IOHIDElementRef ref; IOHIDElementRef ref;
IOHIDElementCookie cookie; IOHIDElementCookie cookie;
uint32_t usage; uint32_t usage = 0;
int min; int min = 0;
int max; int max = 0;
struct Comparator { struct Comparator {
bool operator()(const rec_element p_a, const rec_element p_b) const { return p_a.usage < p_b.usage; } bool operator()(const rec_element p_a, const rec_element p_b) const { return p_a.usage < p_b.usage; }
@ -57,22 +57,22 @@ struct rec_element {
}; };
struct joypad { struct joypad {
IOHIDDeviceRef device_ref; IOHIDDeviceRef device_ref = nullptr;
Vector<rec_element> axis_elements; Vector<rec_element> axis_elements;
Vector<rec_element> button_elements; Vector<rec_element> button_elements;
Vector<rec_element> hat_elements; Vector<rec_element> hat_elements;
int id; int id = 0;
io_service_t ffservice; /* Interface for force feedback, 0 = no ff */ io_service_t ffservice = 0; /* Interface for force feedback, 0 = no ff */
FFCONSTANTFORCE ff_constant_force; FFCONSTANTFORCE ff_constant_force;
FFDeviceObjectReference ff_device; FFDeviceObjectReference ff_device;
FFEffectObjectReference ff_object; FFEffectObjectReference ff_object;
uint64_t ff_timestamp; uint64_t ff_timestamp = 0;
LONG *ff_directions; LONG *ff_directions = nullptr;
FFEFFECT ff_effect; FFEFFECT ff_effect;
DWORD *ff_axes; DWORD *ff_axes = nullptr;
void add_hid_elements(CFArrayRef p_array); void add_hid_elements(CFArrayRef p_array);
void add_hid_element(IOHIDElementRef p_element); void add_hid_element(IOHIDElementRef p_element);

View File

@ -47,22 +47,22 @@
#undef CursorShape #undef CursorShape
class OS_Server : public OS_Unix { class OS_Server : public OS_Unix {
RenderingServer *rendering_server; RenderingServer *rendering_server = nullptr;
VideoMode current_videomode; VideoMode current_videomode;
List<String> args; List<String> args;
MainLoop *main_loop; MainLoop *main_loop = nullptr;
bool grab; bool grab = false;
virtual void delete_main_loop(); virtual void delete_main_loop();
bool force_quit; bool force_quit = false;
InputDefault *input; InputDefault *input = nullptr;
CrashHandler crash_handler; CrashHandler crash_handler;
int video_driver_index; int video_driver_index = 0;
Ref<ResourceFormatDummyTexture> resource_loader_dummy; Ref<ResourceFormatDummyTexture> resource_loader_dummy;

View File

@ -204,7 +204,8 @@ ContextEGL_UWP::ContextEGL_UWP(CoreWindow ^ p_window, Driver p_driver) :
mEglContext(EGL_NO_CONTEXT), mEglContext(EGL_NO_CONTEXT),
mEglSurface(EGL_NO_SURFACE), mEglSurface(EGL_NO_SURFACE),
driver(p_driver), driver(p_driver),
window(p_window) {} window(p_window),
vsync(false) {}
ContextEGL_UWP::~ContextEGL_UWP() { ContextEGL_UWP::~ContextEGL_UWP() {
cleanup(); cleanup();

View File

@ -108,7 +108,7 @@ class AppxPackager {
struct BlockHash { struct BlockHash {
String base64_hash; String base64_hash;
size_t compressed_size; size_t compressed_size = 0;
}; };
struct FileMeta { struct FileMeta {
@ -120,12 +120,10 @@ class AppxPackager {
Vector<BlockHash> hashes; Vector<BlockHash> hashes;
uLong file_crc32 = 0; uLong file_crc32 = 0;
ZPOS64_T zip_offset = 0; ZPOS64_T zip_offset = 0;
FileMeta() {}
}; };
String progress_task; String progress_task;
FileAccess *package; FileAccess *package = nullptr;
Set<String> mime_types; Set<String> mime_types;

View File

@ -58,21 +58,12 @@ private:
struct ControllerDevice { struct ControllerDevice {
Windows::Gaming::Input::IGameController ^ controller_reference; Windows::Gaming::Input::IGameController ^ controller_reference;
int id; int id = -1;
bool connected; bool connected = false;
ControllerType type; ControllerType type = ControllerType::GAMEPAD_CONTROLLER;
float ff_timestamp; float ff_timestamp = 0;
float ff_end_timestamp; float ff_end_timestamp = 0;
bool vibrating; bool vibrating = false;
ControllerDevice() {
id = -1;
connected = false;
type = ControllerType::GAMEPAD_CONTROLLER;
ff_timestamp = 0.0f;
ff_end_timestamp = 0.0f;
vibrating = false;
}
}; };
ControllerDevice controllers[MAX_CONTROLLERS]; ControllerDevice controllers[MAX_CONTROLLERS];

View File

@ -55,13 +55,13 @@ public:
CHAR_EVENT_MESSAGE CHAR_EVENT_MESSAGE
}; };
bool alt, shift, control; bool alt = false, shift = false, control = false;
MessageType type; MessageType type = KEY_EVENT_MESSAGE;
bool pressed; bool pressed = false;
unsigned int keycode; unsigned int keycode = 0;
unsigned int physical_keycode; unsigned int physical_keycode = 0;
unsigned int unicode; unsigned int unicode = 0;
bool echo; bool echo = false;
CorePhysicalKeyStatus status; CorePhysicalKeyStatus status;
}; };

View File

@ -211,6 +211,7 @@ ContextGL_Windows::ContextGL_Windows(HWND hwnd, bool p_opengl_3_context) {
hWnd = hwnd; hWnd = hwnd;
use_vsync = false; use_vsync = false;
vsync_via_compositor = false; vsync_via_compositor = false;
pixel_format = 0;
} }
ContextGL_Windows::~ContextGL_Windows() { ContextGL_Windows::~ContextGL_Windows() {

View File

@ -57,7 +57,7 @@
struct module_data { struct module_data {
std::string image_name; std::string image_name;
std::string module_name; std::string module_name;
void *base_address; void *base_address = nullptr;
DWORD load_size; DWORD load_size;
}; };

View File

@ -92,21 +92,13 @@ private:
}; };
struct xinput_gamepad { struct xinput_gamepad {
int id; int id = 0;
bool attached; bool attached = false;
bool vibrating; bool vibrating = false;
DWORD last_packet; DWORD last_packet = 0;
XINPUT_STATE state; XINPUT_STATE state;
uint64_t ff_timestamp; uint64_t ff_timestamp = 0;
uint64_t ff_end_timestamp; uint64_t ff_end_timestamp = 0;
xinput_gamepad() {
attached = false;
vibrating = false;
ff_timestamp = 0;
ff_end_timestamp = 0;
last_packet = 0;
}
}; };
typedef DWORD(WINAPI *XInputGetState_t)(DWORD dwUserIndex, XINPUT_STATE *pState); typedef DWORD(WINAPI *XInputGetState_t)(DWORD dwUserIndex, XINPUT_STATE *pState);

View File

@ -802,6 +802,11 @@ void OS_Windows::set_current_tablet_driver(const String &p_driver) {
} }
OS_Windows::OS_Windows(HINSTANCE _hInstance) { OS_Windows::OS_Windows(HINSTANCE _hInstance) {
ticks_per_second = 0;
ticks_start = 0;
main_loop = nullptr;
process_map = nullptr;
//Note: Wacom WinTab driver API for pen input, for devices incompatible with Windows Ink. //Note: Wacom WinTab driver API for pen input, for devices incompatible with Windows Ink.
HMODULE wintab_lib = LoadLibraryW(L"wintab32.dll"); HMODULE wintab_lib = LoadLibraryW(L"wintab32.dll");
if (wintab_lib) { if (wintab_lib) {