| 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)); |
nothing calls this directly
no test coverage detected