diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-08-17 18:35:55 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-08-17 19:51:13 -0300 |
commit | eab850524ead092ed9fe22e57955e59eae373b79 (patch) | |
tree | 1ec2718c0810d852b51c4d40c135f4dde3841906 /servers | |
parent | 33c1d25517050470689924c60414feaf295ce05f (diff) |
Add closest_power_of_2 func and implement mix_rate/latency on OS X
Diffstat (limited to 'servers')
-rw-r--r-- | servers/audio/audio_driver_dummy.cpp | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.cpp | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index 0f15b43b41..dfb6406b38 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -45,7 +45,7 @@ Error AudioDriverDummy::init() { channels = 2; int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = nearest_power_of_2(latency * mix_rate / 1000); + buffer_size = next_power_of_2(latency * mix_rate / 1000); samples_in = memnew_arr(int32_t, buffer_size * channels); diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index dcc16794e7..e4cda5500e 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -1001,11 +1001,11 @@ void VisualServerCanvas::canvas_light_set_shadow_buffer_size(RID p_light, int p_ RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); ERR_FAIL_COND(!clight); - int new_size = nearest_power_of_2(p_size); + int new_size = next_power_of_2(p_size); if (new_size == clight->shadow_buffer_size) return; - clight->shadow_buffer_size = nearest_power_of_2(p_size); + clight->shadow_buffer_size = next_power_of_2(p_size); if (clight->shadow_buffer.is_valid()) { VSG::storage->free(clight->shadow_buffer); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 4f16ae4125..e66c8a1e21 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -4376,7 +4376,7 @@ void VisualServerRaster::canvas_light_set_shadow_buffer_size(RID p_light, int p_ ERR_FAIL_COND(p_size<32 || p_size>16384); - clight->shadow_buffer_size=nearest_power_of_2(p_size); + clight->shadow_buffer_size=next_power_of_2(p_size); if (clight->shadow_buffer.is_valid()) { |