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

Function UnpackLuaBuffer

engine/gamesys/src/gamesys/scripts/script_buffer.cpp:125–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 };
124
125 dmBuffer::HBuffer UnpackLuaBuffer(dmScript::LuaHBuffer* lua_buffer)
126 {
127 if (lua_buffer->m_Owner == dmScript::OWNER_RES) {
128 BufferResource* res = (BufferResource*)lua_buffer->m_BufferRes;
129 return res->m_Buffer;
130 } else {
131 return lua_buffer->m_Buffer;
132 }
133 }
134
135 // Unless we check that a buffer resource actually exists, the engine will crash
136 // when unpacking. This can happen if a user destroys a resource but a LuaHBuffer still holds a reference to the resource

Callers 6

SetTextureFunction · 0.85
CheckBufferOrStringFunction · 0.85
CreateBufferFunction · 0.85
SetBufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected