1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
use crateFlufflError;
pub use *;
/// load_file!("insert path here") returns a Result<Vec<u8>,Error> of your file
/// depending on the platform it makes a GET request or simply does normal disk loading on desktop.
/// load_file!("insert path here") returns a Result<Vec<u8>,Error> of your file
/// depending on the platform it makes a GET request or simply does normal disk loading on desktop.
// static mut BINARY_RESOURCES: Option<HashMap<String, Vec<u8>>> = None;
// pub fn register_resource<'a>(resource_name: String, resource: Vec<u8>) {
// get_resource_table_mut().map(|htable| htable.insert(resource_name, resource));
// }
// pub fn get_resource<'a>(resource_name: String) -> Option<&'a Vec<u8>> {
// get_resource_table_mut()
// .map(|htable| htable.get(&resource_name))
// .flatten()
// }
// pub fn get_resource_mut<'a>(resource_name: String) -> Option<&'a mut Vec<u8>> {
// get_resource_table_mut()
// .map(|htable| htable.get_mut(&resource_name))
// .flatten()
// }
// fn get_resource_table_mut<'a>() -> Option<&'a mut HashMap<String, Vec<u8>>> {
// unsafe { BINARY_RESOURCES.as_mut().map(|a| a) }
// }