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

Function Set2D

source/userdata.cpp:331–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329// ***********************************************************************
330
331i32 Set2D(lua_State* L) {
332 UserData* pUserData = (UserData*)luaL_checkudata(L, 1, "UserData");
333 if (pUserData->height == 1) {
334 luaL_error(L, "Set2D is only valid on 2-dimensional userdatas");
335 return 0;
336 }
337
338 i32 x = (i32)luaL_checkinteger(L, 2);
339 i32 y = (i32)luaL_checkinteger(L, 3);
340 SetImpl(L, pUserData, pUserData->width * y + x, 4);
341 return 0;
342}
343
344// ***********************************************************************
345

Callers

nothing calls this directly

Calls 1

SetImplFunction · 0.85

Tested by

no test coverage detected