aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
Commit message (Expand)AuthorAge
...
* Remove zh_* from GETTEXT_BLACKLISTED_LOCALES (#9229)Zaoqi2020-01-22
* Move Quicktune code to util/ (#8871)ANAND2019-09-29
* Fix breakage of non-GLES2 setups (#8774)Jozef Behran2019-08-10
* Let ENABLE_GLES appear in cmake_config.h and change its functionalitysfan52019-08-04
* Add compatibility to vcpkg buildsystem (#8317)adrido2019-06-10
* Find PostgreSQL correctly (#8435)adrido2019-04-07
* Don't include and link to gettext if gettext is not found (#8305)adrido2019-03-02
* DragonFly BSD is somewhat identical to FreeBSD (#8159)Leonid Bobrov2019-02-03
* Revert "Fix another GCC warning"Loïc Blot2018-12-04
* Fix another GCC warningLoïc Blot2018-12-04
* Move client-specific files to 'src/client' (#7902)Quentin Bazin2018-11-28
* Windows: Cpack wix installer (#6153)adrido2018-10-26
* Make OpenGL preference configurable, default to LEGACY (#7666)SmallJoker2018-09-22
* Set OpenGL preference to GLVNDShadowNinja2018-08-18
* Set ENABLE_GETTEXT to TRUE by default (#7415)Wuzzy2018-06-05
* Add online content repositoryrubenwardy2018-04-19
* macOS: don't require X11 libraries during compilation (#7149)D Tim Cummings2018-03-26
* Cleanup sound manager class (#7158)Loïc Blot2018-03-24
* Server: delegate mod management & config to ServerModConfiguration (#7131)Loïc Blot2018-03-16
* Fix CMake error (#7074) by bumping the required CMake version past 3.8.1 (#7075)nOOb31672018-02-25
* CMakeLists use the source_group command to improve look and feel when generat...nOOb31672018-02-23
* CMakeLists pass windows sources (manifest and resource file) to executable ta...nOOb31672018-02-23
* [CSM] Add basic HUD manipulation. (#6067)red-0012018-01-20
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* Initial Haiku support (#6568)miqlas2017-10-30
* FormSpec : Add an auto vertical scrollbar to the textareaadelcoding12017-10-09
* Replace deprecated WINAPI GetVersionInfoEx (#6496)adrido2017-10-07
* Implement mod communication channels (#6351)Loïc Blot2017-09-26
* Add clientside translations.Ekdohibs2017-08-24
* Dont define min/max macros in minwindef.h (#6308)adrido2017-08-24
* Network cleanup (#6302)Loïc Blot2017-08-24
* Copy lua51.dll (luajit) to bindir (#6148)adrido2017-07-18
* Expose getPointedThing to LuaDániel Juhász2017-07-07
* Mapgen: Add Carpathian mapgen (#6015)Vaughan Lapsley2017-07-06
* Fix msvc annoyances (#5963)adrido2017-06-27
* Isolate irrlicht references and use a singleton (#6041)Loïc Blot2017-06-26
* Merge cguittfont lib in irrlicht change folder. (#6016)Loïc Blot2017-06-20
* Remove legacy content_abm.{cpp,h}Loïc Blot2017-06-14
* Improve the path select GUI (#5852)red-0012017-06-11
* Revert "Remove deprecated code segments (#5891)"Loïc Blot2017-06-06
* Remove deprecated code segments (#5891)Thomas--S2017-06-04
* Minetest for C++11 (CMakeLists + Travis)Loic Blot2017-06-04
* Clean up numeric.h and split FacePositionCache from itShadowNinja2017-05-06
* Remove CMAKE -ffast-math flag from OSX/FreeBSDVaughan Lapsley2017-05-04
* Player data to Database (#5475)Loïc Blot2017-04-23
* MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock c...Perttu Ahola2017-04-17
* Windows: Skip cmd for release builds (#5416)adrido2017-04-07
* Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instea...Loïc Blot2017-04-02
* Add ItemStack key-value meta storagerubenwardy2017-02-04
* Derive NodeMetadata from Metadatarubenwardy2017-02-04
acos (lua_State *L) { lua_pushnumber(L, acos(luaL_checknumber(L, 1))); return 1; } static int math_atan (lua_State *L) { lua_pushnumber(L, atan(luaL_checknumber(L, 1))); return 1; } static int math_atan2 (lua_State *L) { lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); return 1; } static int math_ceil (lua_State *L) { lua_pushnumber(L, ceil(luaL_checknumber(L, 1))); return 1; } static int math_floor (lua_State *L) { lua_pushnumber(L, floor(luaL_checknumber(L, 1))); return 1; } static int math_fmod (lua_State *L) { lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); return 1; } static int math_modf (lua_State *L) { double ip; double fp = modf(luaL_checknumber(L, 1), &ip); lua_pushnumber(L, ip); lua_pushnumber(L, fp); return 2; } static int math_sqrt (lua_State *L) { lua_pushnumber(L, sqrt(luaL_checknumber(L, 1))); return 1; } static int math_pow (lua_State *L) { lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); return 1; } static int math_log (lua_State *L) { lua_pushnumber(L, log(luaL_checknumber(L, 1))); return 1; } static int math_log10 (lua_State *L) { lua_pushnumber(L, log10(luaL_checknumber(L, 1))); return 1; } static int math_exp (lua_State *L) { lua_pushnumber(L, exp(luaL_checknumber(L, 1))); return 1; } static int math_deg (lua_State *L) { lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); return 1; } static int math_rad (lua_State *L) { lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); return 1; } static int math_frexp (lua_State *L) { int e; lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e)); lua_pushinteger(L, e); return 2; } static int math_ldexp (lua_State *L) { lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2))); return 1; } static int math_min (lua_State *L) { int n = lua_gettop(L); /* number of arguments */ lua_Number dmin = luaL_checknumber(L, 1); int i; for (i=2; i<=n; i++) { lua_Number d = luaL_checknumber(L, i); if (d < dmin) dmin = d; } lua_pushnumber(L, dmin); return 1; } static int math_max (lua_State *L) { int n = lua_gettop(L); /* number of arguments */ lua_Number dmax = luaL_checknumber(L, 1); int i; for (i=2; i<=n; i++) { lua_Number d = luaL_checknumber(L, i); if (d > dmax) dmax = d; } lua_pushnumber(L, dmax); return 1; } static int math_random (lua_State *L) { /* the `%' avoids the (rare) case of r==1, and is needed also because on some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; switch (lua_gettop(L)) { /* check number of arguments */ case 0: { /* no arguments */ lua_pushnumber(L, r); /* Number between 0 and 1 */ break; } case 1: { /* only upper limit */ int u = luaL_checkint(L, 1); luaL_argcheck(L, 1<=u, 1, "interval is empty"); lua_pushnumber(L, floor(r*u)+1); /* int between 1 and `u' */ break; } case 2: { /* lower and upper limits */ int l = luaL_checkint(L, 1); int u = luaL_checkint(L, 2); luaL_argcheck(L, l<=u, 2, "interval is empty"); lua_pushnumber(L, floor(r*(u-l+1))+l); /* int between `l' and `u' */ break; } default: return luaL_error(L, "wrong number of arguments"); } return 1; } static int math_randomseed (lua_State *L) { srand(luaL_checkint(L, 1)); return 0; } static const luaL_Reg mathlib[] = { {"abs", math_abs}, {"acos", math_acos}, {"asin", math_asin}, {"atan2", math_atan2}, {"atan", math_atan}, {"ceil", math_ceil}, {"cosh", math_cosh}, {"cos", math_cos}, {"deg", math_deg}, {"exp", math_exp}, {"floor", math_floor}, {"fmod", math_fmod}, {"frexp", math_frexp}, {"ldexp", math_ldexp}, {"log10", math_log10}, {"log", math_log}, {"max", math_max}, {"min", math_min}, {"modf", math_modf}, {"pow", math_pow}, {"rad", math_rad}, {"random", math_random}, {"randomseed", math_randomseed}, {"sinh", math_sinh}, {"sin", math_sin}, {"sqrt", math_sqrt}, {"tanh", math_tanh}, {"tan", math_tan}, {NULL, NULL} }; /* ** Open math library */ LUALIB_API int luaopen_math (lua_State *L) { luaL_register(L, LUA_MATHLIBNAME, mathlib); lua_pushnumber(L, PI); lua_setfield(L, -2, "pi"); lua_pushnumber(L, HUGE_VAL); lua_setfield(L, -2, "huge"); #if defined(LUA_COMPAT_MOD) lua_getfield(L, -1, "fmod"); lua_setfield(L, -2, "mod"); #endif return 1; }