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

Function Matrix4_concat

engine/script/src/script_vmath.cpp:831–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 static int Matrix4_concat(lua_State *L)
832 {
833 size_t size = 0;
834 const char* s = luaL_checklstring(L, 1, &size);
835 Matrix4* m = CheckMatrix4(L, 2);
836 const int buffer_size = size + MAX_CHARS_PER_MATRIX4 + 1;
837 char* buffer = new char[buffer_size];
838 // Use same format as Lua when converting number to string (from LUA_NUMBER_FMT in luaconf.h)
839 dmSnPrintf(buffer, buffer_size, STRING_FORMAT_CONCAT_MATRIX4, s,
840 m->getElem(0, 0), m->getElem(1, 0), m->getElem(2, 0), m->getElem(3, 0),
841 m->getElem(0, 1), m->getElem(1, 1), m->getElem(2, 1), m->getElem(3, 1),
842 m->getElem(0, 2), m->getElem(1, 2), m->getElem(2, 2), m->getElem(3, 2),
843 m->getElem(0, 3), m->getElem(1, 3), m->getElem(2, 3), m->getElem(3, 3));
844 lua_pushstring(L, buffer);
845 delete [] buffer;
846 return 1;
847 }
848
849 static int Matrix4_eq(lua_State *L)
850 {

Callers

nothing calls this directly

Calls 5

luaL_checklstringFunction · 0.85
CheckMatrix4Function · 0.85
dmSnPrintfFunction · 0.85
lua_pushstringFunction · 0.85
getElemMethod · 0.45

Tested by

no test coverage detected