mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-08 09:51:45 +00:00
Make it through Lua
This commit is contained in:
parent
a93acd1958
commit
d165e723be
4 changed files with 6 additions and 8 deletions
|
|
@ -122,7 +122,7 @@ static int lib_fixedsqrt(lua_State *L)
|
||||||
|
|
||||||
static int lib_fixedhypot(lua_State *L)
|
static int lib_fixedhypot(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushfixed(L, R_PointToDist2(0, 0, luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
lua_pushfixed(L, FixedHypot(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,8 +195,6 @@ static luaL_Reg lib[] = {
|
||||||
{"fixint" , lib_fixedint},
|
{"fixint" , lib_fixedint},
|
||||||
{"FixedDiv", lib_fixeddiv},
|
{"FixedDiv", lib_fixeddiv},
|
||||||
{"fixdiv" , lib_fixeddiv},
|
{"fixdiv" , lib_fixeddiv},
|
||||||
{"FixedRem", lib_fixedrem},
|
|
||||||
{"fixrem" , lib_fixedrem},
|
|
||||||
{"FixedSqrt", lib_fixedsqrt},
|
{"FixedSqrt", lib_fixedsqrt},
|
||||||
{"fixsqrt" , lib_fixedsqrt},
|
{"fixsqrt" , lib_fixedsqrt},
|
||||||
{"FixedHypot", lib_fixedhypot},
|
{"FixedHypot", lib_fixedhypot},
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,8 @@ int LUA_WriteGlobals(lua_State *L, const char *word)
|
||||||
gravity = (fixed_t)luaL_checkinteger(L, 2);
|
gravity = (fixed_t)luaL_checkinteger(L, 2);
|
||||||
else if (fastcmp(word, "stoppedclock"))
|
else if (fastcmp(word, "stoppedclock"))
|
||||||
stoppedclock = luaL_checkboolean(L, 2);
|
stoppedclock = luaL_checkboolean(L, 2);
|
||||||
|
/*
|
||||||
|
// KART TODO: displayplayers is a table...
|
||||||
else if (fastcmp(word, "displayplayer"))
|
else if (fastcmp(word, "displayplayer"))
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
|
||||||
|
|
@ -437,6 +439,7 @@ int LUA_WriteGlobals(lua_State *L, const char *word)
|
||||||
if (player)
|
if (player)
|
||||||
displayplayer = player - players;
|
displayplayer = player - players;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
else if (fastcmp(word, "mapmusname"))
|
else if (fastcmp(word, "mapmusname"))
|
||||||
{
|
{
|
||||||
size_t strlength;
|
size_t strlength;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ enum skin {
|
||||||
skin_highresscale,
|
skin_highresscale,
|
||||||
skin_rivals,
|
skin_rivals,
|
||||||
skin_soundsid,
|
skin_soundsid,
|
||||||
skin_availability,
|
|
||||||
skin_sprites
|
skin_sprites
|
||||||
};
|
};
|
||||||
static const char *const skin_opt[] = {
|
static const char *const skin_opt[] = {
|
||||||
|
|
@ -55,7 +54,6 @@ static const char *const skin_opt[] = {
|
||||||
"highresscale",
|
"highresscale",
|
||||||
"rivals",
|
"rivals",
|
||||||
"soundsid",
|
"soundsid",
|
||||||
"availability",
|
|
||||||
"sprites",
|
"sprites",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
@ -119,9 +117,6 @@ static int skin_get(lua_State *L)
|
||||||
case skin_soundsid:
|
case skin_soundsid:
|
||||||
LUA_PushUserdata(L, skin->soundsid, META_SOUNDSID);
|
LUA_PushUserdata(L, skin->soundsid, META_SOUNDSID);
|
||||||
break;
|
break;
|
||||||
case skin_availability:
|
|
||||||
lua_pushinteger(L, skin->availability);
|
|
||||||
break;
|
|
||||||
case skin_sprites:
|
case skin_sprites:
|
||||||
LUA_PushLightUserdata(L, skin->sprites, META_SKINSPRITES);
|
LUA_PushLightUserdata(L, skin->sprites, META_SKINSPRITES);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
INT32 numskins = 0;
|
INT32 numskins = 0;
|
||||||
skin_t skins[MAXSKINS];
|
skin_t skins[MAXSKINS];
|
||||||
|
|
||||||
|
INT32 numfollowers = 0;
|
||||||
|
|
||||||
// FIXTHIS: don't work because it must be inistilised before the config load
|
// FIXTHIS: don't work because it must be inistilised before the config load
|
||||||
//#define SKINVALUES
|
//#define SKINVALUES
|
||||||
#ifdef SKINVALUES
|
#ifdef SKINVALUES
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue