Noise: Prevent unittest crash caused by division by zero
[oweals/minetest.git] / src / minimap.cpp
index 9b17cbc6ea8c342b60528bb7922d9f63f6b1ad86..71a4c9c67874f7fa05f0d133847101a7dcc0b321 100644 (file)
@@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/string.h"
 #include "mapblock.h"
 #include <math.h>
+#include "client/renderingengine.h"
 
 
 ////
@@ -184,10 +185,10 @@ void MinimapUpdateThread::getMap(v3s16 pos, s16 size, s16 height)
 //// Mapper
 ////
 
-Minimap::Minimap(IrrlichtDevice *device, Client *client)
+Minimap::Minimap(Client *client)
 {
        this->client    = client;
-       this->driver    = device->getVideoDriver();
+       this->driver    = RenderingEngine::get_video_driver();
        this->m_tsrc    = client->getTextureSource();
        this->m_shdrsrc = client->getShaderSource();
        this->m_ndef    = client->getNodeDefManager();
@@ -478,7 +479,7 @@ void Minimap::drawMinimap()
                return;
 
        updateActiveMarkers();
-       v2u32 screensize = porting::getWindowSize();
+       v2u32 screensize = RenderingEngine::get_instance()->getWindowSize();
        const u32 size = 0.25 * screensize.Y;
 
        core::rect<s32> oldViewPort = driver->getViewPort();
@@ -605,7 +606,7 @@ void Minimap::updateActiveMarkers()
 //// MinimapMapblock
 ////
 
-void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, v3s16 pos)
+void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, const v3s16 &pos)
 {
 
        for (s16 x = 0; x < MAP_BLOCKSIZE; x++)