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

Function Vector4_concat

engine/script/src/script_vmath.cpp:555–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553 }
554
555 static int Vector4_concat(lua_State *L)
556 {
557 size_t size = 0;
558 const char* s = luaL_checklstring(L, 1, &size);
559 Vector4* v = CheckVector4(L, 2);
560 const int buffer_size = size + MAX_CHARS_PER_VECTOR4 + 1;
561 char* buffer = new char[size + buffer_size];
562 // Use same format as Lua when converting number to string (from LUA_NUMBER_FMT in luaconf.h)
563 dmSnPrintf(buffer, buffer_size, STRING_FORMAT_CONCAT_VECTOR4, s, v->getX(), v->getY(), v->getZ(), v->getW());
564 lua_pushstring(L, buffer);
565 delete [] buffer;
566 return 1;
567 }
568
569 static int Vector4_eq(lua_State *L)
570 {

Callers

nothing calls this directly

Calls 8

luaL_checklstringFunction · 0.85
CheckVector4Function · 0.85
dmSnPrintfFunction · 0.85
lua_pushstringFunction · 0.85
getXMethod · 0.45
getYMethod · 0.45
getZMethod · 0.45
getWMethod · 0.45

Tested by

no test coverage detected