Merge pull request #24241 from Rubonnek/move-to-initializer-list

Moved member variables to initializer list
This commit is contained in:
Rémi Verschelde 2018-12-12 09:25:34 +01:00 committed by GitHub
commit c8a5400654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 609 additions and 694 deletions

View file

@ -47,28 +47,27 @@ CoreStringNames::CoreStringNames() :
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
_sections_unfolded(StaticCString::create("_sections_unfolded")), _sections_unfolded(StaticCString::create("_sections_unfolded")),
#endif #endif
_custom_features(StaticCString::create("_custom_features")) { _custom_features(StaticCString::create("_custom_features")),
x(StaticCString::create("x")),
x = StaticCString::create("x"); y(StaticCString::create("y")),
y = StaticCString::create("y"); z(StaticCString::create("z")),
z = StaticCString::create("z"); w(StaticCString::create("w")),
w = StaticCString::create("w"); r(StaticCString::create("r")),
r = StaticCString::create("r"); g(StaticCString::create("g")),
g = StaticCString::create("g"); b(StaticCString::create("b")),
b = StaticCString::create("b"); a(StaticCString::create("a")),
a = StaticCString::create("a"); position(StaticCString::create("position")),
position = StaticCString::create("position"); size(StaticCString::create("size")),
size = StaticCString::create("size"); end(StaticCString::create("end")),
end = StaticCString::create("end"); basis(StaticCString::create("basis")),
basis = StaticCString::create("basis"); origin(StaticCString::create("origin")),
origin = StaticCString::create("origin"); normal(StaticCString::create("normal")),
normal = StaticCString::create("normal"); d(StaticCString::create("d")),
d = StaticCString::create("d"); h(StaticCString::create("h")),
h = StaticCString::create("h"); s(StaticCString::create("s")),
s = StaticCString::create("s"); v(StaticCString::create("v")),
v = StaticCString::create("v"); r8(StaticCString::create("r8")),
r8 = StaticCString::create("r8"); g8(StaticCString::create("g8")),
g8 = StaticCString::create("g8"); b8(StaticCString::create("b8")),
b8 = StaticCString::create("b8"); a8(StaticCString::create("a8")) {
a8 = StaticCString::create("a8");
} }

View file

@ -56,12 +56,12 @@ struct MemoryPool {
Alloc *free_list; Alloc *free_list;
Alloc() { Alloc() :
mem = NULL; lock(0),
lock = 0; mem(NULL),
pool_id = POOL_ALLOCATOR_INVALID_ID; pool_id(POOL_ALLOCATOR_INVALID_ID),
size = 0; size(0),
free_list = NULL; free_list(NULL) {
} }
}; };

View file

@ -69,7 +69,6 @@ void FuncRef::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_function", "name"), &FuncRef::set_function); ClassDB::bind_method(D_METHOD("set_function", "name"), &FuncRef::set_function);
} }
FuncRef::FuncRef() { FuncRef::FuncRef() :
id(0) {
id = 0;
} }

View file

