MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / load_buffer

Function load_buffer

ogsr_engine/Layers/xrRender/ResourceManager_Scripting.cpp:298–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298bool load_buffer(const char* caBuffer, size_t tSize, const char* caScriptName, const char* caNameSpaceName)
299{
300 const std::string_view strbuf{caBuffer, tSize};
301 const std::string script = std::format(FILE_HEADER, caNameSpaceName, strbuf);
302
303 // Log("[CResourceManager::load_buffer] Loading buffer:");
304 // Log(script.c_str());
305
306 int l_iErrorCode = luaL_loadbuffer(LSVM, script.c_str(), script.size(), caScriptName);
307 if (l_iErrorCode)
308 {
309 print_output(caScriptName, l_iErrorCode);
310 R_ASSERT(false); //НЕ ЗАКОММЕНТИРОВАТЬ!
311 return false;
312 }
313 return true;
314}
315
316bool do_file(const char* caScriptName, const char* caNameSpaceName)
317{

Callers 2

do_fileFunction · 0.70
do_fileMethod · 0.50

Calls 5

formatEnum · 0.85
print_outputFunction · 0.70
luaL_loadbufferFunction · 0.50
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected