1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.

This commit is contained in:
Kahrl 2011-09-07 19:21:28 +02:00
parent d28ea57083
commit c0b35fa429
9 changed files with 61 additions and 53 deletions

View file

@ -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