summaryrefslogtreecommitdiff
path: root/src/client.cpp
Commit message (Expand)AuthorAge
* Switch sound randomizer postfixes from N.ogg to .N.oggPerttu Ahola2012-03-25
* Almost support loading sounds from serverPerttu Ahola2012-03-25
* Texture cache -> Media cache WIPPerttu Ahola2012-03-25
* Cache textures by checksumJonathan Neuschäfer2012-03-25
* Lua API for playing soundsPerttu Ahola2012-03-24
* Add event manager and use it to trigger soundsPerttu Ahola2012-03-24
* c55sound continuedPerttu Ahola2012-03-24
* celeron55's sound system initial frameworkPerttu Ahola2012-03-24
* Profiler graphPerttu Ahola2012-03-21
* Dynamic sky, fog and cloud colors; sun and moonPerttu Ahola2012-03-18
* Move ClientMap to clientmap.{h,cpp}Perttu Ahola2012-03-16
* Add Client::getEnv() and remove some unnecessary wrappersPerttu Ahola2012-03-15
* MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light,...Kahrl2012-03-15
* Chat console, including a number of rebases and modifications.Kahrl2012-03-10
* Initial directory structure reworkPerttu Ahola2012-03-10
* Players stay in environment even when dead, damage flash and fall damage fixesKahrl2012-02-05
* Client-side prediction of inventory changes, and some inventory menu fixesKahrl2012-01-22
* Node placement / mineral / serialization / iron freq / node_dig callbackKahrl2012-01-22
* The huge item definition and item namespace unification patch (itemdef), see ...Kahrl2012-01-12
* Add missing checks to texture cachingPerttu Ahola2012-01-04
* Use free rather than delete for malloc'd memoryPerttu Ahola2012-01-02
* Texture cache on client (mostly made by sapier) (breaks network compatibility)Perttu Ahola2012-01-02
* Add InvRef and InvStack (currently untested and unusable)Perttu Ahola2012-01-02
* Fix player double damagePerttu Ahola2011-12-02
* Remove stuff made obsolete by making players more ActiveObject-like and raise...Perttu Ahola2011-12-01
* Player-is-SAO WIPPerttu Ahola2011-12-01
* Fix deadlock if MeshUpdateThread asks new textures while it is being stopped ...Perttu Ahola2011-12-01
* CraftItem rework and Lua interfaceKahrl2011-11-29
* Crafting definition in scriptsPerttu Ahola2011-11-29
* Do not expose CONTENT_* stuff in content_mapnode.h and use a name converter w...Perttu Ahola2011-11-29
* Node definition namesPerttu Ahola2011-11-29
* Cut down content transfer verbosityPerttu Ahola2011-11-29
* Improve loading screen and protocolPerttu Ahola2011-11-29
* Node definitions transferPerttu Ahola2011-11-29
* Properly update textures in node definitionsPerttu Ahola2011-11-29
* Sending of textures WIPPerttu Ahola2011-11-29
* Tool definition transfer to clientPerttu Ahola2011-11-29
* Make possible and do update textures in node definitions after late texture a...Perttu Ahola2011-11-29
* GameDef compilesPerttu Ahola2011-11-29
* Create framework for getting rid of global definitions of node/tool/item/what...Perttu Ahola2011-11-29
* Allocate MapBlock::m_node_metadata on heap to allow less header bloatPerttu Ahola2011-11-29
* Make Connection::Receive return the data via a SharedBuffer reference, so the...Kahrl2011-11-07
* Improve Connection with threading and some kind of congestion controlPerttu Ahola2011-10-20
* Fix and tune block sendingPerttu Ahola2011-10-19
* Display RTT (round trip time, ping) on client status textPerttu Ahola2011-10-17
* Use the logger; also, default to not showing much crap in console. Use --info...Perttu Ahola2011-10-16
* Make dungeon masters though and make oerkkis disappear when they get to you (...Perttu Ahola2011-10-15
* Handle death and respawn betterPerttu Ahola2011-10-15
* Improve mobv2Perttu Ahola2011-10-15
* mobv2Perttu Ahola2011-10-15
n class="hl opt">, -2, "x"); lua_pushnumber(L, camera->getFovY() * core::DEGTORAD); lua_setfield(L, -2, "y"); lua_pushnumber(L, camera->getCameraNode()->getFOV() * core::RADTODEG); lua_setfield(L, -2, "actual"); lua_pushnumber(L, camera->getFovMax() * core::RADTODEG); lua_setfield(L, -2, "max"); return 1; } int LuaCamera::l_get_pos(lua_State *L) { Camera *camera = getobject(L, 1); if (!camera) return 0; push_v3f(L, camera->getPosition()); return 1; } int LuaCamera::l_get_offset(lua_State *L) { Camera *camera = getobject(L, 1); if (!camera) return 0; push_v3s16(L, camera->getOffset()); return 1; } int LuaCamera::l_get_look_dir(lua_State *L) { LocalPlayer *player = getClient(L)->getEnv().getLocalPlayer(); sanity_check(player); float pitch = -1.0 * player->getPitch() * core::DEGTORAD; float yaw = (player->getYaw() + 90.) * core::DEGTORAD; v3f v(cos(pitch) * cos(yaw), sin(pitch), cos(pitch) * sin(yaw)); push_v3f(L, v); return 1; } int LuaCamera::l_get_look_horizontal(lua_State *L) { LocalPlayer *player = getClient(L)->getEnv().getLocalPlayer(); sanity_check(player); lua_pushnumber(L, (player->getYaw() + 90.) * core::DEGTORAD); return 1; } int LuaCamera::l_get_look_vertical(lua_State *L) { LocalPlayer *player = getClient(L)->getEnv().getLocalPlayer(); sanity_check(player); lua_pushnumber(L, -1.0 * player->getPitch() * core::DEGTORAD); return 1; } int LuaCamera::l_get_aspect_ratio(lua_State *L) { Camera *camera = getobject(L, 1); if (!camera) return 0; lua_pushnumber(L, camera->getCameraNode()->getAspectRatio()); return 1; } LuaCamera *LuaCamera::checkobject(lua_State *L, int narg) { luaL_checktype(L, narg, LUA_TUSERDATA); void *ud = luaL_checkudata(L, narg, className); if (!ud) luaL_typerror(L, narg, className); return *(LuaCamera **)ud; } Camera *LuaCamera::getobject(LuaCamera *ref) { return ref->m_camera; } Camera *LuaCamera::getobject(lua_State *L, int narg) { LuaCamera *ref = checkobject(L, narg); assert(ref); Camera *camera = getobject(ref); if (!camera) return NULL; return camera; } int LuaCamera::gc_object(lua_State *L) { LuaCamera *o = *(LuaCamera **)(lua_touserdata(L, 1)); delete o; return 0; } void LuaCamera::Register(lua_State *L) { lua_newtable(L); int methodtable = lua_gettop(L); luaL_newmetatable(L, className); int metatable = lua_gettop(L); lua_pushliteral(L, "__metatable"); lua_pushvalue(L, methodtable); lua_settable(L, metatable); lua_pushliteral(L, "__index"); lua_pushvalue(L, methodtable); lua_settable(L, metatable); lua_pushliteral(L, "__gc"); lua_pushcfunction(L, gc_object); lua_settable(L, metatable); lua_pop(L, 1); luaL_openlib(L, 0, methods, 0); lua_pop(L, 1); } const char LuaCamera::className[] = "Camera"; const luaL_Reg LuaCamera::methods[] = {luamethod(LuaCamera, set_camera_mode), luamethod(LuaCamera, get_camera_mode), luamethod(LuaCamera, get_fov), luamethod(LuaCamera, get_pos), luamethod(LuaCamera, get_offset), luamethod(LuaCamera, get_look_dir), luamethod(LuaCamera, get_look_vertical), luamethod(LuaCamera, get_look_horizontal), luamethod(LuaCamera, get_aspect_ratio), {0, 0}};