MCPcopy Create free account
hub / github.com/defold/defold / GetCustomResourceSize

Function GetCustomResourceSize

engine/resource/src/resource_mounts.cpp:242–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242static dmResource::Result GetCustomResourceSize(HContext ctx, dmhash_t path_hash, const char* path, uint32_t* resource_size)
243{
244 // Lock should already be held
245 CustomFile* file = ctx->m_CustomFiles.Get(path_hash);
246 if (file)
247 {
248 *resource_size = file->m_Size;
249 DM_RESOURCE_DBG_LOG(3, "GetResourceSize OK: %s " DM_HASH_FMT " (%u bytes) (custom file)\n", path, path_hash, *resource_size);
250 return dmResource::RESULT_OK;
251 }
252
253 return dmResource::RESULT_RESOURCE_NOT_FOUND;
254}
255
256static dmResource::Result ReadCustomResource(HContext ctx, dmhash_t path_hash, uint8_t* buffer, uint32_t buffer_size)
257{

Callers 1

GetResourceSizeFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected