| 25 | using namespace LuaSTGPlus; |
| 26 | |
| 27 | static inline BlendMode TranslateBlendMode(lua_State* L, int argnum) |
| 28 | { |
| 29 | const char* s = luaL_checkstring(L, argnum); |
| 30 | if (strcmp(s, "mul+add") == 0) |
| 31 | return BlendMode::MulAdd; |
| 32 | else if (strcmp(s, "") == 0) |
| 33 | return BlendMode::MulAlpha; |
| 34 | else if (strcmp(s, "mul+alpha") == 0) |
| 35 | return BlendMode::MulAlpha; |
| 36 | else if (strcmp(s, "add+add") == 0) |
| 37 | return BlendMode::AddAdd; |
| 38 | else if (strcmp(s, "add+alpha") == 0) |
| 39 | return BlendMode::AddAlpha; |
| 40 | else if (strcmp(s, "add+rev") == 0) |
| 41 | return BlendMode::AddRev; |
| 42 | else if (strcmp(s, "mul+rev") == 0) |
| 43 | return BlendMode::MulRev; |
| 44 | else if (strcmp(s, "add+sub") == 0) |
| 45 | return BlendMode::AddSub; |
| 46 | else if (strcmp(s, "mul+sub") == 0) |
| 47 | return BlendMode::MulSub; |
| 48 | else |
| 49 | luaL_error(L, "invalid blend mode '%s'.", s); |
| 50 | return BlendMode::MulAlpha; |
| 51 | } |
| 52 | |
| 53 | static inline void TranslateAlignMode(lua_State* L, int argnum, ResFont::FontAlignHorizontal& halign, ResFont::FontAlignVertical& valign) |
| 54 | { |
no outgoing calls
no test coverage detected