MCPcopy Create free account
hub / github.com/crownengine/crown / compile_resources

Function compile_resources

src/resource/package_resource.cpp:96–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

compileFunction · 0.85

Calls 8

parse_resource_nameFunction · 0.85
bring_in_requirementsFunction · 0.85
resource_idFunction · 0.85
fake_readMethod · 0.80
StringId64Class · 0.50
sizeFunction · 0.50
parse_stringFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected