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

Method SetAnimationState

LuaSTGPlus/LuaWrapper.cpp:1142–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140 return 0;
1141 }
1142 static int SetAnimationState(lua_State* L)LNOEXCEPT
1143 {
1144 ResAnimation* p = LRES.FindAnimation(luaL_checkstring(L, 1));
1145 if (!p)
1146 return luaL_error(L, "animation '%s' not found.", luaL_checkstring(L, 1));
1147
1148 p->SetBlendMode(TranslateBlendMode(L, 2));
1149 if (lua_gettop(L) == 3)
1150 {
1151 fcyColor c = *static_cast<fcyColor*>(luaL_checkudata(L, 3, TYPENAME_COLOR));
1152 for (size_t i = 0; i < p->GetCount(); ++i)
1153 p->GetSprite(i)->SetColor(c);
1154 }
1155 else if (lua_gettop(L) == 6)
1156 {
1157 fcyColor tColors[] = {
1158 *static_cast<fcyColor*>(luaL_checkudata(L, 3, TYPENAME_COLOR)),
1159 *static_cast<fcyColor*>(luaL_checkudata(L, 4, TYPENAME_COLOR)),
1160 *static_cast<fcyColor*>(luaL_checkudata(L, 5, TYPENAME_COLOR)),
1161 *static_cast<fcyColor*>(luaL_checkudata(L, 6, TYPENAME_COLOR))
1162 };
1163 for (size_t i = 0; i < p->GetCount(); ++i)
1164 p->GetSprite(i)->SetColor(tColors);
1165 }
1166 return 0;
1167 }
1168 static int SetImageCenter(lua_State* L)LNOEXCEPT
1169 {
1170 ResSprite* p = LRES.FindSprite(luaL_checkstring(L, 1));

Callers

nothing calls this directly

Calls 5

TranslateBlendModeFunction · 0.85
FindAnimationMethod · 0.80
GetCountMethod · 0.80
SetBlendModeMethod · 0.45
GetSpriteMethod · 0.45

Tested by

no test coverage detected