@ -373,24 +373,23 @@ uint64_t FileAccessCompressed::_get_modified_time(const String &p_file) {
return 0; return 0;
} }
FileAccessCompressed::FileAccessCompressed() { FileAccessCompressed::FileAccessCompressed() :
cmode(Compression::MODE_ZSTD),
f = NULL; writing(false),
magic = "GCMP"; write_ptr(0),
cmode = Compression::MODE_ZSTD; write_buffer_size(0),
writing = false; write_max(0),
write_ptr = 0; block_size(0),
write_buffer_size = 0; read_eof(false),
write_max = 0; at_end(false),
block_size = 0; read_ptr(NULL),
read_eof = false; read_block(0),
at_end = false; read_block_count(0),
read_total = 0; read_block_size(0),
read_ptr = NULL; read_pos(0),
read_block = 0; read_total(0),
read_block_count = 0; magic("GCMP"),
read_block_size = 0; f(NULL) {
read_pos = 0;
} }
FileAccessCompressed::~FileAccessCompressed() { FileAccessCompressed::~FileAccessCompressed() {

View file

@ -43,31 +43,31 @@ static void *godot_open(void *data, const char *p_fname, int mode) {
if (mode & ZLIB_FILEFUNC_MODE_WRITE) { if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
return NULL; return NULL;
}; }
FileAccess *f = (FileAccess *)data; FileAccess *f = (FileAccess *)data;
f->open(p_fname, FileAccess::READ); f->open(p_fname, FileAccess::READ);
return f->is_open() ? data : NULL; return f->is_open() ? data : NULL;
}; }
static uLong godot_read(void *data, void *fdata, void *buf, uLong size) { static uLong godot_read(void *data, void *fdata, void *buf, uLong size) {
FileAccess *f = (FileAccess *)data; FileAccess *f = (FileAccess *)data;
f->get_buffer((uint8_t *)buf, size); f->get_buffer((uint8_t *)buf, size);
return size; return size;
}; }
static uLong godot_write(voidpf opaque, voidpf stream, const void *buf, uLong size) { static uLong godot_write(voidpf opaque, voidpf stream, const void *buf, uLong size) {
return 0; return 0;
}; }
static long godot_tell(voidpf opaque, voidpf stream) { static long godot_tell(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque; FileAccess *f = (FileAccess *)opaque;
return f->get_position(); return f->get_position();
}; }
static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
@ -84,36 +84,36 @@ static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
break; break;
default: default:
break; break;
}; }
f->seek(pos); f->seek(pos);
return 0; return 0;
}; }
static int godot_close(voidpf opaque, voidpf stream) { static int godot_close(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque; FileAccess *f = (FileAccess *)opaque;
f->close(); f->close();
return 0; return 0;
}; }
static int godot_testerror(voidpf opaque, voidpf stream) { static int godot_testerror(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque; FileAccess *f = (FileAccess *)opaque;
return f->get_error() != OK ? 1 : 0; return f->get_error() != OK ? 1 : 0;
}; }
static voidpf godot_alloc(voidpf opaque, uInt items, uInt size) { static voidpf godot_alloc(voidpf opaque, uInt items, uInt size) {
return memalloc(items * size); return memalloc(items * size);
}; }
static void godot_free(voidpf opaque, voidpf address) { static void godot_free(voidpf opaque, voidpf address) {
memfree(address); memfree(address);
}; }
}; // extern "C" } // extern "C"
void ZipArchive::close_handle(unzFile p_file) const { void ZipArchive::close_handle(unzFile p_file) const {
@ -122,7 +122,7 @@ void ZipArchive::close_handle(unzFile p_file) const {
unzCloseCurrentFile(p_file); unzCloseCurrentFile(p_file);
unzClose(p_file); unzClose(p_file);
memdelete(f); memdelete(f);
}; }
unzFile ZipArchive::get_file_handle(String p_file) const { unzFile ZipArchive::get_file_handle(String p_file) const {
@ -155,10 +155,10 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
unzClose(pkg); unzClose(pkg);
ERR_FAIL_V(NULL); ERR_FAIL_V(NULL);
}; }
return pkg; return pkg;
}; }
bool ZipArchive::try_open_pack(const String &p_path) { bool ZipArchive::try_open_pack(const String &p_path) {
@ -215,36 +215,36 @@ bool ZipArchive::try_open_pack(const String &p_path) {
if ((i + 1) < gi.number_entry) { if ((i + 1) < gi.number_entry) {
unzGoToNextFile(zfile); unzGoToNextFile(zfile);
}; }
}; }
return true; return true;
}; }
bool ZipArchive::file_exists(String p_name) const { bool ZipArchive::file_exists(String p_name) const {
return files.has(p_name); return files.has(p_name);
}; }
FileAccess *ZipArchive::get_file(const String &p_path, PackedData::PackedFile *p_file) { FileAccess *ZipArchive::get_file(const String &p_path, PackedData::PackedFile *p_file) {
return memnew(FileAccessZip(p_path, *p_file)); return memnew(FileAccessZip(p_path, *p_file));
}; }
ZipArchive *ZipArchive::get_singleton() { ZipArchive *ZipArchive::get_singleton() {
if (instance == NULL) { if (instance == NULL) {
instance = memnew(ZipArchive); instance = memnew(ZipArchive);
}; }
return instance; return instance;
}; }
ZipArchive::ZipArchive() { ZipArchive::ZipArchive() {
instance = this; instance = this;
//fa_create_func = FileAccess::get_create_func(); //fa_create_func = FileAccess::get_create_func();
}; }
ZipArchive::~ZipArchive() { ZipArchive::~ZipArchive() {
@ -253,10 +253,10 @@ ZipArchive::~ZipArchive() {
FileAccess *f = (FileAccess *)unzGetOpaque(packages[i].zfile); FileAccess *f = (FileAccess *)unzGetOpaque(packages[i].zfile);
unzClose(packages[i].zfile); unzClose(packages[i].zfile);
memdelete(f); memdelete(f);
}; }
packages.clear(); packages.clear();
}; }
Error FileAccessZip::_open(const String &p_path, int p_mode_flags) { Error FileAccessZip::_open(const String &p_path, int p_mode_flags) {
@ -272,7 +272,7 @@ Error FileAccessZip::_open(const String &p_path, int p_mode_flags) {
ERR_FAIL_COND_V(err != UNZ_OK, FAILED); ERR_FAIL_COND_V(err != UNZ_OK, FAILED);
return OK; return OK;
}; }
void FileAccessZip::close() { void FileAccessZip::close() {
@ -283,50 +283,50 @@ void FileAccessZip::close() {
ERR_FAIL_COND(!arch); ERR_FAIL_COND(!arch);
arch->close_handle(zfile); arch->close_handle(zfile);
zfile = NULL; zfile = NULL;
}; }
bool FileAccessZip::is_open() const { bool FileAccessZip::is_open() const {
return zfile != NULL; return zfile != NULL;
}; }
void FileAccessZip::seek(size_t p_position) { void FileAccessZip::seek(size_t p_position) {
ERR_FAIL_COND(!zfile); ERR_FAIL_COND(!zfile);
unzSeekCurrentFile(zfile, p_position); unzSeekCurrentFile(zfile, p_position);
}; }
void FileAccessZip::seek_end(int64_t p_position) { void FileAccessZip::seek_end(int64_t p_position) {
ERR_FAIL_COND(!zfile); ERR_FAIL_COND(!zfile);
unzSeekCurrentFile(zfile, get_len() + p_position); unzSeekCurrentFile(zfile, get_len() + p_position);
}; }
size_t FileAccessZip::get_position() const { size_t FileAccessZip::get_position() const {
ERR_FAIL_COND_V(!zfile, 0); ERR_FAIL_COND_V(!zfile, 0);
return unztell(zfile); return unztell(zfile);
}; }
size_t FileAccessZip::get_len() const { size_t FileAccessZip::get_len() const {
ERR_FAIL_COND_V(!zfile, 0); ERR_FAIL_COND_V(!zfile, 0);
return file_info.uncompressed_size; return file_info.uncompressed_size;
}; }
bool FileAccessZip::eof_reached() const { bool FileAccessZip::eof_reached() const {
ERR_FAIL_COND_V(!zfile, true); ERR_FAIL_COND_V(!zfile, true);
return at_eof; return at_eof;
}; }
uint8_t FileAccessZip::get_8() const { uint8_t FileAccessZip::get_8() const {
uint8_t ret = 0; uint8_t ret = 0;
get_buffer(&ret, 1); get_buffer(&ret, 1);
return ret; return ret;
}; }
int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const { int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const {
@ -339,20 +339,20 @@ int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const {
if (read < p_length) if (read < p_length)
at_eof = true; at_eof = true;
return read; return read;
}; }
Error FileAccessZip::get_error() const { Error FileAccessZip::get_error() const {
if (!zfile) { if (!zfile) {
return ERR_UNCONFIGURED; return ERR_UNCONFIGURED;
}; }
if (eof_reached()) { if (eof_reached()) {
return ERR_FILE_EOF; return ERR_FILE_EOF;
}; }
return OK; return OK;
}; }
void FileAccessZip::flush() { void FileAccessZip::flush() {
@ -362,22 +362,21 @@ void FileAccessZip::flush() {
void FileAccessZip::store_8(uint8_t p_dest) { void FileAccessZip::store_8(uint8_t p_dest) {
ERR_FAIL(); ERR_FAIL();
}; }
bool FileAccessZip::file_exists(const String &p_name) { bool FileAccessZip::file_exists(const String &p_name) {
return false; return false;
}; }
FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) { FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) :
zfile(NULL) {
zfile = NULL;
_open(p_path, FileAccess::READ); _open(p_path, FileAccess::READ);
}; }
FileAccessZip::~FileAccessZip() { FileAccessZip::~FileAccessZip() {
close(); close();
}; }
#endif #endif

View file

@ -179,11 +179,10 @@ void RotatedFileLogger::rotate_file() {
file = FileAccess::open(base_path, FileAccess::WRITE); file = FileAccess::open(base_path, FileAccess::WRITE);
} }
RotatedFileLogger::RotatedFileLogger(const String &p_base_path, int p_max_files) { RotatedFileLogger::RotatedFileLogger(const String &p_base_path, int p_max_files) :
file = NULL; base_path(p_base_path.simplify_path()),
base_path = p_base_path.simplify_path(); max_files(p_max_files > 0 ? p_max_files : 1),
max_files = p_max_files > 0 ? p_max_files : 1; file(NULL) {
rotate_file(); rotate_file();
} }
@ -240,8 +239,8 @@ void StdLogger::logv(const char *p_format, va_list p_list, bool p_err) {
StdLogger::~StdLogger() {} StdLogger::~StdLogger() {}
CompositeLogger::CompositeLogger(Vector<Logger *> p_loggers) { CompositeLogger::CompositeLogger(Vector<Logger *> p_loggers) :
loggers = p_loggers; loggers(p_loggers) {
} }
void CompositeLogger::logv(const char *p_format, va_list p_list, bool p_err) { void CompositeLogger::logv(const char *p_format, va_list p_list, bool p_err) {

View file

@ -55,9 +55,8 @@ ObjectID EncodedObjectAsID::get_object_id() const {
return id; return id;
} }
EncodedObjectAsID::EncodedObjectAsID() { EncodedObjectAsID::EncodedObjectAsID() :
id(0) {
id = 0;
} }
#define ENCODE_MASK 0xFF #define ENCODE_MASK 0xFF

View file

@ -35,10 +35,9 @@
/* helpers / binders */ /* helpers / binders */
PacketPeer::PacketPeer() { PacketPeer::PacketPeer() :
last_get_error(OK),
allow_object_decoding = false; allow_object_decoding(false) {
last_get_error = OK;
} }
void PacketPeer::set_allow_object_decoding(bool p_enable) { void PacketPeer::set_allow_object_decoding(bool p_enable) {

View file

@ -239,13 +239,12 @@ void PacketPeerUDP::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_dest_address", "host", "port"), &PacketPeerUDP::_set_dest_address); ClassDB::bind_method(D_METHOD("set_dest_address", "host", "port"), &PacketPeerUDP::_set_dest_address);
} }
PacketPeerUDP::PacketPeerUDP() { PacketPeerUDP::PacketPeerUDP() :
packet_port(0),
_sock = Ref<NetSocket>(NetSocket::create()); queue_count(0),
blocking = true; peer_port(0),
packet_port = 0; blocking(true),
queue_count = 0; _sock(Ref<NetSocket>(NetSocket::create())) {
peer_port = 0;
rb.resize(16); rb.resize(16);
} }

View file

@ -970,12 +970,11 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
return type; return type;
} }
ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() { ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() :
translation_remapped(false),
f = NULL; f(NULL),
stage = 0; error(OK),
error = OK; stage(0) {
translation_remapped = false;
} }
ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() { ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() {

View file

@ -349,12 +349,11 @@ void StreamPeerTCP::_bind_methods() {
BIND_ENUM_CONSTANT(STATUS_ERROR); BIND_ENUM_CONSTANT(STATUS_ERROR);
} }
StreamPeerTCP::StreamPeerTCP() { StreamPeerTCP::StreamPeerTCP() :
_sock(Ref<NetSocket>(NetSocket::create())),
_sock = Ref<NetSocket>(NetSocket::create()); status(STATUS_NONE),
status = STATUS_NONE; peer_host(IP_Address()),
peer_host = IP_Address(); peer_port(0) {
peer_port = 0;
} }
StreamPeerTCP::~StreamPeerTCP() { StreamPeerTCP::~StreamPeerTCP() {

View file

@ -116,9 +116,8 @@ void TCP_Server::stop() {
} }
} }
TCP_Server::TCP_Server() { TCP_Server::TCP_Server() :
_sock(Ref<NetSocket>(NetSocket::create())) {
_sock = Ref<NetSocket>(NetSocket::create());
} }
TCP_Server::~TCP_Server() { TCP_Server::~TCP_Server() {

View file

@ -2157,13 +2157,13 @@ void Expression::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_error_text"), &Expression::get_error_text); ClassDB::bind_method(D_METHOD("get_error_text"), &Expression::get_error_text);
} }
Expression::Expression() { Expression::Expression() :
output_type = Variant::NIL; output_type(Variant::NIL),
error_set = true; sequenced(false),
root = NULL; error_set(true),
nodes = NULL; root(NULL),
sequenced = false; nodes(NULL),
execution_error = false; execution_error(false) {
} }
Expression::~Expression() { Expression::~Expression() {

View file

@ -116,7 +116,9 @@ private:
Variant::Type type; Variant::Type type;
String name; String name;
Input() { type = Variant::NIL; } Input() :
type(Variant::NIL) {
}
}; };
Vector<Input> inputs; Vector<Input> inputs;

View file

@ -74,10 +74,11 @@ public:
_FORCE_INLINE_ bool operator!=(const Plane &p_plane) const; _FORCE_INLINE_ bool operator!=(const Plane &p_plane) const;
operator String() const; operator String() const;
_FORCE_INLINE_ Plane() { d = 0; } _FORCE_INLINE_ Plane() :
d(0) {}
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) : _FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
normal(p_a, p_b, p_c), normal(p_a, p_b, p_c),
d(p_d){}; d(p_d) {}
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d); _FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal); _FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);

