mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge lua_hudlib.c
This commit is contained in:
parent
bb2fe60e0e
commit
40558a6824
1 changed files with 43 additions and 73 deletions
116
src/lua_hudlib.c
116
src/lua_hudlib.c
|
|
@ -35,14 +35,12 @@ static UINT8 hud_enabled[(hud_MAX/8)+1];
|
||||||
|
|
||||||
static UINT8 hudAvailable; // hud hooks field
|
static UINT8 hudAvailable; // hud hooks field
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
static UINT8 camnum = 1;
|
static UINT8 camnum = 1;
|
||||||
=======
|
|
||||||
#ifdef LUA_PATCH_SAFETY
|
#ifdef LUA_PATCH_SAFETY
|
||||||
static patchinfo_t *patchinfo, *patchinfohead;
|
static patchinfo_t *patchinfo, *patchinfohead;
|
||||||
static int numluapatches;
|
static int numluapatches;
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> srb2/next
|
|
||||||
|
|
||||||
// must match enum hud in lua_hud.h
|
// must match enum hud in lua_hud.h
|
||||||
static const char *const hud_disable_options[] = {
|
static const char *const hud_disable_options[] = {
|
||||||
|
|
@ -50,7 +48,6 @@ static const char *const hud_disable_options[] = {
|
||||||
"textspectator",
|
"textspectator",
|
||||||
|
|
||||||
"time",
|
"time",
|
||||||
<<<<<<< HEAD
|
|
||||||
"gametypeinfo", // Bumpers / Karma / Laps depending on gametype
|
"gametypeinfo", // Bumpers / Karma / Laps depending on gametype
|
||||||
"minimap",
|
"minimap",
|
||||||
"item",
|
"item",
|
||||||
|
|
@ -64,29 +61,9 @@ static const char *const hud_disable_options[] = {
|
||||||
"speedometer",
|
"speedometer",
|
||||||
"freeplay",
|
"freeplay",
|
||||||
"rankings",
|
"rankings",
|
||||||
=======
|
|
||||||
"rings",
|
|
||||||
"lives",
|
|
||||||
|
|
||||||
"weaponrings",
|
|
||||||
"powerstones",
|
|
||||||
"teamscores",
|
|
||||||
|
|
||||||
"nightslink",
|
|
||||||
"nightsdrill",
|
|
||||||
"nightsrings",
|
|
||||||
"nightsscore",
|
|
||||||
"nightstime",
|
|
||||||
"nightsrecords",
|
|
||||||
|
|
||||||
"rankings",
|
|
||||||
"coopemeralds",
|
|
||||||
"tokens",
|
|
||||||
"tabemblems",
|
|
||||||
|
|
||||||
"intermissiontally",
|
"intermissiontally",
|
||||||
"intermissionmessages",
|
"intermissionmessages",
|
||||||
>>>>>>> srb2/next
|
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
enum hudinfo {
|
enum hudinfo {
|
||||||
|
|
@ -745,7 +722,33 @@ static int libd_drawScaled(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
static int libd_drawStretched(lua_State *L)
|
||||||
|
{
|
||||||
|
fixed_t x, y, hscale, vscale;
|
||||||
|
INT32 flags;
|
||||||
|
patch_t *patch;
|
||||||
|
const UINT8 *colormap = NULL;
|
||||||
|
|
||||||
|
HUDONLY
|
||||||
|
x = luaL_checkinteger(L, 1);
|
||||||
|
y = luaL_checkinteger(L, 2);
|
||||||
|
hscale = luaL_checkinteger(L, 3);
|
||||||
|
if (hscale < 0)
|
||||||
|
return luaL_error(L, "negative horizontal scale");
|
||||||
|
vscale = luaL_checkinteger(L, 4);
|
||||||
|
if (vscale < 0)
|
||||||
|
return luaL_error(L, "negative vertical scale");
|
||||||
|
patch = *((patch_t **)luaL_checkudata(L, 5, META_PATCH));
|
||||||
|
flags = luaL_optinteger(L, 6, 0);
|
||||||
|
if (!lua_isnoneornil(L, 7))
|
||||||
|
colormap = *((UINT8 **)luaL_checkudata(L, 7, META_COLORMAP));
|
||||||
|
|
||||||
|
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
||||||
|
|
||||||
|
V_DrawStretchyFixedPatch(x, y, hscale, vscale, flags, patch, colormap);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// KART: draw patch on minimap from x, y coordinates on the map
|
// KART: draw patch on minimap from x, y coordinates on the map
|
||||||
static int libd_drawOnMinimap(lua_State *L)
|
static int libd_drawOnMinimap(lua_State *L)
|
||||||
{
|
{
|
||||||
|
|
@ -916,32 +919,6 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||||
|
|
||||||
// and NOW we can FINALLY DRAW OUR GOD DAMN PATCH :V
|
// and NOW we can FINALLY DRAW OUR GOD DAMN PATCH :V
|
||||||
V_DrawFixedPatch(amxpos, amypos, scale, splitflags, patch, colormap);
|
V_DrawFixedPatch(amxpos, amypos, scale, splitflags, patch, colormap);
|
||||||
=======
|
|
||||||
static int libd_drawStretched(lua_State *L)
|
|
||||||
{
|
|
||||||
fixed_t x, y, hscale, vscale;
|
|
||||||
INT32 flags;
|
|
||||||
patch_t *patch;
|
|
||||||
const UINT8 *colormap = NULL;
|
|
||||||
|
|
||||||
HUDONLY
|
|
||||||
x = luaL_checkinteger(L, 1);
|
|
||||||
y = luaL_checkinteger(L, 2);
|
|
||||||
hscale = luaL_checkinteger(L, 3);
|
|
||||||
if (hscale < 0)
|
|
||||||
return luaL_error(L, "negative horizontal scale");
|
|
||||||
vscale = luaL_checkinteger(L, 4);
|
|
||||||
if (vscale < 0)
|
|
||||||
return luaL_error(L, "negative vertical scale");
|
|
||||||
patch = *((patch_t **)luaL_checkudata(L, 5, META_PATCH));
|
|
||||||
flags = luaL_optinteger(L, 6, 0);
|
|
||||||
if (!lua_isnoneornil(L, 7))
|
|
||||||
colormap = *((UINT8 **)luaL_checkudata(L, 7, META_COLORMAP));
|
|
||||||
|
|
||||||
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
|
||||||
|
|
||||||
V_DrawStretchyFixedPatch(x, y, hscale, vscale, flags, patch, colormap);
|
|
||||||
>>>>>>> srb2/next
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -974,7 +951,6 @@ static int libd_drawPaddedNum(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int libd_drawPingNum(lua_State *L)
|
static int libd_drawPingNum(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 x, y, flags, num;
|
INT32 x, y, flags, num;
|
||||||
|
|
@ -1121,19 +1097,6 @@ static int libd_drawString(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
static int libd_drawKartString(lua_State *L)
|
|
||||||
{
|
|
||||||
fixed_t x = luaL_checkinteger(L, 1);
|
|
||||||
fixed_t y = luaL_checkinteger(L, 2);
|
|
||||||
const char *str = luaL_checkstring(L, 3);
|
|
||||||
INT32 flags = luaL_optinteger(L, 4, V_ALLOWLOWERCASE);
|
|
||||||
|
|
||||||
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
|
||||||
|
|
||||||
HUDONLY
|
|
||||||
V_DrawKartString(x, y, flags, str);
|
|
||||||
=======
|
|
||||||
static int libd_drawNameTag(lua_State *L)
|
static int libd_drawNameTag(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 x;
|
INT32 x;
|
||||||
|
|
@ -1193,7 +1156,20 @@ static int libd_drawScaledNameTag(lua_State *L)
|
||||||
|
|
||||||
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
||||||
V_DrawNameTag(FixedInt(x), FixedInt(y), flags, scale, basecolormap, outlinecolormap, str);
|
V_DrawNameTag(FixedInt(x), FixedInt(y), flags, scale, basecolormap, outlinecolormap, str);
|
||||||
>>>>>>> srb2/next
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int libd_drawKartString(lua_State *L)
|
||||||
|
{
|
||||||
|
fixed_t x = luaL_checkinteger(L, 1);
|
||||||
|
fixed_t y = luaL_checkinteger(L, 2);
|
||||||
|
const char *str = luaL_checkstring(L, 3);
|
||||||
|
INT32 flags = luaL_optinteger(L, 4, V_ALLOWLOWERCASE);
|
||||||
|
|
||||||
|
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
||||||
|
|
||||||
|
HUDONLY
|
||||||
|
V_DrawKartString(x, y, flags, str);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1415,14 +1391,11 @@ static luaL_Reg lib_draw[] = {
|
||||||
{"drawFill", libd_drawFill},
|
{"drawFill", libd_drawFill},
|
||||||
{"fadeScreen", libd_fadeScreen},
|
{"fadeScreen", libd_fadeScreen},
|
||||||
{"drawString", libd_drawString},
|
{"drawString", libd_drawString},
|
||||||
<<<<<<< HEAD
|
|
||||||
{"drawKartString", libd_drawKartString},
|
|
||||||
=======
|
|
||||||
{"drawNameTag", libd_drawNameTag},
|
{"drawNameTag", libd_drawNameTag},
|
||||||
{"drawScaledNameTag", libd_drawScaledNameTag},
|
{"drawScaledNameTag", libd_drawScaledNameTag},
|
||||||
{"fadeScreen", libd_fadeScreen},
|
{"fadeScreen", libd_fadeScreen},
|
||||||
|
{"drawKartString", libd_drawKartString},
|
||||||
// misc
|
// misc
|
||||||
>>>>>>> srb2/next
|
|
||||||
{"stringWidth", libd_stringWidth},
|
{"stringWidth", libd_stringWidth},
|
||||||
{"nameTagWidth", libd_nameTagWidth},
|
{"nameTagWidth", libd_nameTagWidth},
|
||||||
// m_random
|
// m_random
|
||||||
|
|
@ -1439,11 +1412,8 @@ static luaL_Reg lib_draw[] = {
|
||||||
{"dupy", libd_dupy},
|
{"dupy", libd_dupy},
|
||||||
{"renderer", libd_renderer},
|
{"renderer", libd_renderer},
|
||||||
{"localTransFlag", libd_getlocaltransflag},
|
{"localTransFlag", libd_getlocaltransflag},
|
||||||
<<<<<<< HEAD
|
|
||||||
{"drawOnMinimap", libd_drawOnMinimap},
|
{"drawOnMinimap", libd_drawOnMinimap},
|
||||||
=======
|
|
||||||
{"userTransFlag", libd_getusertransflag},
|
{"userTransFlag", libd_getusertransflag},
|
||||||
>>>>>>> srb2/next
|
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue