-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: content loading related crashes (android) (#168)
* fix: re-render ui layout when input/dropdown changes * add content notificator * skip dependencies when it fails * test with tokio * fix and enable android build * fix tooltip when IA_ANY is specified move memcpy to packed array to helper functions (fast_create_packed_byte_array_from_*) remove nop() mock ~system/CommunicationsController::sendBinary * workaround to resolve promises, fix blocking when scene is loaded * rewrite: prettier content-provider code removing several if Err(_) * restore ci
- Loading branch information
1 parent
8700db5
commit fb785e6
Showing
22 changed files
with
423 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use godot::builtin::PackedByteArray; | ||
|
||
// TODO: gdext should implement a packedByteArray constructor from &[u8] and not iteration | ||
pub fn fast_create_packed_byte_array_from_slice(bytes_slice: &[u8]) -> PackedByteArray { | ||
let byte_length = bytes_slice.len(); | ||
let mut bytes = PackedByteArray::new(); | ||
bytes.resize(byte_length); | ||
|
||
let data_arr_ptr = bytes.as_mut_slice(); | ||
unsafe { | ||
let dst_ptr = &mut data_arr_ptr[0] as *mut u8; | ||
let src_ptr = &bytes_slice[0] as *const u8; | ||
std::ptr::copy_nonoverlapping(src_ptr, dst_ptr, byte_length); | ||
} | ||
|
||
bytes | ||
} | ||
|
||
pub fn fast_create_packed_byte_array_from_vec(bytes_vec: &Vec<u8>) -> PackedByteArray { | ||
fast_create_packed_byte_array_from_slice(bytes_vec.as_slice()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.