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 {
String name;
String value;
bool is_value_valid;
bool is_value_valid = false;
String enumeration;
String description;
bool operator<(const ConstantDoc &p_const) const {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -158,10 +158,10 @@ void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_val
struct _EVCSort {
String name;
Variant::Type type;
int order;
bool save;
bool restart_if_changed;
Variant::Type type = Variant::Type::NIL;
int order = 0;
bool save = false;
bool restart_if_changed = false;
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 {
const char *path;
uint32_t keycode;
const char *path = nullptr;
uint32_t keycode = 0;
};
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:
struct Plugin {
EditorPlugin *instance;
EditorPlugin *instance = nullptr;
String path;
String name;
String author;
String version;
String description;
bool installs;
bool installs = false;
String script;
Vector<String> install_files;
};

View file

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

View file

@ -270,8 +270,8 @@ private:
String path;
StringName type;
Vector<String> sources;
bool import_broken;
uint64_t modified_time;
bool import_broken = false;
uint64_t modified_time = 0;
bool operator<(const FileInfo &fi) const {
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) {
_pattern = p_pattern;

View file

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

View file

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

View file

@ -46,29 +46,24 @@
struct ColladaImport {
Collada collada;
Node3D *scene;
Node3D *scene = nullptr;
Vector<Ref<Animation>> animations;
struct NodeMap {
//String path;
Node3D *node;
int bone;
Node3D *node = nullptr;
int bone = -1;
List<int> anim_tracks;
NodeMap() {
node = nullptr;
bone = -1;
}
};
bool found_ambient;
bool found_ambient = false;
Color ambient;
bool found_directional;
bool force_make_tangents;
bool apply_mesh_xform_to_vertices;
bool use_mesh_builtin_materials;
float bake_fps;
bool found_directional = false;
bool force_make_tangents = false;
bool apply_mesh_xform_to_vertices = true;
bool use_mesh_builtin_materials = false;
float bake_fps = 15;
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
@ -98,14 +93,6 @@ struct ColladaImport {
Vector<String> missing_textures;
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) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -90,7 +90,7 @@ class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2;
RID light_instance2;
RID camera;
mutable volatile bool preview_done;
mutable volatile bool preview_done = false;
void _preview_done(const Variant &p_udata);
@ -134,7 +134,7 @@ class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2;
RID light_instance2;
RID camera;
mutable volatile bool preview_done;
mutable volatile bool preview_done = false;
void _preview_done(const Variant &p_udata);
@ -156,7 +156,7 @@ class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator {
RID viewport_texture;
RID canvas;
RID canvas_item;
mutable volatile bool preview_done;
mutable volatile bool preview_done = false;
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_end(Point2(0, 22));
mesh_library_editor->hide();
editor = nullptr;
}

View file

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

View file

@ -290,6 +290,8 @@ void Path3DGizmo::redraw() {
Path3DGizmo::Path3DGizmo(Path3D *p_path) {
path = 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) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -984,13 +984,13 @@ public:
String path;
String icon;
String main_scene;
uint64_t last_edited;
bool favorite;
bool grayed;
bool missing;
int version;
uint64_t last_edited = 0;
bool favorite = false;
bool grayed = false;
bool missing = false;
int version = 0;
ProjectListItemControl *control;
ProjectListItemControl *control = nullptr;
Item() {}
@ -1076,7 +1076,7 @@ private:
};
struct ProjectListComparator {
FilterOption order_option;
FilterOption order_option = FilterOption::EDIT_DATE;
// operator<
_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 {
String path;
float score;
float score = 0;
};
struct EntryComparator {

View file

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

View file

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

View file

@ -45,7 +45,7 @@ class BindingsGenerator {
struct ConstantInterface {
String name;
String proxy_name;
int value;
int value = 0;
const DocData::ConstantDoc *const_doc;
ConstantInterface() {}
@ -75,7 +75,7 @@ class BindingsGenerator {
struct PropertyInterface {
StringName cname;
String proxy_name;
int index;
int index = 0;
StringName setter;
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_sig; // Signature for the C# method declaration
String unique_sig; // Unique signature to avoid duplicates in containers
bool editor_only;
bool editor_only = false;
InternalCall() {}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -37,14 +37,6 @@
static JoypadOSX *self = nullptr;
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_effect.dwDuration = 0;
ff_effect.dwSamplePeriod = 0;

View file

@ -46,10 +46,10 @@ struct rec_element {
IOHIDElementRef ref;
IOHIDElementCookie cookie;
uint32_t usage;
uint32_t usage = 0;
int min;
int max;
int min = 0;
int max = 0;
struct Comparator {
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 {
IOHIDDeviceRef device_ref;
IOHIDDeviceRef device_ref = nullptr;
Vector<rec_element> axis_elements;
Vector<rec_element> button_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;
FFDeviceObjectReference ff_device;
FFEffectObjectReference ff_object;
uint64_t ff_timestamp;
LONG *ff_directions;
uint64_t ff_timestamp = 0;
LONG *ff_directions = nullptr;
FFEFFECT ff_effect;
DWORD *ff_axes;
DWORD *ff_axes = nullptr;
void add_hid_elements(CFArrayRef p_array);
void add_hid_element(IOHIDElementRef p_element);

View file

@ -47,22 +47,22 @@
#undef CursorShape
class OS_Server : public OS_Unix {
RenderingServer *rendering_server;
RenderingServer *rendering_server = nullptr;
VideoMode current_videomode;
List<String> args;
MainLoop *main_loop;
MainLoop *main_loop = nullptr;
bool grab;
bool grab = false;
virtual void delete_main_loop();
bool force_quit;
bool force_quit = false;
InputDefault *input;
InputDefault *input = nullptr;
CrashHandler crash_handler;
int video_driver_index;
int video_driver_index = 0;
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),
mEglSurface(EGL_NO_SURFACE),
driver(p_driver),
window(p_window) {}
window(p_window),
vsync(false) {}
ContextEGL_UWP::~ContextEGL_UWP() {
cleanup();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -92,21 +92,13 @@ private:
};
struct xinput_gamepad {
int id;
bool attached;
bool vibrating;
DWORD last_packet;
int id = 0;
bool attached = false;
bool vibrating = false;
DWORD last_packet = 0;
XINPUT_STATE state;
uint64_t ff_timestamp;
uint64_t ff_end_timestamp;
xinput_gamepad() {
attached = false;
vibrating = false;
ff_timestamp = 0;
ff_end_timestamp = 0;
last_packet = 0;
}
uint64_t ff_timestamp = 0;
uint64_t ff_end_timestamp = 0;
};
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) {
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.
HMODULE wintab_lib = LoadLibraryW(L"wintab32.dll");
if (wintab_lib) {