View file

@ -115,20 +115,20 @@ public:
z = p_z; z = p_z;
w = p_w; w = p_w;
} }
inline Quat(real_t p_x, real_t p_y, real_t p_z, real_t p_w) { inline Quat(real_t p_x, real_t p_y, real_t p_z, real_t p_w) :
x = p_x; x(p_x),
y = p_y; y(p_y),
z = p_z; z(p_z),
w = p_w; w(p_w) {
} }
Quat(const Vector3 &axis, const real_t &angle) { set_axis_angle(axis, angle); } Quat(const Vector3 &axis, const real_t &angle) { set_axis_angle(axis, angle); }
Quat(const Vector3 &euler) { set_euler(euler); } Quat(const Vector3 &euler) { set_euler(euler); }
Quat(const Quat &q) { Quat(const Quat &q) :
x = q.x; x(q.x),
y = q.y; y(q.y),
z = q.z; z(q.z),
w = q.w; w(q.w) {
} }
Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc
@ -153,9 +153,11 @@ public:
} }
} }
inline Quat() { inline Quat() :
x = y = z = 0; x(0),
w = 1; y(0),
z(0),
w(1) {
} }
}; };

View file

@ -349,9 +349,9 @@ class DirChanger {
String original_dir; String original_dir;
public: public:
DirChanger(DirAccess *p_da, String p_dir) { DirChanger(DirAccess *p_da, String p_dir) :
da = p_da; da(p_da),
original_dir = p_da->get_current_dir(); original_dir(p_da->get_current_dir()) {
p_da->change_dir(p_dir); p_da->change_dir(p_dir);
} }

View file

@ -139,8 +139,8 @@ void WeakRef::set_ref(const REF &p_ref) {
ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0; ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0;
} }
WeakRef::WeakRef() { WeakRef::WeakRef() :
ref = 0; ref(0) {
} }
void WeakRef::_bind_methods() { void WeakRef::_bind_methods() {

View file

@ -45,7 +45,8 @@ public:
CharType saved; CharType saved;
Stream() { saved = 0; } Stream() :
saved(0) {}
virtual ~Stream() {} virtual ~Stream() {}
}; };

View file

