aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_camera.cpp
Commit message (Expand)AuthorAge
* script: Replace calls to depreated luaL_openlibsfan52021-05-30
* Add First Person Attachments (#10360)Jordan Snelling2020-10-04
* CSM: Bugfixes to camera:get_pos() and camera:get_fov()sfan52020-05-14
* Fix camera:get_offset() in CSMsfan52019-11-11
* Load CSM environment after the restrictions are knownSmallJoker2019-09-14
* Move client-specific files to 'src/client' (#7902)Quentin Bazin2018-11-28
* Fix last clang-tidy reported problems for performance-type-promotion-in-math-fnLoic Blot2018-04-03
* Cleanup various headers to reduce compilation times (#6255)Loïc Blot2017-08-16
* C++11 cleanup on constructors (#6000)Vincent Glize2017-06-19
* Replace occurrence of luaL_reg in l_camera.cppT0ny22017-05-07
* Fix codestyle since CSM Camera APILoic Blot2017-05-06
* [CSM] Add camera API (#5609)bigfoot5472017-05-05
nction", "userdata", "thread", "proto", "upval" }; void luaT_init (lua_State *L) { static const char *const luaT_eventname[] = { /* ORDER TM */ "__index", "__newindex", "__gc", "__mode", "__eq", "__add", "__sub", "__mul", "__div", "__mod", "__pow", "__unm", "__len", "__lt", "__le", "__concat", "__call" }; int i; for (i=0; i<TM_N; i++) { G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); luaS_fix(G(L)->tmname[i]); /* never collect these names */ } } /* ** function to be used with macro "fasttm": optimized for absence of ** tag methods */ const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { const TValue *tm = luaH_getstr(events, ename); lua_assert(event <= TM_EQ); if (ttisnil(tm)) { /* no tag method? */ events->flags |= cast_byte(1u<<event); /* cache this fact */ return NULL; } else return tm; } const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { Table *mt; switch (ttype(o)) { case LUA_TTABLE: mt = hvalue(o)->metatable; break; case LUA_TUSERDATA: mt = uvalue(o)->metatable; break; default: mt = G(L)->mt[ttype(o)]; } return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); }