Simplify CompareMode handling;

This commit is contained in:
bjorn 2019-02-01 15:10:12 -08:00
parent 85ab7c7c6e
commit 8e942561f1
2 changed files with 2 additions and 9 deletions

View File

@ -63,7 +63,6 @@ const char* BufferUsages[] = {
};
const char* CompareModes[] = {
[COMPARE_NONE] = "always",
[COMPARE_EQUAL] = "equal",
[COMPARE_NEQUAL] = "notequal",
[COMPARE_LESS] = "less",
@ -561,12 +560,6 @@ static int l_lovrGraphicsGetStencilTest(lua_State* L) {
CompareMode mode;
int value;
lovrGraphicsGetStencilTest(&mode, &value);
if (mode == COMPARE_NONE) {
lua_pushnil(L);
return 1;
}
lua_pushstring(L, CompareModes[mode]);
lua_pushinteger(L, value);
return 2;

View File

@ -41,13 +41,13 @@ typedef enum {
} BlendAlphaMode;
typedef enum {
COMPARE_NONE,
COMPARE_EQUAL,
COMPARE_NEQUAL,
COMPARE_LESS,
COMPARE_LEQUAL,
COMPARE_GREATER,
COMPARE_GEQUAL
COMPARE_GEQUAL,
COMPARE_NONE
} CompareMode;
typedef enum {