#include "settings.h"
#include "profiler.h"
#include "log.h"
+#include "nodemetadata.h"
/*
QueuedMeshUpdate
#include "profiler.h"
#include "scriptapi.h"
#include "mapnode_contentfeatures.h"
+#include "nodemetadata.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
activateObjects(block);
// Run node metadata
- bool changed = block->m_node_metadata.step((float)dtime_s);
+ bool changed = block->m_node_metadata->step((float)dtime_s);
if(changed)
{
MapEditEvent event;
block->setTimestampNoChangedFlag(m_game_time);
// Run node metadata
- bool changed = block->m_node_metadata.step(dtime);
+ bool changed = block->m_node_metadata->step(dtime);
if(changed)
{
MapEditEvent event;
#include "filesys.h"
// Needed for determining pointing to nodes
#include "mapnode_contentfeatures.h"
+#include "nodemetadata.h"
/*
Setting this to 1 enables a special camera mode that forces
<<std::endl;
return NULL;
}
- NodeMetadata *meta = block->m_node_metadata.get(p_rel);
+ NodeMetadata *meta = block->m_node_metadata->get(p_rel);
return meta;
}
<<std::endl;
return;
}
- block->m_node_metadata.set(p_rel, meta);
+ block->m_node_metadata->set(p_rel, meta);
}
void Map::removeNodeMetadata(v3s16 p)
<<std::endl;
return;
}
- block->m_node_metadata.remove(p_rel);
+ block->m_node_metadata->remove(p_rel);
}
void Map::nodeMetadataStep(float dtime,
for(i=sectorblocks.begin(); i!=sectorblocks.end(); i++)
{
MapBlock *block = *i;
- bool changed = block->m_node_metadata.step(dtime);
+ bool changed = block->m_node_metadata->step(dtime);
if(changed)
changed_blocks[block->getPos()] = block;
}
#include "light.h"
#include <sstream>
#include "mapnode_contentfeatures.h"
+#include "nodemetadata.h"
/*
MapBlock
*/
MapBlock::MapBlock(Map *parent, v3s16 pos, bool dummy):
+ m_node_metadata(new NodeMetadataList),
m_parent(parent),
m_pos(pos),
m_modified(MOD_STATE_WRITE_NEEDED),
if(dummy == false)
reallocate();
- //m_spawn_timer = -10000;
-
#ifndef SERVER
m_mesh_expired = false;
mesh_mutex.Init();
}
#endif
+ delete m_node_metadata;
+
if(data)
delete[] data;
}
{
try{
std::ostringstream oss(std::ios_base::binary);
- m_node_metadata.serialize(oss);
+ m_node_metadata->serialize(oss);
os<<serializeString(oss.str());
}
// This will happen if the string is longer than 65535
else
{
std::ostringstream oss(std::ios_base::binary);
- m_node_metadata.serialize(oss);
+ m_node_metadata->serialize(oss);
compressZlib(oss.str(), os);
//os<<serializeLongString(oss.str());
}
{
std::string data = deSerializeString(is);
std::istringstream iss(data, std::ios_base::binary);
- m_node_metadata.deSerialize(iss);
+ m_node_metadata->deSerialize(iss);
}
else
{
std::ostringstream oss(std::ios_base::binary);
decompressZlib(is, oss);
std::istringstream iss(oss.str(), std::ios_base::binary);
- m_node_metadata.deSerialize(iss);
+ m_node_metadata->deSerialize(iss);
}
}
catch(SerializationError &e)
#include "serialization.h"
#include "constants.h"
#include "voxel.h"
-#include "nodemetadata.h"
#include "staticobject.h"
#include "mapblock_nodemod.h"
#ifndef SERVER
#endif
class Map;
+class NodeMetadataList;
#define BLOCK_TIMESTAMP_UNDEFINED 0xffffffff
JMutex mesh_mutex;
#endif
- NodeMetadataList m_node_metadata;
+ NodeMetadataList *m_node_metadata;
StaticObjectList m_static_objects;
private: