MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Meta_Add

Method Meta_Add

LuaSTGPlus/LuaWrapper.cpp:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 return 1;
111 }
112 static int Meta_Add(lua_State* L)LNOEXCEPT
113 {
114 fcyColor* pA = static_cast<fcyColor*>(luaL_checkudata(L, 1, TYPENAME_COLOR));
115 fcyColor* pB = static_cast<fcyColor*>(luaL_checkudata(L, 2, TYPENAME_COLOR));
116 fcyColor* pResult = CreateAndPush(L);
117 pResult->Set(
118 ::min((int)pA->a + pB->a, 255),
119 ::min((int)pA->r + pB->r, 255),
120 ::min((int)pA->g + pB->g, 255),
121 ::min((int)pA->b + pB->b, 255)
122 );
123 return 1;
124 }
125 static int Meta_Sub(lua_State* L)LNOEXCEPT
126 {
127 fcyColor* pA = static_cast<fcyColor*>(luaL_checkudata(L, 1, TYPENAME_COLOR));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected