Merge pull request #24241 from Rubonnek/move-to-initializer-list
Moved member variables to initializer list
This commit is contained in:
commit
c8a5400654
44 changed files with 609 additions and 694 deletions
|
|
@ -159,7 +159,7 @@ Error AudioDriverALSA::init() {
|
|||
}
|
||||
|
||||
return err;
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverALSA::thread_func(void *p_udata) {
|
||||
|
||||
|
|
@ -232,25 +232,25 @@ void AudioDriverALSA::thread_func(void *p_udata) {
|
|||
|
||||
ad->stop_counting_ticks();
|
||||
ad->unlock();
|
||||
};
|
||||
}
|
||||
|
||||
ad->thread_exited = true;
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverALSA::start() {
|
||||
|
||||
active = true;
|
||||
};
|
||||
}
|
||||
|
||||
int AudioDriverALSA::get_mix_rate() const {
|
||||
|
||||
return mix_rate;
|
||||
};
|
||||
}
|
||||
|
||||
AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const {
|
||||
|
||||
return speaker_mode;
|
||||
};
|
||||
}
|
||||
|
||||
Array AudioDriverALSA::get_device_list() {
|
||||
|
||||
|
|
@ -302,14 +302,14 @@ void AudioDriverALSA::lock() {
|
|||
if (!thread || !mutex)
|
||||
return;
|
||||
mutex->lock();
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverALSA::unlock() {
|
||||
|
||||
if (!thread || !mutex)
|
||||
return;
|
||||
mutex->unlock();
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverALSA::finish_device() {
|
||||
|
||||
|
|
@ -337,18 +337,15 @@ void AudioDriverALSA::finish() {
|
|||
finish_device();
|
||||
}
|
||||
|
||||
AudioDriverALSA::AudioDriverALSA() {
|
||||
AudioDriverALSA::AudioDriverALSA() :
|
||||
thread(NULL),
|
||||
mutex(NULL),
|
||||
pcm_handle(NULL),
|
||||
device_name("Default"),
|
||||
new_device("Default") {
|
||||
}
|
||||
|
||||
mutex = NULL;
|
||||
thread = NULL;
|
||||
pcm_handle = NULL;
|
||||
|
||||
device_name = "Default";
|
||||
new_device = "Default";
|
||||
};
|
||||
|
||||
AudioDriverALSA::~AudioDriverALSA(){
|
||||
|
||||
};
|
||||
AudioDriverALSA::~AudioDriverALSA() {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -684,22 +684,18 @@ String AudioDriverCoreAudio::capture_get_device() {
|
|||
|
||||
#endif
|
||||
|
||||
AudioDriverCoreAudio::AudioDriverCoreAudio() {
|
||||
audio_unit = NULL;
|
||||
input_unit = NULL;
|
||||
active = false;
|
||||
mutex = NULL;
|
||||
|
||||
mix_rate = 0;
|
||||
channels = 2;
|
||||
capture_channels = 2;
|
||||
|
||||
buffer_frames = 0;
|
||||
|
||||
AudioDriverCoreAudio::AudioDriverCoreAudio() :
|
||||
audio_unit(NULL),
|
||||
input_unit(NULL),
|
||||
active(false),
|
||||
mutex(NULL),
|
||||
device_name("Default"),
|
||||
capture_device_name("Default"),
|
||||
mix_rate(0),
|
||||
channels(2),
|
||||
capture_channels(2),
|
||||
buffer_frames(0) {
|
||||
samples_in.clear();
|
||||
|
||||
device_name = "Default";
|
||||
capture_device_name = "Default";
|
||||
}
|
||||
|
||||
AudioDriverCoreAudio::~AudioDriverCoreAudio(){};
|
||||
|
|
|
|||
|
|
@ -112,13 +112,11 @@ PoolStringArray MIDIDriverCoreMidi::get_connected_inputs() {
|
|||
return list;
|
||||
}
|
||||
|
||||
MIDIDriverCoreMidi::MIDIDriverCoreMidi() {
|
||||
|
||||
client = 0;
|
||||
MIDIDriverCoreMidi::MIDIDriverCoreMidi() :
|
||||
client(0) {
|
||||
}
|
||||
|
||||
MIDIDriverCoreMidi::~MIDIDriverCoreMidi() {
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -371,33 +371,28 @@ public:
|
|||
float fog_height_max;
|
||||
float fog_height_curve;
|
||||
|
||||
Environment() {
|
||||
bg_mode = VS::ENV_BG_CLEAR_COLOR;
|
||||
sky_custom_fov = 0.0;
|
||||
bg_energy = 1.0;
|
||||
sky_ambient = 0;
|
||||
ambient_energy = 1.0;
|
||||
ambient_sky_contribution = 0.0;
|
||||
canvas_max_layer = 0;
|
||||
|
||||
fog_enabled = false;
|
||||
fog_color = Color(0.5, 0.5, 0.5);
|
||||
fog_sun_color = Color(0.8, 0.8, 0.0);
|
||||
fog_sun_amount = 0;
|
||||
|
||||
fog_depth_enabled = true;
|
||||
|
||||
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;
|
||||
Environment() :
|
||||
bg_mode(VS::ENV_BG_CLEAR_COLOR),
|
||||
sky_custom_fov(0.0),
|
||||
bg_energy(1.0),
|
||||
sky_ambient(0),
|
||||
ambient_energy(1.0),
|
||||
ambient_sky_contribution(0.0),
|
||||
canvas_max_layer(0),
|
||||
fog_enabled(false),
|
||||
fog_color(Color(0.5, 0.5, 0.5)),
|
||||
fog_sun_color(Color(0.8, 0.8, 0.0)),
|
||||
fog_sun_amount(0),
|
||||
fog_depth_enabled(true),
|
||||
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) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -131,10 +131,9 @@ public:
|
|||
}
|
||||
} render, render_final, snap;
|
||||
|
||||
Info() {
|
||||
|
||||
texture_mem = 0;
|
||||
vertex_mem = 0;
|
||||
Info() :
|
||||
texture_mem(0),
|
||||
vertex_mem(0) {
|
||||
render.reset();
|
||||
render_final.reset();
|
||||
}
|
||||
|
|
@ -254,30 +253,31 @@ public:
|
|||
VisualServer::TextureDetectCallback detect_normal;
|
||||
void *detect_normal_ud;
|
||||
|
||||
Texture() {
|
||||
alloc_width = 0;
|
||||
alloc_height = 0;
|
||||
target = 0;
|
||||
|
||||
stored_cube_sides = 0;
|
||||
ignore_mipmaps = false;
|
||||
render_target = NULL;
|
||||
flags = width = height = 0;
|
||||
tex_id = 0;
|
||||
data_size = 0;
|
||||
format = Image::FORMAT_L8;
|
||||
active = false;
|
||||
compressed = false;
|
||||
total_data_size = 0;
|
||||
mipmaps = 0;
|
||||
detect_3d = NULL;
|
||||
detect_3d_ud = NULL;
|
||||
detect_srgb = NULL;
|
||||
detect_srgb_ud = NULL;
|
||||
detect_normal = NULL;
|
||||
detect_normal_ud = NULL;
|
||||
proxy = NULL;
|
||||
redraw_if_visible = false;
|
||||
Texture() :
|
||||
proxy(NULL),
|
||||
flags(0),
|
||||
width(0),
|
||||
height(0),
|
||||
alloc_width(0),
|
||||
alloc_height(0),
|
||||
format(Image::FORMAT_L8),
|
||||
target(0),
|
||||
data_size(0),
|
||||
total_data_size(0),
|
||||
ignore_mipmaps(false),
|
||||
compressed(false),
|
||||
mipmaps(0),
|
||||
active(false),
|
||||
tex_id(0),
|
||||
stored_cube_sides(0),
|
||||
render_target(NULL),
|
||||
redraw_if_visible(false),
|
||||
detect_3d(NULL),
|
||||
detect_3d_ud(NULL),
|
||||
detect_srgb(NULL),
|
||||
detect_srgb_ud(NULL),
|
||||
detect_normal(NULL),
|
||||
detect_normal_ud(NULL) {
|
||||
}
|
||||
|
||||
_ALWAYS_INLINE_ Texture *get_ptr() {
|
||||
|
|
@ -615,20 +615,15 @@ public:
|
|||
|
||||
int total_data_size;
|
||||
|
||||
Surface() {
|
||||
array_byte_size = 0;
|
||||
index_array_byte_size = 0;
|
||||
|
||||
array_len = 0;
|
||||
index_array_len = 0;
|
||||
|
||||
mesh = NULL;
|
||||
|
||||
primitive = VS::PRIMITIVE_POINTS;
|
||||
|
||||
active = false;
|
||||
|
||||
total_data_size = 0;
|
||||
Surface() :
|
||||
mesh(NULL),
|
||||
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) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -658,9 +653,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
Mesh() {
|
||||
blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED;
|
||||
blend_shape_count = 0;
|
||||
Mesh() :
|
||||
blend_shape_count(0),
|
||||
blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -731,22 +726,18 @@ public:
|
|||
bool dirty_data;
|
||||
|
||||
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),
|
||||
mesh_list(this) {
|
||||
dirty_aabb = true;
|
||||
dirty_data = true;
|
||||
|
||||
xform_floats = 0;
|
||||
color_floats = 0;
|
||||
custom_data_floats = 0;
|
||||
|
||||
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;
|
||||
mesh_list(this),
|
||||
visible_instances(-1),
|
||||
xform_floats(0),
|
||||
color_floats(0),
|
||||
custom_data_floats(0),
|
||||
dirty_aabb(true),
|
||||
dirty_data(true) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -847,10 +838,10 @@ public:
|
|||
Set<RasterizerScene::InstanceBase *> instances;
|
||||
|
||||
Skeleton() :
|
||||
use_2d(false),
|
||||
size(0),
|
||||
tex_id(0),
|
||||
update_list(this) {
|
||||
tex_id = 0;
|
||||
size = 0;
|
||||
use_2d = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1121,11 +1112,11 @@ public:
|
|||
|
||||
GLuint color;
|
||||
|
||||
Effect() {
|
||||
fbo = 0;
|
||||
width = 0;
|
||||
height = 0;
|
||||
color = 0;
|
||||
Effect() :
|
||||
fbo(0),
|
||||
width(0),
|
||||
height(0),
|
||||
color(0) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1140,22 +1131,17 @@ public:
|
|||
|
||||
RID texture;
|
||||
|
||||
RenderTarget() {
|
||||
fbo = 0;
|
||||
|
||||
color = 0;
|
||||
depth = 0;
|
||||
|
||||
width = 0;
|
||||
height = 0;
|
||||
|
||||
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) {
|
||||
RenderTarget() :
|
||||
fbo(0),
|
||||
color(0),
|
||||
depth(0),
|
||||
width(0),
|
||||
height(0),
|
||||
used_in_frame(false),
|
||||
msaa(VS::VIEWPORT_MSAA_DISABLED) {
|
||||
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
|
||||
flags[i] = false;
|
||||
}
|
||||
|
||||
used_in_frame = false;
|
||||
|
||||
msaa = VS::VIEWPORT_MSAA_DISABLED;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -450,89 +450,77 @@ public:
|
|||
float fog_height_max;
|
||||
float fog_height_curve;
|
||||
|
||||
Environment() {
|
||||
bg_mode = VS::ENV_BG_CLEAR_COLOR;
|
||||
sky_custom_fov = 0.0;
|
||||
bg_energy = 1.0;
|
||||
sky_ambient = 0;
|
||||
ambient_energy = 1.0;
|
||||
ambient_sky_contribution = 0.0;
|
||||
canvas_max_layer = 0;
|
||||
|
||||
ssr_enabled = false;
|
||||
ssr_max_steps = 64;
|
||||
ssr_fade_in = 0.15;
|
||||
ssr_fade_out = 2.0;
|
||||
ssr_depth_tolerance = 0.2;
|
||||
ssr_roughness = true;
|
||||
|
||||
ssao_enabled = false;
|
||||
ssao_intensity = 1.0;
|
||||
ssao_radius = 1.0;
|
||||
ssao_intensity2 = 1.0;
|
||||
ssao_radius2 = 0.0;
|
||||
ssao_bias = 0.01;
|
||||
ssao_light_affect = 0;
|
||||
ssao_ao_channel_affect = 0;
|
||||
ssao_filter = VS::ENV_SSAO_BLUR_3x3;
|
||||
ssao_quality = VS::ENV_SSAO_QUALITY_LOW;
|
||||
ssao_bilateral_sharpness = 4;
|
||||
|
||||
tone_mapper = VS::ENV_TONE_MAPPER_LINEAR;
|
||||
tone_mapper_exposure = 1.0;
|
||||
tone_mapper_exposure_white = 1.0;
|
||||
auto_exposure = false;
|
||||
auto_exposure_speed = 0.5;
|
||||
auto_exposure_min = 0.05;
|
||||
auto_exposure_max = 8;
|
||||
auto_exposure_grey = 0.4;
|
||||
|
||||
glow_enabled = false;
|
||||
glow_levels = (1 << 2) | (1 << 4);
|
||||
glow_intensity = 0.8;
|
||||
glow_strength = 1.0;
|
||||
glow_bloom = 0.0;
|
||||
glow_blend_mode = VS::GLOW_BLEND_MODE_SOFTLIGHT;
|
||||
glow_hdr_bleed_threshold = 1.0;
|
||||
glow_hdr_bleed_scale = 2.0;
|
||||
glow_hdr_luminance_cap = 12.0;
|
||||
glow_bicubic_upscale = false;
|
||||
|
||||
dof_blur_far_enabled = false;
|
||||
dof_blur_far_distance = 10;
|
||||
dof_blur_far_transition = 5;
|
||||
dof_blur_far_amount = 0.1;
|
||||
dof_blur_far_quality = VS::ENV_DOF_BLUR_QUALITY_MEDIUM;
|
||||
|
||||
dof_blur_near_enabled = false;
|
||||
dof_blur_near_distance = 2;
|
||||
dof_blur_near_transition = 1;
|
||||
dof_blur_near_amount = 0.1;
|
||||
dof_blur_near_quality = VS::ENV_DOF_BLUR_QUALITY_MEDIUM;
|
||||
|
||||
adjustments_enabled = false;
|
||||
adjustments_brightness = 1.0;
|
||||
adjustments_contrast = 1.0;
|
||||
adjustments_saturation = 1.0;
|
||||
|
||||
fog_enabled = false;
|
||||
fog_color = Color(0.5, 0.5, 0.5);
|
||||
fog_sun_color = Color(0.8, 0.8, 0.0);
|
||||
fog_sun_amount = 0;
|
||||
|
||||
fog_depth_enabled = true;
|
||||
|
||||
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;
|
||||
Environment() :
|
||||
bg_mode(VS::ENV_BG_CLEAR_COLOR),
|
||||
sky_custom_fov(0.0),
|
||||
bg_energy(1.0),
|
||||
sky_ambient(0),
|
||||
ambient_energy(1.0),
|
||||
ambient_sky_contribution(0.0),
|
||||
canvas_max_layer(0),
|
||||
ssr_enabled(false),
|
||||
ssr_max_steps(64),
|
||||
ssr_fade_in(0.15),
|
||||
ssr_fade_out(2.0),
|
||||
ssr_depth_tolerance(0.2),
|
||||
ssr_roughness(true),
|
||||
ssao_enabled(false),
|
||||
ssao_intensity(1.0),
|
||||
ssao_radius(1.0),
|
||||
ssao_intensity2(1.0),
|
||||
ssao_radius2(0.0),
|
||||
ssao_bias(0.01),
|
||||
ssao_light_affect(0),
|
||||
ssao_ao_channel_affect(0),
|
||||
ssao_quality(VS::ENV_SSAO_QUALITY_LOW),
|
||||
ssao_bilateral_sharpness(4),
|
||||
ssao_filter(VS::ENV_SSAO_BLUR_3x3),
|
||||
glow_enabled(false),
|
||||
glow_levels((1 << 2) | (1 << 4)),
|
||||
glow_intensity(0.8),
|
||||
glow_strength(1.0),
|
||||
glow_bloom(0.0),
|
||||
glow_blend_mode(VS::GLOW_BLEND_MODE_SOFTLIGHT),
|
||||
glow_hdr_bleed_threshold(1.0),
|
||||
glow_hdr_bleed_scale(2.0),
|
||||
glow_hdr_luminance_cap(12.0),
|
||||
glow_bicubic_upscale(false),
|
||||
tone_mapper(VS::ENV_TONE_MAPPER_LINEAR),
|
||||
tone_mapper_exposure(1.0),
|
||||
tone_mapper_exposure_white(1.0),
|
||||
auto_exposure(false),
|
||||
auto_exposure_speed(0.5),
|
||||
auto_exposure_min(0.05),
|
||||
auto_exposure_max(8),
|
||||
auto_exposure_grey(0.4),
|
||||
dof_blur_far_enabled(false),
|
||||
dof_blur_far_distance(10),
|
||||
dof_blur_far_transition(5),
|
||||
dof_blur_far_amount(0.1),
|
||||
dof_blur_far_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
|
||||
dof_blur_near_enabled(false),
|
||||
dof_blur_near_distance(2),
|
||||
dof_blur_near_transition(1),
|
||||
dof_blur_near_amount(0.1),
|
||||
dof_blur_near_quality(VS::ENV_DOF_BLUR_QUALITY_MEDIUM),
|
||||
adjustments_enabled(false),
|
||||
adjustments_brightness(1.0),
|
||||
adjustments_contrast(1.0),
|
||||
adjustments_saturation(1.0),
|
||||
fog_enabled(false),
|
||||
fog_color(Color(0.5, 0.5, 0.5)),
|
||||
fog_sun_color(Color(0.8, 0.8, 0.0)),
|
||||
fog_sun_amount(0),
|
||||
fog_depth_enabled(true),
|
||||
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;
|
||||
Transform transform_to_data;
|
||||
|
||||
GIProbeInstance() {
|
||||
probe = NULL;
|
||||
tex_cache = 0;
|
||||
GIProbeInstance() :
|
||||
probe(NULL),
|
||||
tex_cache(0) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -285,29 +285,30 @@ public:
|
|||
VisualServer::TextureDetectCallback detect_normal;
|
||||
void *detect_normal_ud;
|
||||
|
||||
Texture() {
|
||||
|
||||
using_srgb = false;
|
||||
stored_cube_sides = 0;
|
||||
ignore_mipmaps = false;
|
||||
render_target = NULL;
|
||||
flags = width = height = 0;
|
||||
tex_id = 0;
|
||||
data_size = 0;
|
||||
format = Image::FORMAT_L8;
|
||||
active = false;
|
||||
compressed = false;
|
||||
total_data_size = 0;
|
||||
target = GL_TEXTURE_2D;
|
||||
mipmaps = 0;
|
||||
detect_3d = NULL;
|
||||
detect_3d_ud = NULL;
|
||||
detect_srgb = NULL;
|
||||
detect_srgb_ud = NULL;
|
||||
detect_normal = NULL;
|
||||
detect_normal_ud = NULL;
|
||||
proxy = NULL;
|
||||
redraw_if_visible = false;
|
||||
Texture() :
|
||||
proxy(NULL),
|
||||
flags(0),
|
||||
width(0),
|
||||
height(0),
|
||||
format(Image::FORMAT_L8),
|
||||
target(GL_TEXTURE_2D),
|
||||
data_size(0),
|
||||
compressed(false),
|
||||
total_data_size(0),
|
||||
ignore_mipmaps(false),
|
||||
mipmaps(0),
|
||||
active(false),
|
||||
tex_id(0),
|
||||
using_srgb(false),
|
||||
redraw_if_visible(false),
|
||||
stored_cube_sides(0),
|
||||
render_target(NULL),
|
||||
detect_3d(NULL),
|
||||
detect_3d_ud(NULL),
|
||||
detect_srgb(NULL),
|
||||
detect_srgb_ud(NULL),
|
||||
detect_normal(NULL),
|
||||
detect_normal_ud(NULL) {
|
||||
}
|
||||
|
||||
_ALWAYS_INLINE_ Texture *get_ptr() {
|
||||
|
|
@ -553,16 +554,16 @@ public:
|
|||
bool is_animated_cache;
|
||||
|
||||
Material() :
|
||||
shader(NULL),
|
||||
ubo_id(0),
|
||||
ubo_size(0),
|
||||
list(this),
|
||||
dirty_list(this) {
|
||||
can_cast_shadow_cache = false;
|
||||
is_animated_cache = false;
|
||||
shader = NULL;
|
||||
line_width = 1.0;
|
||||
ubo_id = 0;
|
||||
ubo_size = 0;
|
||||
last_pass = 0;
|
||||
render_priority = 0;
|
||||
dirty_list(this),
|
||||
line_width(1.0),
|
||||
render_priority(0),
|
||||
last_pass(0),
|
||||
can_cast_shadow_cache(false),
|
||||
is_animated_cache(false) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -661,27 +662,24 @@ public:
|
|||
|
||||
int total_data_size;
|
||||
|
||||
Surface() {
|
||||
|
||||
array_byte_size = 0;
|
||||
index_array_byte_size = 0;
|
||||
mesh = NULL;
|
||||
format = 0;
|
||||
array_id = 0;
|
||||
vertex_id = 0;
|
||||
index_id = 0;
|
||||
array_len = 0;
|
||||
Surface() :
|
||||
mesh(NULL),
|
||||
format(0),
|
||||
array_id(0),
|
||||
vertex_id(0),
|
||||
index_id(0),
|
||||
index_wireframe_id(0),
|
||||
array_wireframe_id(0),
|
||||
instancing_array_wireframe_id(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;
|
||||
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() {
|
||||
|
|
@ -708,11 +706,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
Mesh() {
|
||||
blend_shape_mode = VS::BLEND_SHAPE_MODE_NORMALIZED;
|
||||
blend_shape_count = 0;
|
||||
last_pass = 0;
|
||||
active = false;
|
||||
Mesh() :
|
||||
active(false),
|
||||
blend_shape_count(0),
|
||||
blend_shape_mode(VS::BLEND_SHAPE_MODE_NORMALIZED),
|
||||
last_pass(0) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -780,19 +778,19 @@ public:
|
|||
bool dirty_data;
|
||||
|
||||
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),
|
||||
mesh_list(this) {
|
||||
dirty_aabb = true;
|
||||
dirty_data = true;
|
||||
xform_floats = 0;
|
||||
color_floats = 0;
|
||||
custom_data_floats = 0;
|
||||
visible_instances = -1;
|
||||
size = 0;
|
||||
buffer = 0;
|
||||
transform_format = VS::MULTIMESH_TRANSFORM_2D;
|
||||
color_format = VS::MULTIMESH_COLOR_NONE;
|
||||
custom_data_format = VS::MULTIMESH_CUSTOM_DATA_NONE;
|
||||
mesh_list(this),
|
||||
buffer(0),
|
||||
visible_instances(-1),
|
||||
xform_floats(0),
|
||||
color_floats(0),
|
||||
custom_data_floats(0),
|
||||
dirty_aabb(true),
|
||||
dirty_data(true) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -889,11 +887,10 @@ public:
|
|||
Transform2D base_transform_2d;
|
||||
|
||||
Skeleton() :
|
||||
use_2d(false),
|
||||
size(0),
|
||||
texture(0),
|
||||
update_list(this) {
|
||||
size = 0;
|
||||
|
||||
use_2d = false;
|
||||
texture = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1174,37 +1171,31 @@ public:
|
|||
Transform emission_transform;
|
||||
|
||||
Particles() :
|
||||
particle_element(this) {
|
||||
cycle_number = 0;
|
||||
emitting = false;
|
||||
one_shot = false;
|
||||
amount = 0;
|
||||
lifetime = 1.0;
|
||||
pre_process_time = 0.0;
|
||||
explosiveness = 0.0;
|
||||
randomness = 0.0;
|
||||
use_local_coords = true;
|
||||
fixed_fps = 0;
|
||||
fractional_delta = false;
|
||||
frame_remainder = 0;
|
||||
histories_enabled = false;
|
||||
speed_scale = 1.0;
|
||||
random_seed = 0;
|
||||
|
||||
restart_request = false;
|
||||
|
||||
custom_aabb = AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8));
|
||||
|
||||
draw_order = VS::PARTICLES_DRAW_ORDER_INDEX;
|
||||
inactive(true),
|
||||
inactive_time(0.0),
|
||||
emitting(false),
|
||||
one_shot(false),
|
||||
amount(0),
|
||||
lifetime(1.0),
|
||||
pre_process_time(0.0),
|
||||
explosiveness(0.0),
|
||||
randomness(0.0),
|
||||
restart_request(false),
|
||||
custom_aabb(AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8))),
|
||||
use_local_coords(true),
|
||||
draw_order(VS::PARTICLES_DRAW_ORDER_INDEX),
|
||||
histories_enabled(false),
|
||||
particle_element(this),
|
||||
prev_ticks(0),
|
||||
random_seed(0),
|
||||
cycle_number(0),
|
||||
speed_scale(1.0),
|
||||
fixed_fps(0),
|
||||
fractional_delta(false),
|
||||
frame_remainder(0),
|
||||
clear(true) {
|
||||
particle_buffers[0] = 0;
|
||||
particle_buffers[1] = 0;
|
||||
|
||||
prev_ticks = 0;
|
||||
|
||||
clear = true;
|
||||
inactive = true;
|
||||
inactive_time = 0.0;
|
||||
|
||||
glGenBuffers(2, particle_buffers);
|
||||
glGenVertexArrays(2, particle_vaos);
|
||||
}
|
||||
|
|
@ -1309,9 +1300,9 @@ public:
|
|||
GLuint color;
|
||||
int levels;
|
||||
|
||||
MipMaps() {
|
||||
color = 0;
|
||||
levels = 0;
|
||||
MipMaps() :
|
||||
color(0),
|
||||
levels(0) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1326,10 +1317,10 @@ public:
|
|||
|
||||
Vector<GLuint> depth_mipmap_fbos; //fbos for depth mipmapsla ver
|
||||
|
||||
SSAO() {
|
||||
SSAO() :
|
||||
linear_depth(0) {
|
||||
blur_fbo[0] = 0;
|
||||
blur_fbo[1] = 0;
|
||||
linear_depth = 0;
|
||||
}
|
||||
} ssao;
|
||||
|
||||
|
|
@ -1341,7 +1332,8 @@ public:
|
|||
GLuint fbo;
|
||||
GLuint color;
|
||||
|
||||
Exposure() { fbo = 0; }
|
||||
Exposure() :
|
||||
fbo(0) {}
|
||||
} exposure;
|
||||
|
||||
uint64_t last_exposure_tick;
|
||||
|
|
@ -1355,26 +1347,22 @@ public:
|
|||
|
||||
RID texture;
|
||||
|
||||
RenderTarget() {
|
||||
|
||||
msaa = VS::VIEWPORT_MSAA_DISABLED;
|
||||
width = 0;
|
||||
height = 0;
|
||||
depth = 0;
|
||||
fbo = 0;
|
||||
RenderTarget() :
|
||||
fbo(0),
|
||||
depth(0),
|
||||
last_exposure_tick(0),
|
||||
width(0),
|
||||
height(0),
|
||||
used_in_frame(false),
|
||||
msaa(VS::VIEWPORT_MSAA_DISABLED) {
|
||||
exposure.fbo = 0;
|
||||
buffers.fbo = 0;
|
||||
used_in_frame = false;
|
||||
|
||||
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; i++) {
|
||||
flags[i] = false;
|
||||
}
|
||||
flags[RENDER_TARGET_HDR] = true;
|
||||
|
||||
buffers.active = false;
|
||||
buffers.effects_active = false;
|
||||
|
||||
last_exposure_tick = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -743,35 +743,28 @@ String AudioDriverPulseAudio::capture_get_device() {
|
|||
return name;
|
||||
}
|
||||
|
||||
AudioDriverPulseAudio::AudioDriverPulseAudio() {
|
||||
|
||||
pa_ml = NULL;
|
||||
pa_ctx = NULL;
|
||||
pa_str = NULL;
|
||||
pa_rec_str = NULL;
|
||||
|
||||
mutex = NULL;
|
||||
thread = NULL;
|
||||
|
||||
device_name = "Default";
|
||||
new_device = "Default";
|
||||
default_device = "";
|
||||
|
||||
AudioDriverPulseAudio::AudioDriverPulseAudio() :
|
||||
thread(NULL),
|
||||
mutex(NULL),
|
||||
pa_ml(NULL),
|
||||
pa_ctx(NULL),
|
||||
pa_str(NULL),
|
||||
pa_rec_str(NULL),
|
||||
device_name("Default"),
|
||||
new_device("Default"),
|
||||
default_device(""),
|
||||
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) {
|
||||
samples_in.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() {
|
||||
|
|
|
|||
|
|
@ -194,13 +194,12 @@ void AudioDriverRtAudio::finish() {
|
|||
}
|
||||
}
|
||||
|
||||
AudioDriverRtAudio::AudioDriverRtAudio() {
|
||||
|
||||
active = false;
|
||||
mutex = NULL;
|
||||
dac = NULL;
|
||||
mix_rate = DEFAULT_MIX_RATE;
|
||||
speaker_mode = SPEAKER_MODE_STEREO;
|
||||
AudioDriverRtAudio::AudioDriverRtAudio() :
|
||||
speaker_mode(SPEAKER_MODE_STEREO),
|
||||
mutex(NULL),
|
||||
dac(NULL),
|
||||
mix_rate(DEFAULT_MIX_RATE),
|
||||
active(false) {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -309,11 +309,10 @@ FileAccess *FileAccessUnix::create_libc() {
|
|||
|
||||
CloseNotificationFunc FileAccessUnix::close_notification_func = NULL;
|
||||
|
||||
FileAccessUnix::FileAccessUnix() {
|
||||
|
||||
f = NULL;
|
||||
flags = 0;
|
||||
last_error = OK;
|
||||
FileAccessUnix::FileAccessUnix() :
|
||||
f(NULL),
|
||||
flags(0),
|
||||
last_error(OK) {
|
||||
}
|
||||
|
||||
FileAccessUnix::~FileAccessUnix() {
|
||||
|
|
|
|||
|
|
@ -167,10 +167,10 @@ void NetSocketPosix::cleanup() {
|
|||
#endif
|
||||
}
|
||||
|
||||
NetSocketPosix::NetSocketPosix() {
|
||||
_sock = SOCK_EMPTY;
|
||||
_ip_type = IP::TYPE_NONE;
|
||||
_is_stream = false;
|
||||
NetSocketPosix::NetSocketPosix() :
|
||||
_sock(SOCK_EMPTY),
|
||||
_ip_type(IP::TYPE_NONE),
|
||||
_is_stream(false) {
|
||||
}
|
||||
|
||||
NetSocketPosix::~NetSocketPosix() {
|
||||
|
|
|
|||
|
|
@ -58,17 +58,17 @@ class AudioDriverWASAPI : public AudioDriver {
|
|||
String device_name;
|
||||
String new_device;
|
||||
|
||||
AudioDeviceWASAPI() {
|
||||
audio_client = NULL;
|
||||
render_client = NULL;
|
||||
capture_client = NULL;
|
||||
active = false;
|
||||
format_tag = 0;
|
||||
bits_per_sample = 0;
|
||||
channels = 0;
|
||||
frame_size = 0;
|
||||
device_name = "Default";
|
||||
new_device = "Default";
|
||||
AudioDeviceWASAPI() :
|
||||
audio_client(NULL),
|
||||
render_client(NULL),
|
||||
capture_client(NULL),
|
||||
active(false),
|
||||
format_tag(0),
|
||||
bits_per_sample(0),
|
||||
channels(0),
|
||||
frame_size(0),
|
||||
device_name("Default"),
|
||||
new_device("Default") {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -307,11 +307,10 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
|
|||
}
|
||||
}
|
||||
|
||||
FileAccessWindows::FileAccessWindows() {
|
||||
|
||||
f = NULL;
|
||||
flags = 0;
|
||||
last_error = OK;
|
||||
FileAccessWindows::FileAccessWindows() :
|
||||
f(NULL),
|
||||
flags(0),
|
||||
last_error(OK) {
|
||||
}
|
||||
FileAccessWindows::~FileAccessWindows() {
|
||||
|
||||
|
|
|
|||
|
|
@ -93,9 +93,8 @@ void ThreadWindows::make_default() {
|
|||
wait_to_finish_func = wait_to_finish_func_windows;
|
||||
}
|
||||
|
||||
ThreadWindows::ThreadWindows() {
|
||||
|
||||
handle = NULL;
|
||||
ThreadWindows::ThreadWindows() :
|
||||
handle(NULL) {
|
||||
}
|
||||
|
||||
ThreadWindows::~ThreadWindows() {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ Error AudioDriverXAudio2::init() {
|
|||
thread = Thread::create(AudioDriverXAudio2::thread_func, this);
|
||||
|
||||
return OK;
|
||||
};
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ad->thread_exited = true;
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverXAudio2::start() {
|
||||
|
||||
|
|
@ -144,17 +144,17 @@ void AudioDriverXAudio2::start() {
|
|||
ERR_EXPLAIN("XAudio2 start error " + itos(hr));
|
||||
ERR_FAIL();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
int AudioDriverXAudio2::get_mix_rate() const {
|
||||
|
||||
return mix_rate;
|
||||
};
|
||||
}
|
||||
|
||||
AudioDriver::SpeakerMode AudioDriverXAudio2::get_speaker_mode() const {
|
||||
|
||||
return speaker_mode;
|
||||
};
|
||||
}
|
||||
|
||||
float AudioDriverXAudio2::get_latency() {
|
||||
|
||||
|
|
@ -172,13 +172,13 @@ void AudioDriverXAudio2::lock() {
|
|||
if (!thread || !mutex)
|
||||
return;
|
||||
mutex->lock();
|
||||
};
|
||||
}
|
||||
void AudioDriverXAudio2::unlock() {
|
||||
|
||||
if (!thread || !mutex)
|
||||
return;
|
||||
mutex->unlock();
|
||||
};
|
||||
}
|
||||
|
||||
void AudioDriverXAudio2::finish() {
|
||||
|
||||
|
|
@ -195,12 +195,12 @@ void AudioDriverXAudio2::finish() {
|
|||
|
||||
if (samples_in) {
|
||||
memdelete_arr(samples_in);
|
||||
};
|
||||
}
|
||||
if (samples_out[0]) {
|
||||
for (int i = 0; i < AUDIO_BUFFERS; i++) {
|
||||
memdelete_arr(samples_out[i]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
mastering_voice->DestroyVoice();
|
||||
|
||||
|
|
@ -208,20 +208,18 @@ void AudioDriverXAudio2::finish() {
|
|||
if (mutex)
|
||||
memdelete(mutex);
|
||||
thread = NULL;
|
||||
};
|
||||
}
|
||||
|
||||
AudioDriverXAudio2::AudioDriverXAudio2() {
|
||||
|
||||
mutex = NULL;
|
||||
thread = NULL;
|
||||
AudioDriverXAudio2::AudioDriverXAudio2() :
|
||||
thread(NULL),
|
||||
mutex(NULL),
|
||||
current_buffer(0) {
|
||||
wave_format = { 0 };
|
||||
for (int i = 0; i < AUDIO_BUFFERS; i++) {
|
||||
xaudio_buffer[i] = { 0 };
|
||||
samples_out[i] = 0;
|
||||
}
|
||||
current_buffer = 0;
|
||||
};
|
||||
}
|
||||
|
||||
AudioDriverXAudio2::~AudioDriverXAudio2(){
|
||||
|
||||
};
|
||||
AudioDriverXAudio2::~AudioDriverXAudio2() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue