| 588 | // *********************************************************************** |
| 589 | |
| 590 | i32 VecMagnitude(lua_State* L) { |
| 591 | UserData* pUserData = (UserData*)luaL_checkudata(L, 1, "UserData"); |
| 592 | switch(pUserData->type) { |
| 593 | case Type::Float32: lua_pushnumber(L, CalcMagnitude<f32>(pUserData)); break; |
| 594 | case Type::Int32: lua_pushinteger(L, CalcMagnitude<i32>(pUserData)); break; |
| 595 | case Type::Int16: lua_pushinteger(L, CalcMagnitude<i16>(pUserData)); break; |
| 596 | case Type::Uint8: lua_pushunsigned(L, CalcMagnitude<u8>(pUserData)); break; |
| 597 | default: return 0; |
| 598 | } |
| 599 | return 1; |
| 600 | } |
| 601 | |
| 602 | // *********************************************************************** |
| 603 |
nothing calls this directly
no outgoing calls
no test coverage detected