summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp8
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp25
3 files changed, 18 insertions, 17 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index f47fcfcd9b..b972c6a877 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -166,7 +166,7 @@ void RasterizerSceneGLES3::shadow_atlas_set_quadrant_subdivision(RID p_atlas,int
subdiv<<=1;
}
- subdiv=int(Math::sqrt(subdiv));
+ subdiv=int(Math::sqrt((float)subdiv));
//obtain the number that will be x*x
@@ -568,7 +568,7 @@ void RasterizerSceneGLES3::reflection_atlas_set_subdivision(RID p_ref_atlas,int
subdiv<<=1;
}
- subdiv=int(Math::sqrt(subdiv));
+ subdiv=int(Math::sqrt((float)subdiv));
if (reflection_atlas->subdiv==subdiv)
return;
@@ -4567,7 +4567,7 @@ static _FORCE_INLINE_ Vector3 ImportanceSampleGGX(Vector2 Xi, float Roughness, V
// Compute distribution direction
float Phi = 2.0f * Math_PI * Xi.x;
- float CosTheta = Math::sqrt((1.0f - Xi.y) / (1.0f + (a*a - 1.0f) * Xi.y));
+ float CosTheta = Math::sqrt((float)(1.0f - Xi.y) / (1.0f + (a*a - 1.0f) * Xi.y));
float SinTheta = Math::sqrt((float)Math::abs(1.0f - CosTheta * CosTheta));
// Convert to spherical direction
@@ -4615,7 +4615,7 @@ void RasterizerSceneGLES3::_generate_brdf() {
float NoV = float(i+1)/(brdf_size); //avoid storing nov0
Vector3 V;
- V.x = Math::sqrt( 1.0 - NoV * NoV );
+ V.x = Math::sqrt( 1.0f - NoV * NoV );
V.y = 0.0;
V.z = NoV;
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 9f1ff396f1..96befee869 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -5256,7 +5256,7 @@ void RasterizerStorageGLES3::update_particles() {
shaders.particles.set_uniform(ParticlesShaderGLES3::ORIGIN,particles->origin);
- float new_phase = Math::fmod(particles->phase+(frame.delta/particles->lifetime),1.0);
+ float new_phase = Math::fmod((float)particles->phase+(frame.delta/particles->lifetime),(float)1.0);
shaders.particles.set_uniform(ParticlesShaderGLES3::SYSTEM_PHASE,new_phase);
shaders.particles.set_uniform(ParticlesShaderGLES3::PREV_SYSTEM_PHASE,particles->phase);
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 14b1b229b2..5f0e647545 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -65,15 +65,15 @@ Error AudioDriverPulseAudio::init() {
int error_code;
pulse = pa_simple_new( NULL, // default server
- "Godot", // application name
- PA_STREAM_PLAYBACK,
- NULL, // default device
- "Sound", // stream description
- &spec,
- NULL, // use default channel map
- &attr, // use buffering attributes from above
- &error_code
- );
+ "Godot", // application name
+ PA_STREAM_PLAYBACK,
+ NULL, // default device
+ "Sound", // stream description
+ &spec,
+ NULL, // use default channel map
+ &attr, // use buffering attributes from above
+ &error_code
+ );
if (pulse == NULL) {
fprintf(stderr, "PulseAudio ERR: %s\n", pa_strerror(error_code));\
@@ -103,6 +103,7 @@ float AudioDriverPulseAudio::get_latency() {
void AudioDriverPulseAudio::thread_func(void* p_udata) {
+ print_line("thread");
AudioDriverPulseAudio* ad = (AudioDriverPulseAudio*)p_udata;
while (!ad->exit_thread) {
@@ -121,9 +122,9 @@ void AudioDriverPulseAudio::thread_func(void* p_udata) {
for (unsigned int i=0; i < ad->buffer_size * ad->channels;i ++) {
ad->samples_out[i] = ad->samples_in[i] >> 16;
}
- }
+ }
- // pa_simple_write always consumes the entire buffer
+ // pa_simple_write always consumes the entire buffer
int error_code;
int byte_size = ad->buffer_size * sizeof(int16_t) * ad->channels;
@@ -134,7 +135,7 @@ void AudioDriverPulseAudio::thread_func(void* p_udata) {
ad->exit_thread = true;
break;
}
- }
+ }
ad->thread_exited = true;
}