@ -159,7 +159,7 @@ Error AudioDriverALSA::init() {
} }
return err; return err;
}; }
void AudioDriverALSA::thread_func(void *p_udata) { void AudioDriverALSA::thread_func(void *p_udata) {
@ -232,25 +232,25 @@ void AudioDriverALSA::thread_func(void *p_udata) {
ad->stop_counting_ticks(); ad->stop_counting_ticks();
ad->unlock(); ad->unlock();
}; }
ad->thread_exited = true; ad->thread_exited = true;
}; }
void AudioDriverALSA::start() { void AudioDriverALSA::start() {
active = true; active = true;
}; }
int AudioDriverALSA::get_mix_rate() const { int AudioDriverALSA::get_mix_rate() const {
return mix_rate; return mix_rate;
}; }
AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const { AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const {
return speaker_mode; return speaker_mode;
}; }
Array AudioDriverALSA::get_device_list() { Array AudioDriverALSA::get_device_list() {
@ -302,14 +302,14 @@ void AudioDriverALSA::lock() {
if (!thread || !mutex) if (!thread || !mutex)
return; return;
mutex->lock(); mutex->lock();
}; }
void AudioDriverALSA::unlock() { void AudioDriverALSA::unlock() {
if (!thread || !mutex) if (!thread || !mutex)
return; return;
mutex->unlock(); mutex->unlock();
}; }
void AudioDriverALSA::finish_device() { void AudioDriverALSA::finish_device() {
@ -337,18 +337,15 @@ void AudioDriverALSA::finish() {
finish_device(); finish_device();
} }
AudioDriverALSA::AudioDriverALSA() { AudioDriverALSA::AudioDriverALSA() :
thread(NULL),
mutex(NULL),
pcm_handle(NULL),
device_name("Default"),
new_device("Default") {
}
mutex = NULL; AudioDriverALSA::~AudioDriverALSA() {
thread = NULL; }
pcm_handle = NULL;
device_name = "Default";
new_device = "Default";
};
AudioDriverALSA::~AudioDriverALSA(){
};
#endif #endif

View file

@ -684,22 +684,18 @@ String AudioDriverCoreAudio::capture_get_device() {
#endif #endif
AudioDriverCoreAudio::AudioDriverCoreAudio() { AudioDriverCoreAudio::AudioDriverCoreAudio() :
audio_unit = NULL; audio_unit(NULL),
input_unit = NULL; input_unit(NULL),
active = false; active(false),
mutex = NULL; mutex(NULL),
device_name("Default"),
mix_rate = 0; capture_device_name("Default"),
channels = 2; mix_rate(0),
capture_channels = 2; channels(2),
capture_channels(2),
buffer_frames = 0; buffer_frames(0) {
samples_in.clear(); samples_in.clear();
device_name = "Default";
capture_device_name = "Default";
} }
AudioDriverCoreAudio::~AudioDriverCoreAudio(){}; AudioDriverCoreAudio::~AudioDriverCoreAudio(){};

View file

@ -112,13 +112,11 @@ PoolStringArray MIDIDriverCoreMidi::get_connected_inputs() {
return list; return list;
} }
MIDIDriverCoreMidi::MIDIDriverCoreMidi() { MIDIDriverCoreMidi::MIDIDriverCoreMidi() :
client(0) {
client = 0;
} }
MIDIDriverCoreMidi::~MIDIDriverCoreMidi() { MIDIDriverCoreMidi::~MIDIDriverCoreMidi() {
close(); close();
} }

View file

@ -371,33 +371,28 @@ public:
float fog_height_max; float fog_height_max;
float fog_height_curve; float fog_height_curve;
Environment() { Environment() :
bg_mode = VS::ENV_BG_CLEAR_COLOR; bg_mode(VS::ENV_BG_CLEAR_COLOR),
sky_custom_fov = 0.0; sky_custom_fov(0.0),
bg_energy = 1.0; bg_energy(1.0),
sky_ambient = 0; sky_ambient(0),
ambient_energy = 1.0; ambient_energy(1.0),
ambient_sky_contribution = 0.0; ambient_sky_contribution(0.0),
canvas_max_layer = 0; canvas_max_layer(0),
fog_enabled(false),
fog_enabled = false; fog_color(Color(0.5, 0.5, 0.5)),
fog_color = Color(0.5, 0.5, 0.5); fog_sun_color(Color(0.8, 0.8, 0.0)),
fog_sun_color = Color(0.8, 0.8, 0.0); fog_sun_amount(0),
fog_sun_amount = 0; fog_depth_enabled(true),
fog_depth_begin(10),
fog_depth_enabled = true; fog_depth_end(0),
fog_depth_curve(1),
fog_depth_begin = 10; fog_transmit_enabled(true),
fog_depth_end = 0; fog_transmit_curve(1),
fog_depth_curve = 1; fog_height_enabled(false),
fog_height_min(0),
fog_transmit_enabled = true; fog_height_max(100),
fog_transmit_curve = 1; fog_height_curve(1) {
fog_height_enabled = false;
fog_height_min = 0;
fog_height_max = 100;
fog_height_curve = 1;
} }
}; };

View file

@ -131,10 +131,9 @@ public:
} }
} render, render_final, snap; } render, render_final, snap;
Info() { Info() :
texture_mem(0),
texture_mem = 0; vertex_mem(0) {
vertex_mem = 0;
render.reset(); render.reset();
render_final.reset(); render_final.reset();
} }
@ -254,30 +253,31 @@ public:
VisualServer::TextureDetectCallback detect_normal; VisualServer::TextureDetectCallback detect_normal;
void *detect_normal_ud; void *detect_normal_ud;
Texture() { Texture() :
alloc_width = 0; proxy(NULL),
alloc_height = 0; flags(0),
target = 0; width(0),
height(0),
stored_cube_sides = 0; alloc_width(0),
ignore_mipmaps = false; alloc_height(0),
render_target = NULL; format(Image::FORMAT_L8),
flags = width = height = 0; target(0),
tex_id = 0; data_size(0),
data_size = 0; total_data_size(0),
format = Image::FORMAT_L8; ignore_mipmaps(false),
active = false; compressed(false),
compressed = false; mipmaps(0),
total_data_size = 0; active(false),
mipmaps = 0; tex_id(0),
detect_3d = NULL; stored_cube_sides(0),
detect_3d_ud = NULL; render_target(NULL),
detect_srgb = NULL; redraw_if_visible(false),
detect_srgb_ud = NULL; detect_3d(NULL),
detect_normal = NULL; detect_3d_ud(NULL),
detect_normal_ud = NULL; detect_srgb(NULL),
proxy = NULL; detect_srgb_ud(NULL),
redraw_if_visible = false; detect_normal(NULL),
detect_normal_ud(NULL) {
} }
_ALWAYS_INLINE_ Texture *get_ptr() { _ALWAYS_INLINE_ Texture *get_ptr() {
@ -615,20 +615,15 @@ public:
int total_data_size; int total_data_size;
Surface() { Surface() :
array_byte_size = 0; mesh(NULL),
index_array_byte_size = 0; array_len(0),
index_array_len(0),
array_len = 0; array_byte_size(0),
index_array_len = 0; index_array_byte_size(0),
primitive(VS::PRIMITIVE_POINTS),
mesh = NULL; active(false),
total_data_size(0) {
primitive = VS::PRIMITIVE_POINTS;
active = false;
total_data_size = 0;
} }
}; };
@ -658,9 +653,9 @@ public:
} }
} }
Mesh() { Mesh() :
blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED; blend_shape_count(0),
blend_shape_count = 0; blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED) {
} }
}; };
@ -731,22 +726,18 @@ public:
bool dirty_data; bool dirty_data;
MultiMesh() : MultiMesh() :
size(0),
transform_format(VS::MULTIMESH_TRANSFORM_2D),
color_format(VS::MULTIMESH_COLOR_NONE),
custom_data_format(VS::MULTIMESH_CUSTOM_DATA_NONE),
update_list(this), update_list(this),
mesh_list(this) { mesh_list(this),
dirty_aabb = true; visible_instances(-1),
dirty_data = true; xform_floats(0),
color_floats(0),
xform_floats = 0; custom_data_floats(0),
color_floats = 0; dirty_aabb(true),
custom_data_floats = 0; dirty_data(true) {
visible_instances = -1;
size = 0;
transform_format = VS::MULTIMESH_TRANSFORM_2D;
color_format = VS::MULTIMESH_COLOR_NONE;
custom_data_format = VS::MULTIMESH_CUSTOM_DATA_NONE;
} }
}; };
@ -847,10 +838,10 @@ public:
Set<RasterizerScene::InstanceBase *> instances; Set<RasterizerScene::InstanceBase *> instances;
Skeleton() : Skeleton() :
use_2d(false),
size(0),
tex_id(0),
update_list(this) { update_list(this) {
tex_id = 0;
size = 0;
use_2d = false;
} }
}; };
@ -1121,11 +1112,11 @@ public:
GLuint color; GLuint color;
Effect() { Effect() :
fbo = 0; fbo(0),
width = 0; width(0),
height = 0; height(0),
color = 0; color(0) {
} }
}; };
@ -1140,22 +1131,17 @@ public:
RID texture; RID texture;
RenderTarget() { RenderTarget() :
fbo = 0; fbo(0),
color(0),
color = 0; depth(0),
depth = 0; width(0),
height(0),
width = 0; used_in_frame(false),
height = 0; msaa(VS::VIEWPORT_MSAA_DISABLED) {
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) {
flags[i] = false; flags[i] = false;
} }
used_in_frame = false;
msaa = VS::VIEWPORT_MSAA_DISABLED;
} }
}; };

View file

