inline most of lua lib stuff
a bit faster
This commit is contained in:
1 parent
809219d5e8
commit
d6976ca64f
8 files changed
+71
-71
No files matched your search
+7
-7
@@ -236,7 +236,7 @@ static int lib_pRandomChance(lua_State *L)
|
||||
// P_MAPUTIL
|
||||
///////////////
|
||||
|
||||
static int lib_pAproxDistance(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_pAproxDistance(lua_State *L)
|
||||
{
|
||||
fixed_t dx = luaL_checkfixed(L, 1);
|
||||
fixed_t dy = luaL_checkfixed(L, 2);
|
||||
@@ -1643,7 +1643,7 @@ static int lib_evCrumbleChain(lua_State *L)
|
||||
// P_SLOPES
|
||||
////////////
|
||||
|
||||
static int lib_pGetZAt(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_pGetZAt(lua_State *L)
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
@@ -1659,7 +1659,7 @@ static int lib_pGetZAt(lua_State *L)
|
||||
// R_DEFS
|
||||
////////////
|
||||
|
||||
static int lib_rPointToAngle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToAngle(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
@@ -1668,7 +1668,7 @@ static int lib_rPointToAngle(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToAngle2(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToAngle2(lua_State *L)
|
||||
{
|
||||
fixed_t px2 = luaL_checkfixed(L, 1);
|
||||
fixed_t py2 = luaL_checkfixed(L, 2);
|
||||
@@ -1679,7 +1679,7 @@ static int lib_rPointToAngle2(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToDist(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToDist(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
@@ -1688,7 +1688,7 @@ static int lib_rPointToDist(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointToDist2(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointToDist2(lua_State *L)
|
||||
{
|
||||
fixed_t px2 = luaL_checkfixed(L, 1);
|
||||
fixed_t py2 = luaL_checkfixed(L, 2);
|
||||
@@ -1699,7 +1699,7 @@ static int lib_rPointToDist2(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_rPointInSubsector(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_rPointInSubsector(lua_State *L)
|
||||
{
|
||||
fixed_t x = luaL_checkfixed(L, 1);
|
||||
fixed_t y = luaL_checkfixed(L, 2);
|
||||
|
||||
+1
-1
@@ -393,7 +393,7 @@ FUNCINLINE static ATTRINLINE boolean prepare_string_hook
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean prepare_hud_hook
|
||||
FUNCINLINE static ATTRINLINE boolean prepare_hud_hook
|
||||
(
|
||||
Hook_State * hook,
|
||||
int hook_type
|
||||
|
||||
+17
-17
@@ -239,7 +239,7 @@ static int lib_getHudInfo(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_hudinfolen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudinfolen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMHUDITEMS);
|
||||
return 1;
|
||||
@@ -281,14 +281,14 @@ static int hudinfo_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hudinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int hudinfo_num(lua_State *L)
|
||||
{
|
||||
hudinfo_t *info = *((hudinfo_t **)luaL_checkudata(L, 1, META_HUDINFO));
|
||||
lua_pushinteger(L, info-hudinfo);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int colormap_get(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int colormap_get(lua_State *L)
|
||||
{
|
||||
return luaL_error(L, "colormap is not a struct.");
|
||||
}
|
||||
@@ -327,7 +327,7 @@ static int patch_get(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int patch_set(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int patch_set(lua_State *L)
|
||||
{
|
||||
return luaL_error(L, LUA_QL("patch_t") " struct cannot be edited by Lua.");
|
||||
}
|
||||
@@ -395,14 +395,14 @@ static int camera_get(lua_State *L)
|
||||
// lib_draw
|
||||
//
|
||||
|
||||
static int libd_patchExists(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_patchExists(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushboolean(L, W_LumpExists(luaL_checkstring(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_cachePatch(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_cachePatch(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH);
|
||||
@@ -1066,14 +1066,14 @@ static int libd_getColorHudPatch(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_getHudColor(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_getHudColor(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, K_GetHudColor());
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_useColorHud(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_useColorHud(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushboolean(L, K_UseColorHud());
|
||||
@@ -1081,21 +1081,21 @@ static int libd_useColorHud(lua_State *L)
|
||||
}
|
||||
|
||||
|
||||
static int libd_width(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_width(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.width); // push screen width
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_height(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_height(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.height); // push screen height
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int libd_dupx(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_dupx(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupx); // push integral scale (patch scale)
|
||||
@@ -1103,7 +1103,7 @@ static int libd_dupx(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_dupy(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_dupy(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, vid.dupy); // push integral scale (patch scale)
|
||||
@@ -1111,7 +1111,7 @@ static int libd_dupy(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_renderer(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_renderer(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
switch (rendermode) {
|
||||
@@ -1124,7 +1124,7 @@ static int libd_renderer(lua_State *L)
|
||||
|
||||
// 30/10/18 Lat': Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int
|
||||
// Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn
|
||||
static int libd_getlocaltransflag(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int libd_getlocaltransflag(lua_State *L)
|
||||
{
|
||||
HUDONLY
|
||||
lua_pushinteger(L, (10-cv_translucenthud.value)*V_10TRANS); // A bit weird that it's called "translucenthud" yet 10 is fully opaque :V
|
||||
@@ -1229,7 +1229,7 @@ static int lib_draw_ref;
|
||||
//
|
||||
|
||||
// enable vanilla HUD element
|
||||
static int lib_hudenable(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudenable(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
hud_enabled[option/8] |= 1<<(option%8);
|
||||
@@ -1237,7 +1237,7 @@ static int lib_hudenable(lua_State *L)
|
||||
}
|
||||
|
||||
// disable vanilla HUD element
|
||||
static int lib_huddisable(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_huddisable(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
hud_enabled[option/8] &= ~(1<<(option%8));
|
||||
@@ -1245,7 +1245,7 @@ static int lib_huddisable(lua_State *L)
|
||||
}
|
||||
|
||||
// 30/10/18: Lat': How come this wasn't here before?
|
||||
static int lib_hudenabled(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_hudenabled(lua_State *L)
|
||||
{
|
||||
enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options);
|
||||
if (hud_enabled[option/8] & (1<<(option%8)))
|
||||
|
||||
+9
-9
@@ -62,7 +62,7 @@ static int lib_getSprname(lua_State *L)
|
||||
}
|
||||
|
||||
/// \todo Maybe make it tally up the used_spr from dehacked?
|
||||
static int lib_sprnamelen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_sprnamelen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSPRITES);
|
||||
return 1;
|
||||
@@ -122,7 +122,7 @@ static void A_Lua(mobj_t *actor)
|
||||
}
|
||||
|
||||
// Arbitrary states[] table index -> state_t *
|
||||
static int lib_getState(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getState(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -214,7 +214,7 @@ static int lib_setState(lua_State *L)
|
||||
}
|
||||
|
||||
// #states -> NUMSTATES
|
||||
static int lib_statelen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_statelen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSTATES);
|
||||
return 1;
|
||||
@@ -482,7 +482,7 @@ static int state_num(lua_State *L)
|
||||
///////////////
|
||||
|
||||
// Arbitrary mobjinfo[] table index -> mobjinfo_t *
|
||||
static int lib_getMobjInfo(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getMobjInfo(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -593,7 +593,7 @@ static int lib_setMobjInfo(lua_State *L)
|
||||
}
|
||||
|
||||
// #mobjinfo -> NUMMOBJTYPES
|
||||
static int lib_mobjinfolen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_mobjinfolen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMMOBJTYPES);
|
||||
return 1;
|
||||
@@ -869,7 +869,7 @@ static int mobjinfo_set(lua_State *L)
|
||||
}
|
||||
|
||||
// mobjinfo_t * -> MT_*
|
||||
static int mobjinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int mobjinfo_num(lua_State *L)
|
||||
{
|
||||
mobjinfo_t *info = *((mobjinfo_t **)luaL_checkudata(L, 1, META_MOBJINFO));
|
||||
|
||||
@@ -885,7 +885,7 @@ static int mobjinfo_num(lua_State *L)
|
||||
//////////////
|
||||
|
||||
// Arbitrary S_sfx[] table index -> sfxinfo_t *
|
||||
static int lib_getSfxInfo(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getSfxInfo(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
lua_remove(L, 1);
|
||||
@@ -988,7 +988,7 @@ static int lib_setSfxInfo(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_sfxlen(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_sfxlen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMSFX);
|
||||
return 1;
|
||||
@@ -1062,7 +1062,7 @@ static int sfxinfo_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sfxinfo_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int sfxinfo_num(lua_State *L)
|
||||
{
|
||||
sfxinfo_t *sfx = *((sfxinfo_t **)luaL_checkudata(L, 1, META_SFXINFO));
|
||||
|
||||
|
||||
+11
-11
@@ -559,7 +559,7 @@ static int sector_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sector_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int sector_num(lua_State *L)
|
||||
{
|
||||
sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR));
|
||||
lua_pushinteger(L, sector-sectors);
|
||||
@@ -598,7 +598,7 @@ static int subsector_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int subsector_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int subsector_num(lua_State *L)
|
||||
{
|
||||
subsector_t *subsector = *((subsector_t **)luaL_checkudata(L, 1, META_SUBSECTOR));
|
||||
lua_pushinteger(L, subsector-subsectors);
|
||||
@@ -698,7 +698,7 @@ static int line_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int line_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int line_num(lua_State *L)
|
||||
{
|
||||
line_t *line = *((line_t **)luaL_checkudata(L, 1, META_LINE));
|
||||
lua_pushinteger(L, line-lines);
|
||||
@@ -827,7 +827,7 @@ static int side_set(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int side_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int side_num(lua_State *L)
|
||||
{
|
||||
side_t *side = *((side_t **)luaL_checkudata(L, 1, META_SIDE));
|
||||
lua_pushinteger(L, side-sides);
|
||||
@@ -866,7 +866,7 @@ static int vertex_get(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vertex_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int vertex_num(lua_State *L)
|
||||
{
|
||||
vertex_t *vertex = *((vertex_t **)luaL_checkudata(L, 1, META_VERTEX));
|
||||
lua_pushinteger(L, vertex-vertexes);
|
||||
@@ -913,7 +913,7 @@ static int lib_getSector(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsectors(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsectors(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsectors);
|
||||
return 1;
|
||||
@@ -959,7 +959,7 @@ static int lib_getSubsector(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsubsectors(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsubsectors(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsubsectors);
|
||||
return 1;
|
||||
@@ -1005,7 +1005,7 @@ static int lib_getLine(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numlines(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numlines(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numlines);
|
||||
return 1;
|
||||
@@ -1051,7 +1051,7 @@ static int lib_getSide(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numsides(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numsides(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numsides);
|
||||
return 1;
|
||||
@@ -1097,7 +1097,7 @@ static int lib_getVertex(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_numvertexes(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_numvertexes(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, numvertexes);
|
||||
return 1;
|
||||
@@ -1467,7 +1467,7 @@ static int lib_getMapheaderinfo(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_nummapheaders(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_nummapheaders(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMMAPS);
|
||||
return 1;
|
||||
|
||||
+20
-20
@@ -23,14 +23,14 @@
|
||||
// General math
|
||||
//////////////////
|
||||
|
||||
static int lib_abs(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_abs(lua_State *L)
|
||||
{
|
||||
int a = (int)luaL_checkinteger(L, 1);
|
||||
lua_pushinteger(L, abs(a));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_min(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_min(lua_State *L)
|
||||
{
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
@@ -38,7 +38,7 @@ static int lib_min(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_max(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_max(lua_State *L)
|
||||
{
|
||||
int a = luaL_checkinteger(L, 1);
|
||||
int b = luaL_checkinteger(L, 2);
|
||||
@@ -49,31 +49,31 @@ static int lib_max(lua_State *L)
|
||||
// Angle math
|
||||
////////////////
|
||||
|
||||
static int lib_fixedangle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedangle(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, FixedAngle(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_anglefixed(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_anglefixed(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, AngleFixed(luaL_checkangle(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_invangle(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_invangle(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, InvAngle(luaL_checkangle(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_finesine(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_finesine(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FINESINE((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & FINEMASK));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_finecosine(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_finecosine(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FINECOSINE((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & FINEMASK));
|
||||
return 1;
|
||||
@@ -101,19 +101,19 @@ static int lib_finetangent(lua_State *L)
|
||||
// Fixed math
|
||||
////////////////
|
||||
|
||||
static int lib_fixedmul(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedmul(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedMul(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedint(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedint(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, FixedInt(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixeddiv(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixeddiv(lua_State *L)
|
||||
{
|
||||
fixed_t i = luaL_checkfixed(L, 1);
|
||||
fixed_t j = luaL_checkfixed(L, 2);
|
||||
@@ -123,13 +123,13 @@ static int lib_fixeddiv(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedrem(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedrem(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedRem(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedsqrt(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedsqrt(lua_State *L)
|
||||
{
|
||||
fixed_t i = luaL_checkfixed(L, 1);
|
||||
if (i < 0)
|
||||
@@ -138,31 +138,31 @@ static int lib_fixedsqrt(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedhypot(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedhypot(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedHypot(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedfloor(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedfloor(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedFloor(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedtrunc(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedtrunc(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedTrunc(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedceil(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedceil(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedCeil(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedround(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_fixedround(lua_State *L)
|
||||
{
|
||||
lua_pushfixed(L, FixedRound(luaL_checkfixed(L, 1)));
|
||||
return 1;
|
||||
@@ -172,13 +172,13 @@ static int lib_fixedround(lua_State *L)
|
||||
// (aka extra little funcs that don't quite fit in baselib)
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
static int lib_getsecspecial(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_getsecspecial(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, GETSECSPECIAL(luaL_checkinteger(L, 1), luaL_checkinteger(L, 2)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_all7emeralds(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_all7emeralds(lua_State *L)
|
||||
{
|
||||
lua_pushboolean(L, ALL7EMERALDS(luaL_checkinteger(L, 1)));
|
||||
return 1;
|
||||
|
||||
+1
-1
@@ -979,7 +979,7 @@ static int lib_getMapthing(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_nummapthings(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_nummapthings(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, nummapthings);
|
||||
return 1;
|
||||
|
||||
+5
-5
@@ -438,7 +438,7 @@ static int lib_getPlayer(lua_State *L)
|
||||
}
|
||||
|
||||
// #players -> MAXPLAYERS
|
||||
static int lib_lenPlayer(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_lenPlayer(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, MAXPLAYERS);
|
||||
return 1;
|
||||
@@ -523,7 +523,7 @@ static int lib_getDisplayplayers(lua_State *L)
|
||||
}
|
||||
|
||||
// #displayplayers -> MAXSPLITSCREENPLAYERS
|
||||
static int lib_lenDisplayplayers(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int lib_lenDisplayplayers(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, MAXSPLITSCREENPLAYERS);
|
||||
return 1;
|
||||
@@ -631,7 +631,7 @@ static int player_set(lua_State *L)
|
||||
|
||||
#undef NOSET
|
||||
|
||||
static int player_num(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int player_num(lua_State *L)
|
||||
{
|
||||
player_t *plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
if (!plr)
|
||||
@@ -668,7 +668,7 @@ static int power_set(lua_State *L)
|
||||
}
|
||||
|
||||
// #powers -> NUMPOWERS
|
||||
static int power_len(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int power_len(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMPOWERS);
|
||||
return 1;
|
||||
@@ -702,7 +702,7 @@ static int kartstuff_set(lua_State *L)
|
||||
}
|
||||
|
||||
// #kartstuff -> NUMKARTSTUFF
|
||||
static int kartstuff_len(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int kartstuff_len(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, NUMKARTSTUFF);
|
||||
return 1;
|
||||
|
||||
Reference in new issue
Block a user