diff options
author | Kahrl <kahrl@gmx.net> | 2011-09-07 19:21:28 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2011-09-07 19:21:28 +0200 |
commit | c0b35fa429c68b49b2d6a5124aff6dcc31400b63 (patch) | |
tree | 32a3c9856e7f34bf1055177ba3f939624dc0c695 /src/client.cpp | |
parent | d28ea57083481bff8180249fc8b43f7ed7b18545 (diff) | |
download | minetest-c0b35fa429c68b49b2d6a5124aff6dcc31400b63.tar.gz minetest-c0b35fa429c68b49b2d6a5124aff6dcc31400b63.tar.bz2 minetest-c0b35fa429c68b49b2d6a5124aff6dcc31400b63.zip |
Removed unused camera_position and camera_direction fields from Client. Moved ClientEnvironment::drawPostFx to ClientMap::renderPostFx -- this will make the camera management classes easier to write, as ClientMap already knows the camera position but ClientEnvironment doesn't and has to be told about it. This also eliminates the need for Client::getEnv(). Made the post effect color a content feature defined in content_mapnode.h.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp index a5ed6f61b..df792d116 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -189,8 +189,6 @@ Client::Client( ), m_con(PROTOCOL_ID, 512, CONNECTION_TIMEOUT, this), m_device(device), - camera_position(0,0,0), - camera_direction(0,0,1), m_server_ser_ver(SER_FMT_VER_INVALID), m_inventory_updated(false), m_time_of_day(0), @@ -1983,8 +1981,11 @@ void Client::addNode(v3s16 p, MapNode n) void Client::updateCamera(v3f pos, v3f dir) { m_env.getClientMap().updateCamera(pos, dir); - camera_position = pos; - camera_direction = dir; +} + +void Client::renderPostFx() +{ + m_env.getClientMap().renderPostFx(); } MapNode Client::getNode(v3s16 p) @@ -1998,6 +1999,11 @@ NodeMetadata* Client::getNodeMetadata(v3s16 p) return m_env.getMap().getNodeMetadata(p); } +LocalPlayer* Client::getLocalPlayer() +{ + return m_env.getLocalPlayer(); +} + v3f Client::getPlayerPosition(v3f *eye_position) { //JMutexAutoLock envlock(m_env_mutex); //bulk comment-out |