@ -450,89 +450,77 @@ public:
float fog_height_max; float fog_height_max;
float fog_height_curve; float fog_height_curve;
Environment() { Environment() :
bg_mode = VS::ENV_BG_CLEAR_COLOR; bg_mode(VS::ENV_BG_CLEAR_COLOR),
sky_custom_fov = 0.0; sky_custom_fov(0.0),
bg_energy = 1.0; bg_energy(1.0),
sky_ambient = 0; sky_ambient(0),
ambient_energy = 1.0; ambient_energy(1.0),
ambient_sky_contribution = 0.0; ambient_sky_contribution(0.0),
canvas_max_layer = 0; canvas_max_layer(0),
ssr_enabled(false),
ssr_enabled = false; ssr_max_steps(64),
ssr_max_steps = 64; ssr_fade_in(0.15),
ssr_fade_in = 0.15; ssr_fade_out(2.0),
ssr_fade_out = 2.0; ssr_depth_tolerance(0.2),
ssr_depth_tolerance = 0.2; ssr_roughness(true),
ssr_roughness = true; ssao_enabled(false),
ssao_intensity(1.0),
ssao_enabled = false; ssao_radius(1.0),
ssao_intensity = 1.0; ssao_intensity2(1.0),
ssao_radius = 1.0; ssao_radius2(0.0),
ssao_intensity2 = 1.0; ssao_bias(0.01),
ssao_radius2 = 0.0; ssao_light_affect(0),
ssao_bias = 0.01; ssao_ao_channel_affect(0),
ssao_light_affect = 0; ssao_quality(VS::ENV_SSAO_QUALITY_LOW),
ssao_ao_channel_affect = 0; ssao_bilateral_sharpness(4),
ssao_filter = VS::ENV_SSAO_BLUR_3x3; ssao_filter(VS::ENV_SSAO_BLUR_3x3),
ssao_quality = VS::ENV_SSAO_QUALITY_LOW; glow_enabled(false),
ssao_bilateral_sharpness = 4; glow_levels((1 << 2) | (1 << 4)),
glow_intensity(0.8),
tone_mapper = VS::ENV_TONE_MAPPER_LINEAR; glow_strength(1.0),
tone_mapper_exposure = 1.0; glow_bloom(0.0),
tone_mapper_exposure_white = 1.0; glow_blend_mode(VS::GLOW_BLEND_MODE_SOFTLIGHT),
auto_exposure = false; glow_hdr_bleed_threshold(1.0),
auto_exposure_speed = 0.5; glow_hdr_bleed_scale(2.0),
auto_exposure_min = 0.05; glow_hdr_luminance_cap(12.0),
auto_exposure_max = 8; glow_bicubic_upscale(false),
auto_exposure_grey = 0.4; tone_mapper(VS::ENV_TONE_MAPPER_LINEAR),
tone_mapper_exposure(1.0),
glow_enabled = false; tone_mapper_exposure_white(1.0),
glow_levels = (1 << 2) | (1 << 4); auto_exposure(false),
glow_intensity = 0.8; auto_exposure_speed(0.5),
glow_strength = 1.0; auto_exposure_min(0.05),
glow_bloom = 0.0; auto_exposure_max(8),
glow_blend_mode = VS::GLOW_BLEND_MODE_SOFTLIGHT; auto_exposure_grey(0.4),
glow_hdr_bleed_threshold = 1.0; dof_blur_far_enabled(false),
glow_hdr_bleed_scale = 2.0; dof_blur_far_distance(10),
glow_hdr_luminance_cap = 12.0; dof_blur_far_transition(5),
glow_bicubic_upscale = false; dof_blur_far_amount(0.1),
dof_blur_far_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
dof_blur_far_enabled = false; dof_blur_near_enabled(false),
dof_blur_far_distance = 10; dof_blur_near_distance(2),
dof_blur_far_transition = 5; dof_blur_near_transition(1),
dof_blur_far_amount = 0.1; dof_blur_near_amount(0.1),
dof_blur_far_quality = VS::ENV_DOF_BLUR_QUALITY_MEDIUM; dof_blur_near_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
adjustments_enabled(false),
dof_blur_near_enabled = false; adjustments_brightness(1.0),
dof_blur_near_distance = 2; adjustments_contrast(1.0),
dof_blur_near_transition = 1; adjustments_saturation(1.0),
dof_blur_near_amount = 0.1; fog_enabled(false),
dof_blur_near_quality = VS::ENV_DOF_BLUR_QUALITY_MEDIUM; fog_color(Color(0.5, 0.5, 0.5)),
fog_sun_color(Color(0.8, 0.8, 0.0)),
adjustments_enabled = false; fog_sun_amount(0),
adjustments_brightness = 1.0; fog_depth_enabled(true),
adjustments_contrast = 1.0; fog_depth_begin(10),
adjustments_saturation = 1.0; fog_depth_end(0),
fog_depth_curve(1),
fog_enabled = false; fog_transmit_enabled(true),
fog_color = Color(0.5, 0.5, 0.5); fog_transmit_curve(1),
fog_sun_color = Color(0.8, 0.8, 0.0); fog_height_enabled(false),
fog_sun_amount = 0; fog_height_min(0),
fog_height_max(100),
fog_depth_enabled = true; fog_height_curve(1) {
fog_depth_begin = 10;
fog_depth_end = 0;
fog_depth_curve = 1;
fog_transmit_enabled = true;
fog_transmit_curve = 1;
fog_height_enabled = false;
fog_height_min = 0;
fog_height_max = 100;
fog_height_curve = 1;
} }
}; };
@ -643,9 +631,9 @@ public:
Vector3 bounds; Vector3 bounds;
Transform transform_to_data; Transform transform_to_data;
GIProbeInstance() { GIProbeInstance() :
probe = NULL; probe(NULL),
tex_cache = 0; tex_cache(0) {
} }
}; };

View file

