set(RELEASE_WARNING_FLAGS "")
endif()
- if(NOT APPLE AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- CHECK_CXX_COMPILER_FLAG("-Wno-unused-but-set-variable" HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
- if(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
- set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
- endif(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
- endif()
-
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# clang does not understand __extern_always_inline but libc headers use it
set(OTHER_FLAGS "${OTHER_FLAGS} \"-D__extern_always_inline=extern __always_inline\"")
MeshUpdateQueue();
~MeshUpdateQueue();
-
+
/*
peer_id=0 adds with nobody to send to
*/
JMutexAutoLock lock(m_mutex);
return m_queue.size();
}
-
+
private:
std::vector<QueuedMeshUpdate*> m_queue;
std::set<v3s16> m_urgents;
MutexedQueue<MeshUpdateResult> m_queue_out;
IGameDef *m_gamedef;
-
+
v3s16 m_camera_offset;
};
{
ClientEventType type;
union{
- struct{
- } none;
+ //struct{
+ //} none;
struct{
u8 amount;
} player_damage;
std::string *formspec;
std::string *formname;
} show_formspec;
- struct{
- } textures_updated;
+ //struct{
+ //} textures_updated;
struct{
v3f *pos;
v3f *vel;
MtEventManager *event,
bool ipv6
);
-
+
~Client();
/*
ClientEnvironment& getEnv()
{ return m_env; }
-
+
// Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent)
void removeNode(v3s16 p);
void addNode(v3s16 p, MapNode n, bool remove_metadata = true);
-
+
void setPlayerControl(PlayerControl &control);
void selectPlayerItem(u16 item);
bool getLocalInventoryUpdated();
// Copies the inventory of the local player to parameter
void getLocalInventory(Inventory &dst);
-
+
/* InventoryManager interface */
Inventory* getInventory(const InventoryLocation &loc);
void inventoryAction(InventoryAction *a);
// Including blocks at appropriate edges
void addUpdateMeshTaskWithEdge(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
void addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server=false, bool urgent=false);
-
+
void updateCameraOffset(v3s16 camera_offset)
{ m_mesh_update_thread.m_camera_offset = camera_offset; }
// Get event from queue. CE_NONE is returned if queue is empty.
ClientEvent getClientEvent();
-
+
bool accessDenied()
{ return m_access_denied; }
// Virtual methods from con::PeerHandler
void peerAdded(con::Peer *peer);
void deletingPeer(con::Peer *peer, bool timeout);
-
+
void ReceiveAll();
void Receive();
-
+
void sendPlayerPos();
// Send the item number 'item' as player item to the server
void sendPlayerItem(u16 item);
-
+
float m_packetcounter_timer;
float m_connection_reinit_timer;
float m_avg_rtt_timer;
s32 nearest_emerged_d = -1;
s32 nearest_emergefull_d = -1;
s32 nearest_sent_d = -1;
- bool queue_is_full = false;
+ //bool queue_is_full = false;
s16 d;
for(d = d_start; d <= d_max; d++)
// Don't select too many blocks for sending
if(num_blocks_selected >= max_simul_dynamic)
{
- queue_is_full = true;
+ //queue_is_full = true;
goto queue_full_break;
}
v3f camera_position = m_camera_position;
v3f camera_direction = m_camera_direction;
f32 camera_fov = m_camera_fov;
- v3s16 camera_offset = m_camera_offset;
+ //v3s16 camera_offset = m_camera_offset;
m_camera_mutex.Unlock();
// Use a higher fov to accomodate faster camera movements.
unsigned int packet_loss = 11; /* use a neutral value for initialization */
unsigned int packets_successfull = 0;
- unsigned int packet_too_late = 0;
+ //unsigned int packet_too_late = 0;
bool reasonable_amount_of_data_transmitted = false;
{
JMutexAutoLock internal(m_internal_mutex);
packet_loss = current_packet_loss;
- packet_too_late = current_packet_too_late;
+ //packet_too_late = current_packet_too_late;
packets_successfull = current_packet_successfull;
if (current_bytes_transfered > (unsigned int) (window_size*512/2))
// And never save to disk
bool isStaticAllowed() const
{ return false; }
-
+
static ServerActiveObject* create(ServerEnvironment *env, v3f pos,
const std::string &data)
{
}
u8 getType() const
{ return ACTIVEOBJECT_TYPE_TEST; }
-
+
static ServerActiveObject* create(ServerEnvironment *env, v3f pos,
const std::string &data)
{
public:
u8 getType() const
{ return ACTIVEOBJECT_TYPE_ITEM; }
-
+
float getMinimumSavedMovement()
{ return 0.1*BS; }
if(m_move_interval.step(dtime, interval)==false)
return;
dtime = interval;
-
+
core::aabbox3d<f32> box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.);
collisionMoveResult moveresult;
// Apply gravity
if(m_speed_f.getLength()*dtime > pos_max_d)
m_speed_f *= pos_max_d / (m_speed_f.getLength()*dtime);
v3f pos_f = getBasePosition();
- v3f pos_f_old = pos_f;
v3f accel_f = v3f(0,0,0);
f32 stepheight = 0;
moveresult = collisionMoveSimple(m_env,m_env->getGameDef(),
pos_max_d, box, stepheight, dtime,
pos_f, m_speed_f, accel_f);
-
+
if(send_recommended == false)
return;
m_itemstring_changed = true;
}
}
-
+
return 0;
}
ServerActiveObject::registerType(getType(), create);
return;
}
-
+
// Initialize something to armor groups
m_armor_groups["fleshy"] = 100;
}
void LuaEntitySAO::addedToEnvironment(u32 dtime_s)
{
ServerActiveObject::addedToEnvironment(dtime_s);
-
+
// Create entity from name
m_registered = m_env->getScriptIface()->
luaentity_Add(m_id, m_init_name.c_str());
-
+
if(m_registered){
// Get properties
m_env->getScriptIface()->
return 0;
}
- // It's best that attachments cannot be punched
+ // It's best that attachments cannot be punched
if(isAttached())
return 0;
-
+
ItemStack *punchitem = NULL;
ItemStack punchitem_static;
if(puncher){
toolcap,
punchitem,
time_from_last_punch);
-
+
if(result.did_punch)
{
setHP(getHP() - result.damage);
-
+
std::string punchername = "nil";
actionstream<<getDescription()<<" punched by "
<<punchername<<", damage "<<result.damage
<<" hp, health now "<<getHP()<<" hp"<<std::endl;
-
+
{
std::string str = gob_cmd_punched(result.damage, getHP());
// create message and add to list
// If the object is attached client-side, don't waste bandwidth sending its position to clients
if(isAttached())
return;
-
+
m_last_sent_move_precision = m_base_position.getDistanceFrom(
m_last_sent_position);
m_last_sent_position_timer = 0;
ServerActiveObject *puncher,
float time_from_last_punch)
{
- // It's best that attachments cannot be punched
+ // It's best that attachments cannot be punched
if(isAttached())
return 0;
*/
float player_max_speed = 0;
- float player_max_speed_up = 0;
if(m_privs.count("fast") != 0){
// Fast speed
player_max_speed = m_player->movement_speed_fast;
- player_max_speed_up = m_player->movement_speed_fast;
} else {
// Normal speed
player_max_speed = m_player->movement_speed_walk;
- player_max_speed_up = m_player->movement_speed_walk;
}
// Tolerance. With the lag pool we shouldn't need it.
//player_max_speed *= 2.5;
image = images[1];
else
image = images[0];
-
+
driver->setRenderTarget(image, true, true,
irr::video::SColor(255,
skycolor.getRed(), skycolor.getGreen(), skycolor.getBlue()));
gui::IGUIEnvironment* guienv, std::vector<aabb3f> hilightboxes,
const v2u32& screensize, video::SColor skycolor, bool show_hud)
{
- //TODO check if usefull
- u32 scenetime = 0;
- {
- TimeTaker timer("smgr");
+ TimeTaker timer("smgr");
- bool draw_wield_tool = (show_hud &&
- (player->hud_flags & HUD_FLAG_WIELDITEM_VISIBLE) &&
- camera.getCameraMode() < CAMERA_MODE_THIRD );
+ bool draw_wield_tool = (show_hud &&
+ (player->hud_flags & HUD_FLAG_WIELDITEM_VISIBLE) &&
+ camera.getCameraMode() < CAMERA_MODE_THIRD );
- bool draw_crosshair = ((player->hud_flags & HUD_FLAG_CROSSHAIR_VISIBLE) &&
- (camera.getCameraMode() != CAMERA_MODE_THIRD_FRONT));
+ bool draw_crosshair = ((player->hud_flags & HUD_FLAG_CROSSHAIR_VISIBLE) &&
+ (camera.getCameraMode() != CAMERA_MODE_THIRD_FRONT));
#ifdef HAVE_TOUCHSCREENGUI
- try {
- draw_crosshair = !g_settings->getBool("touchtarget");
- }
- catch(SettingNotFoundException) {}
+ try {
+ draw_crosshair = !g_settings->getBool("touchtarget");
+ }
+ catch(SettingNotFoundException) {}
#endif
- std::string draw_mode = g_settings->get("3d_mode");
-
- smgr->drawAll();
-
- if (draw_mode == "anaglyph")
- {
- draw_anaglyph_3d_mode(camera, show_hud, hud, hilightboxes, driver,
- smgr, draw_wield_tool, client, guienv);
- draw_crosshair = false;
- }
- else if (draw_mode == "interlaced")
- {
- draw_interlaced_3d_mode(camera, show_hud, hud, hilightboxes, driver,
- smgr, screensize, draw_wield_tool, client, guienv, skycolor);
- draw_crosshair = false;
- }
- else if (draw_mode == "sidebyside")
- {
- draw_sidebyside_3d_mode(camera, show_hud, hud, hilightboxes, driver,
- smgr, screensize, draw_wield_tool, client, guienv, skycolor);
- show_hud = false;
- }
- else if (draw_mode == "topbottom")
- {
- draw_top_bottom_3d_mode(camera, show_hud, hud, hilightboxes, driver,
- smgr, screensize, draw_wield_tool, client, guienv, skycolor);
- show_hud = false;
- }
- else {
- draw_plain(camera, show_hud, hud, hilightboxes, driver,
- draw_wield_tool, client, guienv);
- }
-
- /*
- Post effects
- */
- {
- client.getEnv().getClientMap().renderPostFx(camera.getCameraMode());
- }
-
- //TODO how to make those 3d too
- if (show_hud)
- {
- if (draw_crosshair)
- hud.drawCrosshair();
- hud.drawHotbar(client.getPlayerItem());
- hud.drawLuaElements(camera.getOffset());
- }
+ std::string draw_mode = g_settings->get("3d_mode");
- guienv->drawAll();
+ smgr->drawAll();
+
+ if (draw_mode == "anaglyph")
+ {
+ draw_anaglyph_3d_mode(camera, show_hud, hud, hilightboxes, driver,
+ smgr, draw_wield_tool, client, guienv);
+ draw_crosshair = false;
+ }
+ else if (draw_mode == "interlaced")
+ {
+ draw_interlaced_3d_mode(camera, show_hud, hud, hilightboxes, driver,
+ smgr, screensize, draw_wield_tool, client, guienv, skycolor);
+ draw_crosshair = false;
+ }
+ else if (draw_mode == "sidebyside")
+ {
+ draw_sidebyside_3d_mode(camera, show_hud, hud, hilightboxes, driver,
+ smgr, screensize, draw_wield_tool, client, guienv, skycolor);
+ show_hud = false;
+ }
+ else if (draw_mode == "topbottom")
+ {
+ draw_top_bottom_3d_mode(camera, show_hud, hud, hilightboxes, driver,
+ smgr, screensize, draw_wield_tool, client, guienv, skycolor);
+ show_hud = false;
+ }
+ else {
+ draw_plain(camera, show_hud, hud, hilightboxes, driver,
+ draw_wield_tool, client, guienv);
+ }
- scenetime = timer.stop(true);
+ /*
+ Post effects
+ */
+ {
+ client.getEnv().getClientMap().renderPostFx(camera.getCameraMode());
}
+ //TODO how to make those 3d too
+ if (show_hud)
+ {
+ if (draw_crosshair)
+ hud.drawCrosshair();
+ hud.drawHotbar(client.getPlayerItem());
+ hud.drawLuaElements(camera.getOffset());
+ }
+
+ guienv->drawAll();
+
+ timer.stop(true);
}
/*
Player * getNearestConnectedPlayer(v3f pos);
std::list<Player*> getPlayers();
std::list<Player*> getPlayers(bool ignore_disconnected);
-
+
u32 getDayNightRatio();
// 0-23999
void stepTimeOfDay(float dtime);
void setTimeOfDaySpeed(float speed);
-
+
float getTimeOfDaySpeed();
void setDayNightRatioOverride(bool enable, u32 value)
* a later release.
*/
bool m_cache_enable_shaders;
-
+
private:
JMutex m_lock;
public:
ActiveBlockModifier(){};
virtual ~ActiveBlockModifier(){};
-
+
// Set of contents to trigger on
virtual std::set<std::string> getTriggerContents()=0;
// Set of required neighbors (trigger doesn't happen if none are found)
Returns 0 if not added and thus deleted.
*/
u16 addActiveObject(ServerActiveObject *object);
-
+
/*
Add an active object as a static object to the corresponding
MapBlock.
(note: not used, pending removal from engine)
*/
//bool addActiveObjectAsStatic(ServerActiveObject *object);
-
+
/*
Find out what new objects have been added to
inside a radius around a position
s16 player_radius,
std::set<u16> ¤t_objects,
std::set<u16> &removed_objects);
-
+
/*
Get the next message emitted by some active object.
Returns a message with id=0 if no messages are available.
bool setNode(v3s16 p, const MapNode &n);
bool removeNode(v3s16 p);
bool swapNode(v3s16 p, const MapNode &n);
-
+
// Find all active objects inside a radius around a point
std::set<u16> getObjectsInsideRadius(v3f pos, float radius);
-
+
// Clear all objects, loading and going through every MapBlock
void clearAllObjects();
-
+
// This makes stuff happen
void step(f32 dtime);
-
+
//check if there's a line of sight between two positions
bool line_of_sight(v3f pos1, v3f pos2, float stepsize=1.0, v3s16 *p=NULL);
void reportMaxLagEstimate(float f) { m_max_lag_estimate = f; }
float getMaxLagEstimate() { return m_max_lag_estimate; }
-
+
std::set<v3s16>* getForceloadedBlocks() { return &m_active_blocks.m_forceloaded_list; };
-
+
private:
/*
Returns 0 if not added and thus deleted.
*/
u16 addActiveObjectRaw(ServerActiveObject *object, bool set_changed, u32 dtime_s);
-
+
/*
Remove all objects that satisfy (m_removed && m_known_by_count==0)
*/
void removeRemovedObjects();
-
+
/*
Convert stored objects from block to active
*/
void activateObjects(MapBlock *block, u32 dtime_s);
-
+
/*
Convert objects that are not in active blocks to static.
/*
Member variables
*/
-
+
// The map
ServerMap *m_map;
// Lua state
{
ClientEnvEventType type;
union {
- struct{
- } none;
+ //struct{
+ //} none;
struct{
u8 amount;
bool send_to_server;
virtual void addPlayer(Player *player);
LocalPlayer * getLocalPlayer();
-
+
/*
ClientSimpleObjects
*/
/*
ActiveObjects
*/
-
+
ClientActiveObject* getActiveObject(u16 id);
/*
/*
Client likes to call these
*/
-
+
// Get all nearby objects
void getActiveObjects(v3f origin, f32 max_d,
std::vector<DistanceSortedActiveObject> &dest);
-
+
// Get event from queue. CEE_NONE is returned if queue is empty.
ClientEnvEvent getClientEvent();
{ m_camera_offset = camera_offset; }
v3s16 getCameraOffset()
{ return m_camera_offset; }
-
+
private:
ClientMap *m_map;
scene::ISceneManager *m_smgr;
{
float fps_max = g_settings->getFloat("fps_max");
// Time of frame without fps limit
- float busytime;
u32 busytime_u32;
+
// not using getRealTime is necessary for wine
u32 time = m_device->getTimer()->getTime();
if(time > m_cloud.lasttime)
busytime_u32 = time - m_cloud.lasttime;
else
busytime_u32 = 0;
- busytime = busytime_u32 / 1000.0;
// FPS limiter
u32 frametime_min = 1000./fps_max;
void *JThread::TheThread(void *param)
{
- JThread *jthread;
- void *ret;
-
- jthread = (JThread *)param;
+ JThread *jthread = (JThread *)param;
jthread->continuemutex2.Lock();
jthread->running = true;
jthread->continuemutex.Lock();
jthread->continuemutex.Unlock();
- ret = jthread->Thread();
+ jthread->Thread();
jthread->running = false;
v3f position = getPosition();
- v3f old_speed = m_speed;
-
// Copy parent position if local player is attached
if(isAttached)
{
/*
Collision detection
*/
-
+
bool is_valid_position;
MapNode node;
v3s16 pp;
v3f lwn_f = intToFloat(m_sneak_node, BS);
position.X = rangelim(position.X, lwn_f.X-maxd, lwn_f.X+maxd);
position.Z = rangelim(position.Z, lwn_f.Z-maxd, lwn_f.Z+maxd);
-
+
if(!is_climbing)
{
f32 min_y = lwn_f.Y + 0.5*BS;
#ifdef __ANDROID__
player_stepheight += (0.5 * BS);
#endif
-
+
v3f accel_f = v3f(0,0,0);
collisionMoveResult result = collisionMoveSimple(env, m_gamedef,
*/
bool touching_ground_was = touching_ground;
touching_ground = result.touching_ground;
-
+
//bool standing_on_unloaded = result.standing_on_unloaded;
/*
f32 max_axis_distance_f = MYMAX(
fabs(player_p2df.X-node_p2df.X),
fabs(player_p2df.Y-node_p2df.Y));
-
+
if(distance_f > min_distance_f ||
max_axis_distance_f > 0.5*BS + sneak_max + 0.1*BS)
continue;
min_distance_f = distance_f;
new_sneak_node = p;
}
-
+
bool sneak_node_found = (min_distance_f < 100000.0*BS*0.9);
m_sneak_node = new_sneak_node;
if(sneak_node_found && control.sneak)
touching_ground = true;
}
-
+
/*
Set new position
*/
setPosition(position);
-
+
/*
Report collisions
*/
*/
m_old_node_below = floatToInt(position - v3f(0,BS/2,0), BS);
m_old_node_below_type = nodemgr->get(map->getNodeNoEx(m_old_node_below)).name;
-
+
/*
Check properties of the node on which the player is standing
*/
v3f move_direction = v3f(0,0,1);
move_direction.rotateXZBy(getYaw());
-
+
v3f speedH = v3f(0,0,0); // Horizontal (X, Z)
v3f speedV = v3f(0,0,0); // Vertical (Y)
-
+
bool fly_allowed = m_gamedef->checkLocalPrivilege("fly");
bool fast_allowed = m_gamedef->checkLocalPrivilege("fast");
// Whether superspeed mode is used or not
bool superspeed = false;
-
+
if(g_settings->getBool("always_fly_fast") && free_move && fast_move)
superspeed = true;
// If free movement and fast movement, always move fast
if(free_move && fast_move)
superspeed = true;
-
+
// Auxiliary button 1 (E)
if(control.aux1)
{
{
speedJ.Y = movement_speed_jump * physics_override_jump;
setSpeed(speedJ);
-
+
MtEvent *e = new SimpleTriggerEvent("PlayerJump");
m_gamedef->event()->put(e);
}
{
DSTACK(__FUNCTION_NAME);
- MapSector *sector = NULL;
-
// The directory layout we're going to load from.
// 1 - original sectors/xxxxzzzz/
// 2 - new sectors2/xxx/zzz/
}
try{
- sector = loadSectorMeta(sectordir, loadlayout != 2);
+ loadSectorMeta(sectordir, loadlayout != 2);
}
catch(InvalidFilenameException &e)
{
data = NULL;
if(dummy == false)
reallocate();
-
+
#ifndef SERVER
mesh = NULL;
#endif
#ifndef SERVER
{
//JMutexAutoLock lock(mesh_mutex);
-
+
if(mesh)
{
delete mesh;
/*
Propagates sunlight down through the block.
Doesn't modify nodes that are not affected by sunlight.
-
+
Returns false if sunlight at bottom block is invalid.
Returns true if sunlight at bottom block is valid.
Returns true if bottom block doesn't exist.
// Whether the sunlight at the top of the bottom block is valid
bool block_below_is_valid = true;
-
+
v3s16 pos_relative = getPosRelative();
-
+
for(s16 x=0; x<MAP_BLOCKSIZE; x++)
{
for(s16 z=0; z<MAP_BLOCKSIZE; z++)
{
#if 1
bool no_sunlight = false;
- bool no_top_block = false;
+ //bool no_top_block = false;
// Check if node above block has sunlight
}
else
{
- no_top_block = true;
-
+ //no_top_block = true;
+
// NOTE: This makes over-ground roofed places sunlighted
// Assume sunlight, unless is_underground==true
if(is_underground)
<<", is_underground="<<is_underground
<<", no_sunlight="<<no_sunlight
<<std::endl;*/
-
+
s16 y = MAP_BLOCKSIZE-1;
-
+
// This makes difference to diminishing in water.
bool stopped_to_solid_object = false;
-
+
u8 current_light = no_sunlight ? 0 : LIGHT_SUN;
for(; y >= 0; y--)
{
v3s16 pos(x, y, z);
MapNode &n = getNodeRef(pos);
-
+
if(current_light == 0)
{
// Do nothing
{
// A solid object is on the way.
stopped_to_solid_object = true;
-
+
// Light stops.
current_light = 0;
}
{
n.setLight(LIGHTBANK_DAY, current_light, nodemgr);
}
-
+
if(diminish_light(current_light) != 0)
{
light_sources.insert(pos_relative + pos);
Check if the node below the block has proper sunlight at top.
If not, the block below is invalid.
-
+
Ignore non-transparent nodes as they always have no light
*/
{
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
VoxelArea data_area(v3s16(0,0,0), data_size - v3s16(1,1,1));
-
+
// Copy from data to VoxelManipulator
dst.copyFrom(data, data_area, v3s16(0,0,0),
getPosRelative(), data_size);
{
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
VoxelArea data_area(v3s16(0,0,0), data_size - v3s16(1,1,1));
-
+
// Copy from VoxelManipulator to data
dst.copyTo(data, data_area, v3s16(0,0,0),
getPosRelative(), data_size);
{
if(!ser_ver_supported(version))
throw VersionMismatchException("ERROR: MapBlock format not supported");
-
+
if(data == NULL)
{
throw SerializationError("ERROR: Not writing dummy block.");
}
-
+
// Can't do this anymore; we have 16-bit dynamically allocated node IDs
// in memory; conversion just won't work in this direction.
if(version < 24)
throw SerializationError("MapBlock::serialize: serialization to "
"version < 24 not possible");
-
+
// First byte
u8 flags = 0;
if(is_underground)
if(m_generated == false)
flags |= 0x08;
writeU8(os, flags);
-
+
/*
Bulk node data
*/
MapNode::serializeBulk(os, version, data, nodecount,
content_width, params_width, true);
}
-
+
/*
Node metadata
*/
// Write block-specific node definition id mapping
nimap.serialize(os);
-
+
if(version >= 25){
// Node timers
m_node_timers.serialize(os, version);
{
if(!ser_ver_supported(version))
throw VersionMismatchException("ERROR: MapBlock format not supported");
-
+
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())<<std::endl);
m_day_night_differs_expired = false;
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Static objects"<<std::endl);
m_static_objects.deSerialize(is);
-
+
// Timestamp
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Timestamp"<<std::endl);
setTimestamp(readU32(is));
m_disk_timestamp = m_timestamp;
-
+
// Dynamically re-set ids based on node names
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": NameIdMapping"<<std::endl);
m_node_timers.deSerialize(is, version);
}
}
-
+
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Done."<<std::endl);
}
databuf_nodelist[i*ser_length + 1] = s[i];
}
}
-
+
if(version >= 10)
{
// Uncompress and set param2 data
databuf_nodelist[i*ser_length + 1] = s[i+nodecount];
databuf_nodelist[i*ser_length + 2] = s[i+nodecount*2];
}
-
+
/*
NodeMetadata
*/
return "NULL";
std::ostringstream desc;
-
+
v3s16 p = block->getPos();
char spos[20];
snprintf(spos, 20, "(%2d,%2d,%2d), ", p.X, p.Y, p.Z);
desc<<spos;
-
+
switch(block->getModified())
{
case MOD_STATE_CLEAN:
else
full_air = false;
}
-
+
desc<<"content {";
-
+
std::ostringstream ss;
-
+
if(full_ignore)
ss<<"IGNORE (full), ";
else if(some_ignore)
ss<<"IGNORE, ";
-
+
if(full_air)
ss<<"AIR (full), ";
else if(some_air)
ss<<"AIR, ";
-
+
if(ss.str().size()>=2)
desc<<ss.str().substr(0, ss.str().size()-2);
{
//TimeTaker t("spreadLight");
VoxelArea a(nmin, nmax);
- v3s16 em = vm->m_area.getExtent();
for (int z = a.MinEdge.Z; z <= a.MaxEdge.Z; z++) {
for (int y = a.MinEdge.Y; y <= a.MaxEdge.Y; y++) {
this->ndef = data->nodedef;
// Hack: use minimum block coords for old code that assumes a single block
- v3s16 blockpos = data->blockpos_requested;
v3s16 blockpos_min = data->blockpos_min;
v3s16 blockpos_max = data->blockpos_max;
/******************************************************************************/
int ModApiMainMenu::l_get_video_drivers(lua_State *L)
{
- unsigned int index = 1;
- lua_newtable(L);
- int top = lua_gettop(L);
-
std::vector<irr::video::E_DRIVER_TYPE> drivers
= porting::getSupportedVideoDrivers();
#include "lua_api/l_base.h"
class INodeDefManager;
-class NodeResolveInfo;
+struct NodeResolveInfo;
class DecoSimple;
class DecoSchematic;