| 679 | } |
| 680 | |
| 681 | static int Quat_concat(lua_State *L) |
| 682 | { |
| 683 | size_t size = 0; |
| 684 | const char* s = luaL_checklstring(L, 1, &size); |
| 685 | Quat* q = CheckQuat(L, 2); |
| 686 | const int buffer_size = size + MAX_CHARS_PER_QUAT + 1; |
| 687 | char* buffer = new char[buffer_size]; |
| 688 | // Use same format as Lua when converting number to string (from LUA_NUMBER_FMT in luaconf.h) |
| 689 | dmSnPrintf(buffer, buffer_size, STRING_FORMAT_CONCAT_QUAT, s, q->getX(), q->getY(), q->getZ(), q->getW()); |
| 690 | lua_pushstring(L, buffer); |
| 691 | delete [] buffer; |
| 692 | return 1; |
| 693 | } |
| 694 | |
| 695 | static int Quat_eq(lua_State *L) |
| 696 | { |
nothing calls this directly
no test coverage detected