@ -285,29 +285,30 @@ public:
VisualServer::TextureDetectCallback detect_normal; VisualServer::TextureDetectCallback detect_normal;
void *detect_normal_ud; void *detect_normal_ud;
Texture() { Texture() :
proxy(NULL),
using_srgb = false; flags(0),
stored_cube_sides = 0; width(0),
ignore_mipmaps = false; height(0),
render_target = NULL; format(Image::FORMAT_L8),
flags = width = height = 0; target(GL_TEXTURE_2D),
tex_id = 0; data_size(0),
data_size = 0; compressed(false),
format = Image::FORMAT_L8; total_data_size(0),
active = false; ignore_mipmaps(false),
compressed = false; mipmaps(0),
total_data_size = 0; active(false),
target = GL_TEXTURE_2D; tex_id(0),
mipmaps = 0; using_srgb(false),
detect_3d = NULL; redraw_if_visible(false),
detect_3d_ud = NULL; stored_cube_sides(0),
detect_srgb = NULL; render_target(NULL),
detect_srgb_ud = NULL; detect_3d(NULL),
detect_normal = NULL; detect_3d_ud(NULL),
detect_normal_ud = NULL; detect_srgb(NULL),
proxy = NULL; detect_srgb_ud(NULL),
redraw_if_visible = false; detect_normal(NULL),
detect_normal_ud(NULL) {
} }
_ALWAYS_INLINE_ Texture *get_ptr() { _ALWAYS_INLINE_ Texture *get_ptr() {
@ -553,16 +554,16 @@ public:
bool is_animated_cache; bool is_animated_cache;
Material() : Material() :
shader(NULL),
ubo_id(0),
ubo_size(0),
list(this), list(this),
dirty_list(this) { dirty_list(this),
can_cast_shadow_cache = false; line_width(1.0),
is_animated_cache = false; render_priority(0),
shader = NULL; last_pass(0),
line_width = 1.0; can_cast_shadow_cache(false),
ubo_id = 0; is_animated_cache(false) {
ubo_size = 0;
last_pass = 0;
render_priority = 0;
} }
}; };
@ -661,27 +662,24 @@ public:
int total_data_size; int total_data_size;
Surface() { Surface() :
mesh(NULL),
array_byte_size = 0; format(0),
index_array_byte_size = 0; array_id(0),
mesh = NULL; vertex_id(0),
format = 0; index_id(0),
array_id = 0; index_wireframe_id(0),
vertex_id = 0; array_wireframe_id(0),
index_id = 0; instancing_array_wireframe_id(0),
array_len = 0; index_wireframe_len(0),
array_len(0),
index_array_len(0),
array_byte_size(0),
index_array_byte_size(0),
primitive(VS::PRIMITIVE_POINTS),
active(false),
total_data_size(0) {
type = GEOMETRY_SURFACE; type = GEOMETRY_SURFACE;
primitive = VS::PRIMITIVE_POINTS;
index_array_len = 0;
active = false;
total_data_size = 0;
index_wireframe_id = 0;
array_wireframe_id = 0;
instancing_array_wireframe_id = 0;
index_wireframe_len = 0;
} }
~Surface() { ~Surface() {
@ -708,11 +706,11 @@ public:
} }
} }
Mesh() { Mesh() :
blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED; active(false),
blend_shape_count = 0; blend_shape_count(0),
last_pass = 0; blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED),
active = false; last_pass(0) {
} }
}; };
@ -780,19 +778,19 @@ public:
bool dirty_data; bool dirty_data;
MultiMesh() : MultiMesh() :
size(0),
transform_format(VS::MULTIMESH_TRANSFORM_2D),
color_format(VS::MULTIMESH_COLOR_NONE),
custom_data_format(VS::MULTIMESH_CUSTOM_DATA_NONE),
update_list(this), update_list(this),
mesh_list(this) { mesh_list(this),
dirty_aabb = true; buffer(0),
dirty_data = true; visible_instances(-1),
xform_floats = 0; xform_floats(0),
color_floats = 0; color_floats(0),
custom_data_floats = 0; custom_data_floats(0),
visible_instances = -1; dirty_aabb(true),
size = 0; dirty_data(true) {
buffer = 0;
transform_format = VS::MULTIMESH_TRANSFORM_2D;
color_format = VS::MULTIMESH_COLOR_NONE;
custom_data_format = VS::MULTIMESH_CUSTOM_DATA_NONE;
} }
}; };
@ -889,11 +887,10 @@ public:
Transform2D base_transform_2d; Transform2D base_transform_2d;
Skeleton() : Skeleton() :
use_2d(false),
size(0),
texture(0),
update_list(this) { update_list(this) {
size = 0;
use_2d = false;
texture = 0;
} }
}; };
@ -1174,37 +1171,31 @@ public:
Transform emission_transform; Transform emission_transform;
Particles() : Particles() :
particle_element(this) { inactive(true),
cycle_number = 0; inactive_time(0.0),
emitting = false; emitting(false),
one_shot = false; one_shot(false),
amount = 0; amount(0),
lifetime = 1.0; lifetime(1.0),
pre_process_time = 0.0; pre_process_time(0.0),
explosiveness = 0.0; explosiveness(0.0),
randomness = 0.0; randomness(0.0),
use_local_coords = true; restart_request(false),
fixed_fps = 0; custom_aabb(AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8))),
fractional_delta = false; use_local_coords(true),
frame_remainder = 0; draw_order(VS::PARTICLES_DRAW_ORDER_INDEX),
histories_enabled = false; histories_enabled(false),
speed_scale = 1.0; particle_element(this),
random_seed = 0; prev_ticks(0),
random_seed(0),
restart_request = false; cycle_number(0),
speed_scale(1.0),
custom_aabb = AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8)); fixed_fps(0),
fractional_delta(false),
draw_order = VS::PARTICLES_DRAW_ORDER_INDEX; frame_remainder(0),
clear(true) {
particle_buffers[0] = 0; particle_buffers[0] = 0;
particle_buffers[1] = 0; particle_buffers[1] = 0;
prev_ticks = 0;
clear = true;
inactive = true;
inactive_time = 0.0;
glGenBuffers(2, particle_buffers); glGenBuffers(2, particle_buffers);
glGenVertexArrays(2, particle_vaos); glGenVertexArrays(2, particle_vaos);
} }
@ -1309,9 +1300,9 @@ public:
GLuint color; GLuint color;
int levels; int levels;
MipMaps() { MipMaps() :
color = 0; color(0),
levels = 0; levels(0) {
} }
}; };
@ -1326,10 +1317,10 @@ public:
Vector<GLuint> depth_mipmap_fbos; //fbos for depth mipmapsla ver Vector<GLuint> depth_mipmap_fbos; //fbos for depth mipmapsla ver
SSAO() { SSAO() :
linear_depth(0) {
blur_fbo[0] = 0; blur_fbo[0] = 0;
blur_fbo[1] = 0; blur_fbo[1] = 0;
linear_depth = 0;
} }
} ssao; } ssao;
@ -1341,7 +1332,8 @@ public:
GLuint fbo; GLuint fbo;
GLuint color; GLuint color;
Exposure() { fbo = 0; } Exposure() :
fbo(0) {}
} exposure; } exposure;
uint64_t last_exposure_tick; uint64_t last_exposure_tick;
@ -1355,26 +1347,22 @@ public:
RID texture; RID texture;
RenderTarget() { RenderTarget() :
fbo(0),
msaa = VS::VIEWPORT_MSAA_DISABLED; depth(0),
width = 0; last_exposure_tick(0),
height = 0; width(0),
depth = 0; height(0),
fbo = 0; used_in_frame(false),
msaa(VS::VIEWPORT_MSAA_DISABLED) {
exposure.fbo = 0; exposure.fbo = 0;
buffers.fbo = 0; buffers.fbo = 0;
used_in_frame = false;
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) { for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) {
flags[i] = false; flags[i] = false;
} }
flags[RENDER_TARGET_HDR] = true; flags[RENDER_TARGET_HDR] = true;
buffers.active = false; buffers.active = false;
buffers.effects_active = false; buffers.effects_active = false;
last_exposure_tick = 0;
} }
}; };

View file

@ -743,35 +743,28 @@ String AudioDriverPulseAudio::capture_get_device() {
return name; return name;
} }
AudioDriverPulseAudio::AudioDriverPulseAudio() { AudioDriverPulseAudio::AudioDriverPulseAudio() :
thread(NULL),
pa_ml = NULL; mutex(NULL),
pa_ctx = NULL; pa_ml(NULL),
pa_str = NULL; pa_ctx(NULL),
pa_rec_str = NULL; pa_str(NULL),
pa_rec_str(NULL),
mutex = NULL; device_name("Default"),
thread = NULL; new_device("Default"),
default_device(""),
device_name = "Default"; mix_rate(0),
new_device = "Default"; buffer_frames(0),
default_device = ""; pa_buffer_size(0),
channels(0),
pa_ready(0),
pa_status(0),
active(false),
thread_exited(false),
exit_thread(false),
latency(0) {
samples_in.clear(); samples_in.clear();
samples_out.clear(); samples_out.clear();
mix_rate = 0;
buffer_frames = 0;
pa_buffer_size = 0;
channels = 0;
pa_ready = 0;
pa_status = 0;
active = false;
thread_exited = false;
exit_thread = false;
latency = 0;
} }
AudioDriverPulseAudio::~AudioDriverPulseAudio() { AudioDriverPulseAudio::~AudioDriverPulseAudio() {

View file

@ -194,13 +194,12 @@ void AudioDriverRtAudio::finish() {
} }
} }
AudioDriverRtAudio::AudioDriverRtAudio() { AudioDriverRtAudio::AudioDriverRtAudio() :
speaker_mode(SPEAKER_MODE_STEREO),
active = false; mutex(NULL),
mutex = NULL; dac(NULL),
dac = NULL; mix_rate(DEFAULT_MIX_RATE),
mix_rate = DEFAULT_MIX_RATE; active(false) {
speaker_mode = SPEAKER_MODE_STEREO;
} }
#endif #endif

