mirror of
https://github.com/minetest/minetest.git
synced 2024-12-22 22:22:23 +01:00
Use irr_ptr for ClientEnvironment::m_map
This commit is contained in:
parent
e3efaa1733
commit
ecf8c7696a
@ -120,7 +120,7 @@ Client::Client(
|
|||||||
m_rendering_engine(rendering_engine),
|
m_rendering_engine(rendering_engine),
|
||||||
m_mesh_update_manager(std::make_unique<MeshUpdateManager>(this)),
|
m_mesh_update_manager(std::make_unique<MeshUpdateManager>(this)),
|
||||||
m_env(
|
m_env(
|
||||||
new ClientMap(this, rendering_engine, control, 666),
|
make_irr<ClientMap>(this, rendering_engine, control, 666),
|
||||||
tsrc, this
|
tsrc, this
|
||||||
),
|
),
|
||||||
m_particle_manager(std::make_unique<ParticleManager>(&m_env)),
|
m_particle_manager(std::make_unique<ParticleManager>(&m_env)),
|
||||||
|
@ -43,10 +43,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
ClientEnvironment
|
ClientEnvironment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ClientEnvironment::ClientEnvironment(ClientMap *map,
|
ClientEnvironment::ClientEnvironment(irr_ptr<ClientMap> map,
|
||||||
ITextureSource *texturesource, Client *client):
|
ITextureSource *texturesource, Client *client):
|
||||||
Environment(client),
|
Environment(client),
|
||||||
m_map(map),
|
m_map(std::move(map)),
|
||||||
m_texturesource(texturesource),
|
m_texturesource(texturesource),
|
||||||
m_client(client)
|
m_client(client)
|
||||||
{
|
{
|
||||||
@ -60,8 +60,7 @@ ClientEnvironment::~ClientEnvironment()
|
|||||||
delete simple_object;
|
delete simple_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drop/delete map
|
m_map.reset();
|
||||||
m_map->drop();
|
|
||||||
|
|
||||||
delete m_local_player;
|
delete m_local_player;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "util/numeric.h" // IntervalLimiter
|
#include "util/numeric.h" // IntervalLimiter
|
||||||
#include "activeobjectmgr.h" // client::ActiveObjectMgr
|
#include "activeobjectmgr.h" // client::ActiveObjectMgr
|
||||||
|
#include "irr_ptr.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
@ -66,7 +67,7 @@ typedef std::unordered_map<u16, ClientActiveObject*> ClientActiveObjectMap;
|
|||||||
class ClientEnvironment : public Environment
|
class ClientEnvironment : public Environment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClientEnvironment(ClientMap *map, ITextureSource *texturesource, Client *client);
|
ClientEnvironment(irr_ptr<ClientMap> map, ITextureSource *texturesource, Client *client);
|
||||||
~ClientEnvironment();
|
~ClientEnvironment();
|
||||||
|
|
||||||
Map & getMap();
|
Map & getMap();
|
||||||
@ -151,7 +152,7 @@ public:
|
|||||||
u64 getFrameTimeDelta() const { return m_frame_dtime; }
|
u64 getFrameTimeDelta() const { return m_frame_dtime; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ClientMap *m_map;
|
irr_ptr<ClientMap> m_map;
|
||||||
LocalPlayer *m_local_player = nullptr;
|
LocalPlayer *m_local_player = nullptr;
|
||||||
ITextureSource *m_texturesource;
|
ITextureSource *m_texturesource;
|
||||||
Client *m_client;
|
Client *m_client;
|
||||||
|
Loading…
Reference in New Issue
Block a user