mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-03 23:11:14 +00:00
Support number as accepted value for "rgba" or "fade_rgba" fields
This commit is contained in:
parent
ec8757d716
commit
a48030d02d
1 changed files with 19 additions and 1 deletions
|
@ -220,8 +220,26 @@ static void GetExtraColormapRGBA(lua_State *L, UINT8 *rgba)
|
||||||
if (!parsed)
|
if (!parsed)
|
||||||
luaL_error(L, "Malformed HTML color '%s'", str);
|
luaL_error(L, "Malformed HTML color '%s'", str);
|
||||||
}
|
}
|
||||||
else
|
else if (lua_type(L, 3) == LUA_TTABLE)
|
||||||
GetRGBAColorsFromTable(L, 3, rgba, true);
|
GetRGBAColorsFromTable(L, 3, rgba, true);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UINT32 colors = lua_tointeger(L, 3);
|
||||||
|
if (colors > 0xFFFFFF)
|
||||||
|
{
|
||||||
|
rgba[0] = (colors >> 24) & 0xFF;
|
||||||
|
rgba[1] = (colors >> 16) & 0xFF;
|
||||||
|
rgba[2] = (colors >> 8) & 0xFF;
|
||||||
|
rgba[3] = colors & 0xFF;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rgba[0] = (colors >> 16) & 0xFF;
|
||||||
|
rgba[1] = (colors >> 8) & 0xFF;
|
||||||
|
rgba[2] = colors & 0xFF;
|
||||||
|
rgba[3] = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int extracolormap_set(lua_State *L)
|
static int extracolormap_set(lua_State *L)
|
||||||
|
|
Loading…
Reference in a new issue