View file

@ -309,11 +309,10 @@ FileAccess *FileAccessUnix::create_libc() {
CloseNotificationFunc FileAccessUnix::close_notification_func = NULL; CloseNotificationFunc FileAccessUnix::close_notification_func = NULL;
FileAccessUnix::FileAccessUnix() { FileAccessUnix::FileAccessUnix() :
f(NULL),
f = NULL; flags(0),
flags = 0; last_error(OK) {
last_error = OK;
} }
FileAccessUnix::~FileAccessUnix() { FileAccessUnix::~FileAccessUnix() {

View file

@ -167,10 +167,10 @@ void NetSocketPosix::cleanup() {
#endif #endif
} }
NetSocketPosix::NetSocketPosix() { NetSocketPosix::NetSocketPosix() :
_sock = SOCK_EMPTY; _sock(SOCK_EMPTY),
_ip_type = IP::TYPE_NONE; _ip_type(IP::TYPE_NONE),
_is_stream = false; _is_stream(false) {
} }
NetSocketPosix::~NetSocketPosix() { NetSocketPosix::~NetSocketPosix() {

View file

@ -58,17 +58,17 @@ class AudioDriverWASAPI : public AudioDriver {
String device_name; String device_name;
String new_device; String new_device;
AudioDeviceWASAPI() { AudioDeviceWASAPI() :
audio_client = NULL; audio_client(NULL),
render_client = NULL; render_client(NULL),
capture_client = NULL; capture_client(NULL),
active = false; active(false),
format_tag = 0; format_tag(0),
bits_per_sample = 0; bits_per_sample(0),
channels = 0; channels(0),
frame_size = 0; frame_size(0),
device_name = "Default"; device_name("Default"),
new_device = "Default"; new_device("Default") {
} }
}; };

View file

@ -307,11 +307,10 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
} }
} }
FileAccessWindows::FileAccessWindows() { FileAccessWindows::FileAccessWindows() :
f(NULL),
f = NULL; flags(0),
flags = 0; last_error(OK) {
last_error = OK;
} }
FileAccessWindows::~FileAccessWindows() { FileAccessWindows::~FileAccessWindows() {

View file

@ -93,9 +93,8 @@ void ThreadWindows::make_default() {
wait_to_finish_func = wait_to_finish_func_windows; wait_to_finish_func = wait_to_finish_func_windows;
} }
ThreadWindows::ThreadWindows() { ThreadWindows::ThreadWindows() :
handle(NULL) {
handle = NULL;
} }
ThreadWindows::~ThreadWindows() { ThreadWindows::~ThreadWindows() {

View file

@ -91,7 +91,7 @@ Error AudioDriverXAudio2::init() {
thread = Thread::create(AudioDriverXAudio2::thread_func, this); thread = Thread::create(AudioDriverXAudio2::thread_func, this);
return OK; return OK;
}; }
void AudioDriverXAudio2::thread_func(void *p_udata) { void AudioDriverXAudio2::thread_func(void *p_udata) {
@ -131,10 +131,10 @@ void AudioDriverXAudio2::thread_func(void *p_udata) {
WaitForSingleObject(ad->voice_callback.buffer_end_event, INFINITE); WaitForSingleObject(ad->voice_callback.buffer_end_event, INFINITE);
} }
} }
}; }
ad->thread_exited = true; ad->thread_exited = true;
}; }
void AudioDriverXAudio2::start() { void AudioDriverXAudio2::start() {
@ -144,17 +144,17 @@ void AudioDriverXAudio2::start() {
ERR_EXPLAIN("XAudio2 start error " + itos(hr)); ERR_EXPLAIN("XAudio2 start error " + itos(hr));
ERR_FAIL(); ERR_FAIL();
} }
}; }
int AudioDriverXAudio2::get_mix_rate() const { int AudioDriverXAudio2::get_mix_rate() const {
return mix_rate; return mix_rate;
}; }
AudioDriver::SpeakerMode AudioDriverXAudio2::get_speaker_mode() const { AudioDriver::SpeakerMode AudioDriverXAudio2::get_speaker_mode() const {
return speaker_mode; return speaker_mode;
}; }
float AudioDriverXAudio2::get_latency() { float AudioDriverXAudio2::get_latency() {
@ -172,13 +172,13 @@ void AudioDriverXAudio2::lock() {
if (!thread || !mutex) if (!thread || !mutex)
return; return;
mutex->lock(); mutex->lock();
}; }
void AudioDriverXAudio2::unlock() { void AudioDriverXAudio2::unlock() {
if (!thread || !mutex) if (!thread || !mutex)
return; return;
mutex->unlock(); mutex->unlock();
}; }
void AudioDriverXAudio2::finish() { void AudioDriverXAudio2::finish() {
@ -195,12 +195,12 @@ void AudioDriverXAudio2::finish() {
if (samples_in) { if (samples_in) {
memdelete_arr(samples_in); memdelete_arr(samples_in);
}; }
if (samples_out[0]) { if (samples_out[0]) {
for (int i = 0; i < AUDIO_BUFFERS; i++) { for (int i = 0; i < AUDIO_BUFFERS; i++) {
memdelete_arr(samples_out[i]); memdelete_arr(samples_out[i]);
} }
}; }
mastering_voice->DestroyVoice(); mastering_voice->DestroyVoice();
@ -208,20 +208,18 @@ void AudioDriverXAudio2::finish() {
if (mutex) if (mutex)
memdelete(mutex); memdelete(mutex);
thread = NULL; thread = NULL;
}; }
AudioDriverXAudio2::AudioDriverXAudio2() { AudioDriverXAudio2::AudioDriverXAudio2() :
thread(NULL),
mutex = NULL; mutex(NULL),
thread = NULL; current_buffer(0) {
wave_format = { 0 }; wave_format = { 0 };
for (int i = 0; i < AUDIO_BUFFERS; i++) { for (int i = 0; i < AUDIO_BUFFERS; i++) {
xaudio_buffer[i] = { 0 }; xaudio_buffer[i] = { 0 };
samples_out[i] = 0; samples_out[i] = 0;
} }
current_buffer = 0; }
};
AudioDriverXAudio2::~AudioDriverXAudio2(){ AudioDriverXAudio2::~AudioDriverXAudio2() {
}
};

View file

@ -110,14 +110,13 @@ public:
float z_near; float z_near;
float z_far; float z_far;
CameraData() { CameraData() :
mode(MODE_PERSPECTIVE),
mode = MODE_PERSPECTIVE; aspect(1),
perspective.y_fov = 0; z_near(0.1),
z_far(100) {
perspective.x_fov = 0; perspective.x_fov = 0;
aspect = 1; perspective.y_fov = 0;
z_near = 0.1;
z_far = 100;
} }
}; };
@ -141,16 +140,14 @@ public:
float spot_angle; float spot_angle;
float spot_exp; float spot_exp;
LightData() { LightData() :
mode(MODE_AMBIENT),
mode = MODE_AMBIENT; color(Color(1, 1, 1, 1)),
color = Color(1, 1, 1, 1); constant_att(0),
constant_att = 0; linear_att(0),
linear_att = 0; quad_att(0),
quad_att = 0; spot_angle(45),
spot_exp(1) {
spot_angle = 45;
spot_exp = 1;
} }
}; };
@ -580,11 +577,11 @@ public:
float animation_length; float animation_length;
State() { State() :
unit_scale = 1.0; import_flags(0),
up_axis = Vector3::AXIS_Y; unit_scale(1.0),
import_flags = 0; up_axis(Vector3::AXIS_Y),
animation_length = 0; animation_length(0) {
} }
} state; } state;

