mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add closest_power_of_2 func and implement mix_rate/latency on OS X
This commit is contained in:
parent
49028e0c49
commit
647c4ae5bf
25 changed files with 136 additions and 87 deletions
|
|
@ -1460,8 +1460,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_RGBA);
|
||||
|
|
|
|||
|
|
@ -1185,8 +1185,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_RGBA : Image::FORMAT_RGB);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue