MCPcopy Create free account
hub / github.com/Autodesk/Aurora / defaultLoadResourceFunction

Function defaultLoadResourceFunction

Libraries/Aurora/Source/AssetManager.cpp:113–130  ·  view source on GitHub ↗

Default load resource function.

Source from the content-addressed store, hash-verified

111
112// Default load resource function.
113bool defaultLoadResourceFunction(
114 const string& uri, vector<unsigned char>* pBufferOut, string* pFileNameOut)
115{
116 // Default load resource function just loads URI as file path directly.
117 ifstream is(uri, ifstream::binary);
118 if (!is)
119 return false;
120 is.seekg(0, is.end);
121 size_t length = is.tellg();
122 is.seekg(0, is.beg);
123 pBufferOut->resize(length);
124 is.read((char*)&(*pBufferOut)[0], length);
125
126 // Copy the URI to file name with no manipulation.
127 *pFileNameOut = uri;
128
129 return true;
130}
131
132// Default process image function.
133// Has extra flipImageY argument that must be filled in.

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected