| 94 | } |
| 95 | |
| 96 | s32 compile_resources(HashSet<ResourceOffset> &output |
| 97 | , const char *type |
| 98 | , const JsonArray &names |
| 99 | , CompileOptions &opts |
| 100 | ) |
| 101 | { |
| 102 | const StringId64 type_hash = StringId64(type); |
| 103 | |
| 104 | for (u32 i = 0; i < array::size(names); ++i) { |
| 105 | TempAllocator256 ta; |
| 106 | DynamicString name(ta); |
| 107 | RETURN_IF_ERROR(sjson::parse_string(name, names[i])); |
| 108 | RETURN_IF_MISSING(PACKAGE_RESOURCE, type, name.c_str(), opts); |
| 109 | name += "."; |
| 110 | name += type; |
| 111 | opts.fake_read(name.c_str()); |
| 112 | |
| 113 | ResourceOffset ro; |
| 114 | ro.type = type_hash; |
| 115 | ro.name = RETURN_IF_ERROR(sjson::parse_resource_name(names[i])); |
| 116 | |
| 117 | // Bring in requirements |
| 118 | u32 graph_level = 0; |
| 119 | bring_in_requirements(output, &graph_level, resource_id(ro.type, ro.name), opts); |
| 120 | |
| 121 | ro.online_order = graph_level; |
| 122 | ro._pad = 0; |
| 123 | hash_set::insert(output, ro); |
| 124 | } |
| 125 | |
| 126 | return 0; |
| 127 | } |
| 128 | |
| 129 | s32 compile(CompileOptions &opts) |
| 130 | { |
no test coverage detected