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

Function CheckDDF

engine/script/src/script_ddf.cpp:431–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429 }
430
431 uint32_t CheckDDF(lua_State* L, const dmDDF::Descriptor* descriptor, char* buffer, uint32_t buffer_size, int index)
432 {
433 if (index < 0)
434 index = lua_gettop(L) + 1 + index;
435 uint32_t size = descriptor->m_Size;
436
437 if (size > buffer_size)
438 {
439 luaL_error(L, "sizeof(%s) > %d", descriptor->m_Name, buffer_size);
440 }
441
442 char* data_start = buffer + size;
443 char* data_end = data_start + buffer_size - size;
444
445 DoLuaTableToDDF(L, descriptor, buffer, &data_start, &data_end, index, buffer);
446 return data_start - buffer;
447 }
448
449 void DDFToLuaValue(lua_State* L, const dmDDF::FieldDescriptor* f, const char* data, uintptr_t pointers_offset)
450 {

Callers 8

Sys_RebootFunction · 0.85
Msg_PostFunction · 0.85
TEST_FFunction · 0.85
CheckDDFMethod · 0.85
TestStringMethod · 0.85
TestNumberMethod · 0.85
TestHashMethod · 0.85

Calls 3

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
DoLuaTableToDDFFunction · 0.85

Tested by 6

TEST_FFunction · 0.68
CheckDDFMethod · 0.68
TestStringMethod · 0.68
TestNumberMethod · 0.68
TestHashMethod · 0.68