123 changes: 59 additions & 64 deletions src/drawscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ video::ITexture* draw_image(const v2u32& screensize,
image = images[1];
else
image = images[0];

driver->setRenderTarget(image, true, true,
irr::video::SColor(255,
skycolor.getRed(), skycolor.getGreen(), skycolor.getBlue()));
Expand Down Expand Up @@ -421,79 +421,74 @@ void draw_scene(video::IVideoDriver* driver, scene::ISceneManager* smgr,
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);
}

/*
Expand Down
48 changes: 24 additions & 24 deletions src/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Environment
Player * getNearestConnectedPlayer(v3f pos);
std::list<Player*> getPlayers();
std::list<Player*> getPlayers(bool ignore_disconnected);

u32 getDayNightRatio();

// 0-23999
Expand All @@ -96,7 +96,7 @@ class Environment
void stepTimeOfDay(float dtime);

void setTimeOfDaySpeed(float speed);

float getTimeOfDaySpeed();

void setDayNightRatioOverride(bool enable, u32 value)
Expand Down Expand Up @@ -132,7 +132,7 @@ class Environment
* a later release.
*/
bool m_cache_enable_shaders;

private:
JMutex m_lock;

Expand All @@ -150,7 +150,7 @@ class ActiveBlockModifier
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)
Expand Down Expand Up @@ -255,7 +255,7 @@ class ServerEnvironment : public Environment
Returns 0 if not added and thus deleted.
*/
u16 addActiveObject(ServerActiveObject *object);

/*
Add an active object as a static object to the corresponding
MapBlock.
Expand All @@ -264,7 +264,7 @@ class ServerEnvironment : public Environment
(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
Expand All @@ -282,7 +282,7 @@ class ServerEnvironment : public Environment
s16 player_radius,
std::set<u16> &current_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.
Expand Down Expand Up @@ -311,26 +311,26 @@ class ServerEnvironment : public Environment
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);

u32 getGameTime() { return m_game_time; }

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:

/*
Expand All @@ -349,17 +349,17 @@ class ServerEnvironment : public Environment
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.
Expand All @@ -374,7 +374,7 @@ class ServerEnvironment : public Environment
/*
Member variables
*/

