MCPcopy Create free account
hub / github.com/DavidColson/Polybox / Get

Function Get

source/userdata.cpp:346–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344// ***********************************************************************
345
346i32 Get(lua_State* L) {
347 UserData* pUserData = (UserData*)luaL_checkudata(L, 1, "UserData");
348 i32 index = (i32)luaL_checkinteger(L, 2);
349 i32 count = (i32)luaL_checkinteger(L, 3);
350 if (index + count > pUserData->width * pUserData->height) {
351 luaL_error(L, "Out of bounds read on userdata with size (%d,%d) at index %d", pUserData->width, pUserData->height, index);
352 return 0;
353 }
354 return GetImpl(L, pUserData, index, count);
355}
356
357// ***********************************************************************
358

Callers

nothing calls this directly

Calls 1

GetImplFunction · 0.85

Tested by

no test coverage detected