aboutsummaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-26 20:11:17 +0200
committerGitHub <noreply@github.com>2017-06-26 20:11:17 +0200
commitb3a36f7378ea0f299cfa36c81de42e00adb7292d (patch)
tree23d056b575ff0dba8cc759cc00f732099a1f3bce /src/mapblock_mesh.cpp
parenta8650e785df3f12efa5f8cd3c6a695fb9e22a598 (diff)
downloadminetest-b3a36f7378ea0f299cfa36c81de42e00adb7292d.tar.xz
Isolate irrlicht references and use a singleton (#6041)
* Add Device3D class which will contain IrrlichtDevice interface move getSupportedVideoDrivers to Device3D Add Device3D singleton & use it in various places Rename Device3D to Rendering engine & add helper functions to various device pointers More singleton work RenderingEngine owns draw_load_screen move draw functions to RenderingEngine Reduce IrrlichtDevice exposure and guienvironment RenderingEngine: Expose get_timer_time() to remove device from guiEngine Make irrlichtdevice & scene manager less exposed * Code style fixes * Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly * enum paralax => enum parallax
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r--src/mapblock_mesh.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index 04a22716c..d8a7d4d7d 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "shader.h"
#include "settings.h"
#include "util/directiontables.h"
-#include <IMeshManipulator.h>
+#include "client/renderingengine.h"
/*
MeshMakeData
@@ -1008,15 +1008,11 @@ static void updateAllFastFaceRows(MeshMakeData *data,
MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
m_minimap_mapblock(NULL),
- m_client(data->m_client),
- m_driver(m_client->tsrc()->getDevice()->getVideoDriver()),
- m_tsrc(m_client->getTextureSource()),
- m_shdrsrc(m_client->getShaderSource()),
+ m_tsrc(data->m_client->getTextureSource()),
+ m_shdrsrc(data->m_client->getShaderSource()),
m_animation_force_timer(0), // force initial animation
m_last_crack(-1),
- m_crack_materials(),
- m_last_daynight_ratio((u32) -1),
- m_daynight_diffs()
+ m_last_daynight_ratio((u32) -1)
{
for (int m = 0; m < MAX_TILE_LAYERS; m++)
m_mesh[m] = new scene::SMesh();
@@ -1219,7 +1215,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
if (m_use_tangent_vertices) {
scene::IMeshManipulator* meshmanip =
- m_client->getSceneManager()->getMeshManipulator();
+ RenderingEngine::get_scene_manager()->getMeshManipulator();
meshmanip->recalculateTangents(m_mesh[layer], true, false, false);
}
@@ -1254,7 +1250,7 @@ MapBlockMesh::~MapBlockMesh()
if (m_enable_vbo && m_mesh[m])
for (u32 i = 0; i < m_mesh[m]->getMeshBufferCount(); i++) {
scene::IMeshBuffer *buf = m_mesh[m]->getMeshBuffer(i);
- m_driver->removeHardwareBuffer(buf);
+ RenderingEngine::get_video_driver()->removeHardwareBuffer(buf);
}
m_mesh[m]->drop();
m_mesh[m] = NULL;