View file

@ -222,11 +222,10 @@ String EditorExportPreset::get_custom_features() const {
return custom_features; return custom_features;
} }
EditorExportPreset::EditorExportPreset() { EditorExportPreset::EditorExportPreset() :
export_filter(EXPORT_ALL_RESOURCES),
export_path = ""; export_path(""),
export_filter = EXPORT_ALL_RESOURCES; runnable(false) {
runnable = false;
} }
/////////////////////////////////// ///////////////////////////////////

View file

@ -206,9 +206,9 @@ public:
PropertyInfo option; PropertyInfo option;
Variant default_value; Variant default_value;
ExportOption(const PropertyInfo &p_info, const Variant &p_default) { ExportOption(const PropertyInfo &p_info, const Variant &p_default) :
option = p_info; option(p_info),
default_value = p_default; default_value(p_default) {
} }
ExportOption() {} ExportOption() {}
}; };

View file

@ -579,18 +579,12 @@ bool EditorHelpSearch::Runner::work(uint64_t slot) {
return true; return true;
} }
EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags) { EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags) :
phase(0),
ui_service = p_icon_service; ui_service(p_icon_service),
results_tree = p_results_tree; results_tree(p_results_tree),
term = p_term.strip_edges(); term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()),
search_flags = p_search_flags; search_flags(p_search_flags),
empty_icon(ui_service->get_icon("ArrowRight", "EditorIcons")),
if ((search_flags & SEARCH_CASE_SENSITIVE) == 0) disabled_color(ui_service->get_color("disabled_font_color", "Editor")) {
term = term.to_lower();
empty_icon = ui_service->get_icon("ArrowRight", "EditorIcons");
disabled_color = ui_service->get_color("disabled_font_color", "Editor");
phase = 0;
} }

View file

@ -829,11 +829,11 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(DOCK_SLOT_MAX); BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
} }
EditorPlugin::EditorPlugin() { EditorPlugin::EditorPlugin() :
undo_redo = NULL; undo_redo(NULL),
input_event_forwarding_always_enabled = false; input_event_forwarding_always_enabled(false),
force_draw_over_forwarding_enabled = false; force_draw_over_forwarding_enabled(false),
last_main_screen_name = ""; last_main_screen_name("") {
} }
EditorPlugin::~EditorPlugin() { EditorPlugin::~EditorPlugin() {

View file

@ -298,19 +298,18 @@ EditorInspector *SectionedInspector::get_inspector() {
return inspector; return inspector;
} }
SectionedInspector::SectionedInspector() { SectionedInspector::SectionedInspector() :
obj(-1),
obj = -1; sections(memnew(Tree)),
filter(memnew(SectionedInspectorFilter)),
search_box = NULL; inspector(memnew(EditorInspector)),
search_box(NULL) {
add_constant_override("autohide", 1); // Fixes the dragger always showing up add_constant_override("autohide", 1); // Fixes the dragger always showing up
VBoxContainer *left_vb = memnew(VBoxContainer); VBoxContainer *left_vb = memnew(VBoxContainer);
left_vb->set_custom_minimum_size(Size2(170, 0) * EDSCALE); left_vb->set_custom_minimum_size(Size2(170, 0) * EDSCALE);
add_child(left_vb); add_child(left_vb);
sections = memnew(Tree);
sections->set_v_size_flags(SIZE_EXPAND_FILL); sections->set_v_size_flags(SIZE_EXPAND_FILL);
sections->set_hide_root(true); sections->set_hide_root(true);
@ -321,8 +320,6 @@ SectionedInspector::SectionedInspector() {
right_vb->set_h_size_flags(SIZE_EXPAND_FILL); right_vb->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(right_vb); add_child(right_vb);
filter = memnew(SectionedInspectorFilter);
inspector = memnew(EditorInspector);
inspector->set_v_size_flags(SIZE_EXPAND_FILL); inspector->set_v_size_flags(SIZE_EXPAND_FILL);
right_vb->add_child(inspector, true); right_vb->add_child(inspector, true);
inspector->set_use_doc_hints(true); inspector->set_use_doc_hints(true);

View file

@ -71,23 +71,23 @@ private:
bool hide_from_editor; bool hide_from_editor;
bool save; bool save;
bool restart_if_changed; bool restart_if_changed;
VariantContainer() { VariantContainer() :
variant = Variant(); order(0),
initial = Variant(); variant(Variant()),
order = 0; initial(Variant()),
hide_from_editor = false; has_default_value(false),
has_default_value = false; hide_from_editor(false),
save = false; save(false),
restart_if_changed = false; restart_if_changed(false) {
} }
VariantContainer(const Variant &p_variant, int p_order) { VariantContainer(const Variant &p_variant, int p_order) :
variant = p_variant; order(p_order),
initial = Variant(); variant(p_variant),
order = p_order; initial(Variant()),
hide_from_editor = false; has_default_value(false),
has_default_value = false; hide_from_editor(false),
save = false; save(false),
restart_if_changed = false; restart_if_changed(false) {
} }
}; };

View file

@ -114,14 +114,14 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Vector<int> children; Vector<int> children;
Vector<Node *> godot_nodes; Vector<Node *> godot_nodes;
GLTFNode() { GLTFNode() :
// child_of_skeleton = -1; parent(-1),
// skeleton_skin = -1; mesh(-1),
mesh = -1; camera(-1),
camera = -1; skin(-1),
parent = -1; //skeleton_skin(-1),
skin = -1; //child_of_skeleton(-1),
scale = Vector3(1, 1, 1); scale(Vector3(1, 1, 1)) {
} }
}; };
@ -134,12 +134,12 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
bool indices; bool indices;
//matrices need to be transformed to this //matrices need to be transformed to this
GLTFBufferView() { GLTFBufferView() :
buffer = 0; buffer(0),
byte_offset = 0; byte_offset(0),
byte_length = 0; byte_length(0),
byte_stride = 0; byte_stride(0),
indices = false; indices(false) {
} }
}; };

View file

@ -826,13 +826,11 @@ void AbstractPolygon2DEditorPlugin::make_visible(bool p_visible) {
} }
} }
AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(EditorNode *p_node, AbstractPolygon2DEditor *p_polygon_editor, String p_class) { AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(EditorNode *p_node, AbstractPolygon2DEditor *p_polygon_editor, String p_class) :
polygon_editor(p_polygon_editor),
editor = p_node; editor(p_node),
polygon_editor = p_polygon_editor; klass(p_class) {
klass = p_class;
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(polygon_editor); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(polygon_editor);
polygon_editor->hide(); polygon_editor->hide();
} }

View file

@ -70,9 +70,9 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
String name; String name;
String type; String type;
Ref<Script> script; Ref<Script> script;
AddOption(const String &p_name = String(), const String &p_type = String()) { AddOption(const String &p_name = String(), const String &p_type = String()) :
name = p_name; name(p_name),
type = p_type; type(p_type) {
} }
}; };