diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-18 08:12:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-18 08:12:56 +0200 |
commit | 1a92906b681735a5a2acfd98e3d6a4c75a7f6115 (patch) | |
tree | f01757ba9a3b618df7da54b0698134b1a9f03e3f /editor | |
parent | 3a4ff3402dedab5f30b0f97aeadec6cf61f29a40 (diff) | |
parent | eab850524ead092ed9fe22e57955e59eae373b79 (diff) |
Merge pull request #10406 from marcelofg55/closest_power_of_2
Add closest_power_of_2 func and implement mix_rate/latency on OS X
Diffstat (limited to 'editor')
-rw-r--r-- | editor/io_plugins/editor_font_import_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/io_plugins/editor_texture_import_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/baked_light_baker.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/editor/io_plugins/editor_font_import_plugin.cpp b/editor/io_plugins/editor_font_import_plugin.cpp index 9831e08cf1..25d8a5b7eb 100644 --- a/editor/io_plugins/editor_font_import_plugin.cpp +++ b/editor/io_plugins/editor_font_import_plugin.cpp @@ -1536,8 +1536,8 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe Vector<Point2i> res; Size2i res_size; EditorAtlas::fit(sizes,res,res_size); - res_size.x=nearest_power_of_2(res_size.x); - res_size.y=nearest_power_of_2(res_size.y); + res_size.x=next_power_of_2(res_size.x); + res_size.y=next_power_of_2(res_size.y); print_line("Atlas size: "+res_size); Image atlas(res_size.x,res_size.y,0,Image::FORMAT_RGBA8); diff --git a/editor/io_plugins/editor_texture_import_plugin.cpp b/editor/io_plugins/editor_texture_import_plugin.cpp index 095bc02fa0..1dc2641474 100644 --- a/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/editor/io_plugins/editor_texture_import_plugin.cpp @@ -1280,8 +1280,8 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc int atlas_w=dst_size.width; int atlas_h=dst_size.height; if (blit_to_po2) { - atlas_w=nearest_power_of_2(dst_size.width); - atlas_h=nearest_power_of_2(dst_size.height); + atlas_w=next_power_of_2(dst_size.width); + atlas_h=next_power_of_2(dst_size.height); } Image atlas; atlas.create(atlas_w,atlas_h,0,alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8); diff --git a/editor/plugins/baked_light_baker.cpp b/editor/plugins/baked_light_baker.cpp index 036229a7af..bef35647d4 100644 --- a/editor/plugins/baked_light_baker.cpp +++ b/editor/plugins/baked_light_baker.cpp @@ -1460,7 +1460,7 @@ void BakedLightBaker::_make_octree_texture() { } else { baked_light_texture_w=otex_w; - baked_light_texture_h=nearest_power_of_2(row); + baked_light_texture_h=next_power_of_2(row); print_line("w: "+itos(otex_w)); print_line("h: "+itos(row)); break; @@ -1558,7 +1558,7 @@ void BakedLightBaker::_make_octree_texture() { } - baked_octree_texture_h=nearest_power_of_2(baked_octree_texture_h); + baked_octree_texture_h=next_power_of_2(baked_octree_texture_h); print_line("RESULT! "+itos(baked_octree_texture_w)+","+itos(baked_octree_texture_h)); } |