// The map
ServerMap *m_map;
// Lua state
Expand Down Expand Up @@ -433,8 +433,8 @@ struct ClientEnvEvent
{
ClientEnvEventType type;
union {
struct{
} none;
//struct{
//} none;
struct{
u8 amount;
bool send_to_server;
Expand Down Expand Up @@ -463,7 +463,7 @@ class ClientEnvironment : public Environment

virtual void addPlayer(Player *player);
LocalPlayer * getLocalPlayer();

/*
ClientSimpleObjects
*/
Expand All @@ -473,7 +473,7 @@ class ClientEnvironment : public Environment
/*
ActiveObjects
*/

ClientActiveObject* getActiveObject(u16 id);

/*
Expand Down Expand Up @@ -501,11 +501,11 @@ class ClientEnvironment : public Environment
/*
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();

Expand All @@ -521,7 +521,7 @@ class ClientEnvironment : public Environment
{ m_camera_offset = camera_offset; }
v3s16 getCameraOffset()
{ return m_camera_offset; }

private:
ClientMap *m_map;
scene::ISceneManager *m_smgr;
Expand Down
3 changes: 1 addition & 2 deletions src/guiEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,14 @@ void GUIEngine::cloudPostProcess()
{
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;
Expand Down
7 changes: 2 additions & 5 deletions src/jthread/pthread/jthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,15 @@ bool JThread::IsSameThread()

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;

Expand Down
30 changes: 14 additions & 16 deletions src/localplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,

v3f position = getPosition();

v3f old_speed = m_speed;

// Copy parent position if local player is attached
if(isAttached)
{
Expand All @@ -100,7 +98,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
/*
Collision detection
*/

bool is_valid_position;
MapNode node;
v3s16 pp;
Expand Down Expand Up @@ -191,7 +189,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
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;
Expand All @@ -211,7 +209,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
#ifdef __ANDROID__
player_stepheight += (0.5 * BS);
#endif

v3f accel_f = v3f(0,0,0);

collisionMoveResult result = collisionMoveSimple(env, m_gamedef,
Expand All @@ -226,7 +224,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
*/
bool touching_ground_was = touching_ground;
touching_ground = result.touching_ground;

//bool standing_on_unloaded = result.standing_on_unloaded;

/*
Expand Down Expand Up @@ -277,7 +275,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
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;
Expand All @@ -301,7 +299,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
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;
Expand All @@ -314,12 +312,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
if(sneak_node_found && control.sneak)
touching_ground = true;
}

/*
Set new position
*/
setPosition(position);

/*
Report collisions
*/
Expand Down Expand Up @@ -367,7 +365,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
*/
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
*/
Expand Down Expand Up @@ -400,10 +398,10 @@ void LocalPlayer::applyControl(float dtime)

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");

Expand All @@ -415,7 +413,7 @@ void LocalPlayer::applyControl(float dtime)

// Whether superspeed mode is used or not
bool superspeed = false;

if(g_settings->getBool("always_fly_fast") && free_move && fast_move)
superspeed = true;

Expand All @@ -425,7 +423,7 @@ void LocalPlayer::applyControl(float dtime)
// If free movement and fast movement, always move fast
if(free_move && fast_move)
superspeed = true;

// Auxiliary button 1 (E)
if(control.aux1)
{
Expand Down Expand Up @@ -548,7 +546,7 @@ void LocalPlayer::applyControl(float dtime)
{
speedJ.Y = movement_speed_jump * physics_override_jump;
setSpeed(speedJ);

MtEvent *e = new SimpleTriggerEvent("PlayerJump");
m_gamedef->event()->put(e);
}
Expand Down
4 changes: 1 addition & 3 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3220,8 +3220,6 @@ bool ServerMap::loadSectorMeta(v2s16 p2d)
{
DSTACK(__FUNCTION_NAME);

MapSector *sector = NULL;

// The directory layout we're going to load from.
// 1 - original sectors/xxxxzzzz/
// 2 - new sectors2/xxx/zzz/
Expand All @@ -3241,7 +3239,7 @@ bool ServerMap::loadSectorMeta(v2s16 p2d)
}

try{
sector = loadSectorMeta(sectordir, loadlayout != 2);
loadSectorMeta(sectordir, loadlayout != 2);
}
catch(InvalidFilenameException &e)
{
Expand Down
72 changes: 36 additions & 36 deletions src/mapblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy):
data = NULL;
if(dummy == false)
reallocate();

#ifndef SERVER
mesh = NULL;
#endif
Expand All @@ -73,7 +73,7 @@ MapBlock::~MapBlock()
#ifndef SERVER
{
//JMutexAutoLock lock(mesh_mutex);

if(mesh)
{
delete mesh;
Expand Down Expand Up @@ -115,7 +115,7 @@ MapNode MapBlock::getNodeParent(v3s16 p, bool *is_valid_position)
/*
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.
Expand All @@ -138,16 +138,16 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,

// 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

Expand All @@ -168,8 +168,8 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,
}
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)
Expand Down Expand Up @@ -211,19 +211,19 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,
<<", 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
Expand All @@ -236,7 +236,7 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,
{
// A solid object is on the way.
stopped_to_solid_object = true;

// Light stops.
current_light = 0;
}
Expand All @@ -252,7 +252,7 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,
{
n.setLight(LIGHTBANK_DAY, current_light, nodemgr);
}

if(diminish_light(current_light) != 0)
{
light_sources.insert(pos_relative + pos);
Expand All @@ -275,7 +275,7 @@ bool MapBlock::propagateSunlight(std::set<v3s16> & light_sources,
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
*/

Expand Down Expand Up @@ -311,7 +311,7 @@ void MapBlock::copyTo(VoxelManipulator &dst)
{
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);
Expand All @@ -321,7 +321,7 @@ void MapBlock::copyFrom(VoxelManipulator &dst)
{
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);
Expand Down Expand Up @@ -520,18 +520,18 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
{
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)
Expand All @@ -543,7 +543,7 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
if(m_generated == false)
flags |= 0x08;
writeU8(os, flags);

/*
Bulk node data
*/
Expand Down Expand Up @@ -573,7 +573,7 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
MapNode::serializeBulk(os, version, data, nodecount,
content_width, params_width, true);
}

/*
Node metadata
*/
Expand All @@ -599,7 +599,7 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)

// Write block-specific node definition id mapping
nimap.serialize(os);

if(version >= 25){
// Node timers
m_node_timers.serialize(os, version);
Expand All @@ -626,7 +626,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
{
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;
Expand Down Expand Up @@ -702,13 +702,13 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
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);
Expand All @@ -722,7 +722,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
m_node_timers.deSerialize(is, version);
}
}

TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Done."<<std::endl);
}
Expand Down Expand Up @@ -809,7 +809,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
databuf_nodelist[i*ser_length + 1] = s[i];
}
}

if(version >= 10)
{
// Uncompress and set param2 data
Expand Down Expand Up @@ -852,7 +852,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
databuf_nodelist[i*ser_length + 1] = s[i+nodecount];
databuf_nodelist[i*ser_length + 2] = s[i+nodecount*2];
}

/*
NodeMetadata
*/
Expand Down Expand Up @@ -989,12 +989,12 @@ std::string analyze_block(MapBlock *block)
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:
Expand Down Expand Up @@ -1051,21 +1051,21 @@ std::string analyze_block(MapBlock *block)
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);

Expand Down
1 change: 0 additions & 1 deletion src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ void Mapgen::spreadLight(v3s16 nmin, v3s16 nmax)
{
//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++) {
Expand Down
1 change: 0 additions & 1 deletion src/mapgen_v6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ void MapgenV6::makeChunk(BlockMakeData *data)
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;

Expand Down
4 changes: 0 additions & 4 deletions src/script/lua_api/l_mainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,6 @@ int ModApiMainMenu::l_download_file(lua_State *L)
/******************************************************************************/
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();

Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_mapgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_base.h"

class INodeDefManager;
class NodeResolveInfo;
struct NodeResolveInfo;
class DecoSimple;
class DecoSchematic;

Expand Down