Skip to content

Commit

Permalink
Remove unused functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
onkrot authored and nerzhul committed Aug 16, 2015
1 parent ee6cad1 commit 5556ba1
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 44 deletions.
13 changes: 0 additions & 13 deletions src/content_mapnode.cpp
Expand Up @@ -233,16 +233,3 @@ std::string content_mapnode_get_new_name(const std::string &oldname)
{
return newnamegetter.get(oldname);
}

content_t legacy_get_id(const std::string &oldname, INodeDefManager *ndef)
{
std::string newname = content_mapnode_get_new_name(oldname);
if(newname == "")
return CONTENT_IGNORE;
content_t id;
bool found = ndef->getId(newname, id);
if(!found)
return CONTENT_IGNORE;
return id;
}

3 changes: 0 additions & 3 deletions src/content_mapnode.h
Expand Up @@ -37,8 +37,5 @@ void content_mapnode_get_name_id_mapping(NameIdMapping *nimap);
// Convert "CONTENT_STONE"-style names to dynamic ids
std::string content_mapnode_get_new_name(const std::string &oldname);
class INodeDefManager;
content_t legacy_get_id(const std::string &oldname, INodeDefManager *ndef);
#define LEGN(ndef, oldname) legacy_get_id(oldname, ndef)

#endif

24 changes: 0 additions & 24 deletions src/mapgen.cpp
Expand Up @@ -342,30 +342,6 @@ void Mapgen::spreadLight(v3s16 nmin, v3s16 nmax)



void Mapgen::calcLightingOld(v3s16 nmin, v3s16 nmax)
{
enum LightBank banks[2] = {LIGHTBANK_DAY, LIGHTBANK_NIGHT};
VoxelArea a(nmin, nmax);
bool block_is_underground = (water_level > nmax.Y);
bool sunlight = !block_is_underground;

ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);

for (int i = 0; i < 2; i++) {
enum LightBank bank = banks[i];
std::set<v3s16> light_sources;
std::map<v3s16, u8> unlight_from;

voxalgo::clearLightAndCollectSources(*vm, a, bank, ndef,
light_sources, unlight_from);
voxalgo::propagateSunlight(*vm, a, sunlight, light_sources, ndef);

vm->unspreadLight(bank, unlight_from, light_sources, ndef);
vm->spreadLight(bank, light_sources, ndef);
}
}


///////////////////////////////////////////////////////////////////////////////

GenerateNotifier::GenerateNotifier()
Expand Down
2 changes: 0 additions & 2 deletions src/mapgen.h
Expand Up @@ -179,8 +179,6 @@ class Mapgen {
void propagateSunlight(v3s16 nmin, v3s16 nmax);
void spreadLight(v3s16 nmin, v3s16 nmax);

void calcLightingOld(v3s16 nmin, v3s16 nmax);

virtual void makeChunk(BlockMakeData *data) {}
virtual int getGroundLevelAtPoint(v2s16 p) { return 0; }
};
Expand Down
2 changes: 0 additions & 2 deletions src/unittest/test_mapnode.cpp
Expand Up @@ -53,6 +53,4 @@ void TestMapNode::testNodeProperties(INodeDefManager *nodedef)
// Transparency
n.setContent(CONTENT_AIR);
UASSERT(nodedef->get(n).light_propagates == true);
n.setContent(LEGN(nodedef, "CONTENT_STONE"));
UASSERT(nodedef->get(n).light_propagates == false);
}

0 comments on commit 5556ba1

Please sign in to comment.