summaryrefslogtreecommitdiff
path: root/src/clientmap.h
diff options
context:
space:
mode:
authorNer'zhul <nerzhul@users.noreply.github.com>2017-01-09 20:39:22 +0100
committerGitHub <noreply@github.com>2017-01-09 20:39:22 +0100
commit8e7449e09253e138716d8dbad6a2ab5c6e089e28 (patch)
treeca6895fb557229445b04639efe7fc57b3e33157b /src/clientmap.h
parent11df7e886a674e280e3ec6f895c11fc1e70eb7b3 (diff)
downloadminetest-8e7449e09253e138716d8dbad6a2ab5c6e089e28.tar.gz
minetest-8e7449e09253e138716d8dbad6a2ab5c6e089e28.tar.bz2
minetest-8e7449e09253e138716d8dbad6a2ab5c6e089e28.zip
Environment & IGameDef code refactoring (#4985)
* Environment code refactoring * Cleanup includes & class declarations in client & server environment to improve build speed * ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts. * Cleanup IGameDef * Move ITextureSource* IGameDef::getTextureSource() to Client only. * Also move ITextureSource *IGameDef::tsrc() helper * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call * drop unused emerge() call * cleanup server unused functions (mentionned before) * Drop one unused parameter from ContentFeatures::updateTextures * move checkLocalPrivilege to Client * Remove some unnecessary casts * create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it * Fix some comments * Change required IGameDef to Server/Client pointers * Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects * Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu * drop ClientMap::sectorWasDrawn which is unused
Diffstat (limited to 'src/clientmap.h')
-rw-r--r--src/clientmap.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/clientmap.h b/src/clientmap.h
index cb686ff33..84228f4ca 100644
--- a/src/clientmap.h
+++ b/src/clientmap.h
@@ -59,7 +59,7 @@ class ITextureSource;
/*
ClientMap
-
+
This is the only map class that is able to render itself on screen.
*/
@@ -68,7 +68,6 @@ class ClientMap : public Map, public scene::ISceneNode
public:
ClientMap(
Client *client,
- IGameDef *gamedef,
MapDrawControl &control,
scene::ISceneNode* parent,
scene::ISceneManager* mgr,
@@ -114,13 +113,13 @@ public:
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
renderMap(driver, SceneManager->getSceneNodeRenderPass());
}
-
+
virtual const aabb3f &getBoundingBox() const
{
return m_box;
}
-
- void getBlocksInViewRange(v3s16 cam_pos_nodes,
+
+ void getBlocksInViewRange(v3s16 cam_pos_nodes,
v3s16 *p_blocks_min, v3s16 *p_blocks_max);
void updateDrawList(video::IVideoDriver* driver);
void renderMap(video::IVideoDriver* driver, s32 pass);
@@ -132,20 +131,14 @@ public:
// For debug printing
virtual void PrintInfo(std::ostream &out);
-
- // Check if sector was drawn on last render()
- bool sectorWasDrawn(v2s16 p)
- {
- return (m_last_drawn_sectors.find(p) != m_last_drawn_sectors.end());
- }
const MapDrawControl & getControl() const { return m_control; }
f32 getCameraFov() const { return m_camera_fov; }
private:
Client *m_client;
-
+
aabb3f m_box;
-
+
MapDrawControl &m_control;
v3f m_camera_position;
@@ -154,7 +147,7 @@ private:
v3s16 m_camera_offset;
std::map<v3s16, MapBlock*> m_drawlist;
-
+
std::set<v2s16> m_last_drawn_sectors;
bool m_cache_trilinear_filter;