Merge branch 'v-string-colormap-lua-exposure' into 'next'
Expose V_GetStringColormap to Lua via v.getStringColormap(). See merge request STJr/SRB2!1111
This commit is contained in:
commit
88b3a3cd2e
|
@ -992,6 +992,19 @@ static int libd_getColormap(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int libd_getStringColormap(lua_State *L)
|
||||||
|
{
|
||||||
|
INT32 flags = luaL_checkinteger(L, 1);
|
||||||
|
UINT8* colormap = NULL;
|
||||||
|
HUDONLY
|
||||||
|
colormap = V_GetStringColormap(flags & V_CHARCOLORMASK);
|
||||||
|
if (colormap) {
|
||||||
|
LUA_PushUserdata(L, colormap, META_COLORMAP); // push as META_COLORMAP userdata, specifically for patches to use!
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int libd_fadeScreen(lua_State *L)
|
static int libd_fadeScreen(lua_State *L)
|
||||||
{
|
{
|
||||||
UINT16 color = luaL_checkinteger(L, 1);
|
UINT16 color = luaL_checkinteger(L, 1);
|
||||||
|
@ -1142,6 +1155,7 @@ static luaL_Reg lib_draw[] = {
|
||||||
{"getSpritePatch", libd_getSpritePatch},
|
{"getSpritePatch", libd_getSpritePatch},
|
||||||
{"getSprite2Patch", libd_getSprite2Patch},
|
{"getSprite2Patch", libd_getSprite2Patch},
|
||||||
{"getColormap", libd_getColormap},
|
{"getColormap", libd_getColormap},
|
||||||
|
{"getStringColormap", libd_getStringColormap},
|
||||||
// drawing
|
// drawing
|
||||||
{"draw", libd_draw},
|
{"draw", libd_draw},
|
||||||
{"drawScaled", libd_drawScaled},
|
{"drawScaled", libd_drawScaled},
|
||||||
|
|
Loading…
Reference in New Issue