589 changes: 0 additions & 589 deletions src/client/mesh.cpp

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions src/client/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,3 @@ void recalculateBoundingBox(scene::IMesh *src_mesh);
We assume normal to be valid when it's 0 < length < Inf. and not NaN
*/
bool checkMeshNormals(scene::IMesh *mesh);

/*
Vertex cache optimization according to the Forsyth paper:
http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
Ported from irrlicht 1.8
*/
scene::IMesh* createForsythOptimizedMesh(const scene::IMesh *mesh);
25 changes: 0 additions & 25 deletions src/clientiface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,31 +714,6 @@ void ClientInterface::sendToAll(NetworkPacket *pkt)
}
}

void ClientInterface::sendToAllCompat(NetworkPacket *pkt, NetworkPacket *legacypkt,
u16 min_proto_ver)
{
RecursiveMutexAutoLock clientslock(m_clients_mutex);
for (auto &client_it : m_clients) {
RemoteClient *client = client_it.second;
NetworkPacket *pkt_to_send = nullptr;

if (client->net_proto_version >= min_proto_ver) {
pkt_to_send = pkt;
} else if (client->net_proto_version != 0) {
pkt_to_send = legacypkt;
} else {
warningstream << "Client with unhandled version to handle: '"
<< client->net_proto_version << "'";
continue;
}

m_con->Send(client->peer_id,
clientCommandFactoryTable[pkt_to_send->getCommand()].channel,
pkt_to_send,
clientCommandFactoryTable[pkt_to_send->getCommand()].reliable);
}
}

RemoteClient* ClientInterface::getClientNoEx(session_t peer_id, ClientState state_min)
{
RecursiveMutexAutoLock clientslock(m_clients_mutex);
Expand Down
1 change: 0 additions & 1 deletion src/clientiface.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ class ClientInterface {

/* send to all clients */
void sendToAll(NetworkPacket *pkt);
void sendToAllCompat(NetworkPacket *pkt, NetworkPacket *legacypkt, u16 min_proto_ver);

/* delete a client */
void DeleteClient(session_t peer_id);
Expand Down
17 changes: 0 additions & 17 deletions src/emerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,6 @@ bool EmergeManager::isBlockInQueue(v3s16 pos)
//


// TODO(hmmmm): Move this to ServerMap
v3s16 EmergeManager::getContainingChunk(v3s16 blockpos)
{
return getContainingChunk(blockpos, mgparams->chunksize);
}

// TODO(hmmmm): Move this to ServerMap
v3s16 EmergeManager::getContainingChunk(v3s16 blockpos, s16 chunksize)
{
Expand All @@ -396,17 +390,6 @@ int EmergeManager::getSpawnLevelAtPoint(v2s16 p)
}


int EmergeManager::getGroundLevelAtPoint(v2s16 p)
{
if (m_mapgens.empty() || !m_mapgens[0]) {
errorstream << "EmergeManager: getGroundLevelAtPoint() called"
" before mapgen init" << std::endl;
return 0;
}

return m_mapgens[0]->getGroundLevelAtPoint(p);
}

// TODO(hmmmm): Move this to ServerMap
bool EmergeManager::isBlockUnderground(v3s16 blockpos)
{
Expand Down
3 changes: 0 additions & 3 deletions src/emerge.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,10 @@ class EmergeManager {

bool isBlockInQueue(v3s16 pos);

v3s16 getContainingChunk(v3s16 blockpos);

Mapgen *getCurrentMapgen();

// Mapgen helpers methods
int getSpawnLevelAtPoint(v2s16 p);
int getGroundLevelAtPoint(v2s16 p);
bool isBlockUnderground(v3s16 blockpos);

static v3s16 getContainingChunk(v3s16 blockpos, s16 chunksize);
Expand Down
5 changes: 0 additions & 5 deletions src/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,6 @@ u32 InventoryList::getUsedSlots() const
return num;
}

u32 InventoryList::getFreeSlots() const
{
return getSize() - getUsedSlots();
}

const ItemStack& InventoryList::getItem(u32 i) const
{
assert(i < m_size); // Pre-condition
Expand Down
1 change: 0 additions & 1 deletion src/inventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class InventoryList
u32 getWidth() const;
// Count used slots
u32 getUsedSlots() const;
u32 getFreeSlots() const;

// Get reference to item
const ItemStack& getItem(u32 i) const;
Expand Down
7 changes: 0 additions & 7 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ MapBlock * Map::getBlockNoCreate(v3s16 p3d)
return block;
}

bool Map::isNodeUnderground(v3s16 p)
{
v3s16 blockpos = getNodeBlockPos(p);
MapBlock *block = getBlockNoCreateNoEx(blockpos);
return block && block->getIsUnderground();
}

bool Map::isValidPosition(v3s16 p)
{
v3s16 blockpos = getNodeBlockPos(p);
Expand Down
3 changes: 0 additions & 3 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ class Map /*: public NodeContainer*/

inline const NodeDefManager * getNodeDefManager() { return m_nodedef; }

// Returns InvalidPositionException if not found
bool isNodeUnderground(v3s16 p);

bool isValidPosition(v3s16 p);

// throws InvalidPositionException if not found
Expand Down
25 changes: 0 additions & 25 deletions src/mapblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,31 +218,6 @@ void MapBlock::expireDayNightDiff()
m_day_night_differs_expired = true;
}

s16 MapBlock::getGroundLevel(v2s16 p2d)
{
if(isDummy())
return -3;
try
{
s16 y = MAP_BLOCKSIZE-1;
for(; y>=0; y--)
{
MapNode n = getNodeRef(p2d.X, y, p2d.Y);
if (m_gamedef->ndef()->get(n).walkable) {
if(y == MAP_BLOCKSIZE-1)
return -2;

return y;
}
}
return -1;
}
catch(InvalidPositionException &e)
{
return -3;
}
}

/*
Serialization
*/
Expand Down
14 changes: 0 additions & 14 deletions src/mapblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,20 +363,6 @@ class MapBlock
return m_day_night_differs;
}

////
//// Miscellaneous stuff
////

/*
Tries to measure ground level.
Return value:
-1 = only air
-2 = only ground
-3 = random fail
0...MAP_BLOCKSIZE-1 = ground level
*/
s16 getGroundLevel(v2s16 p2d);

////
//// Timestamp (see m_timestamp)
////
Expand Down
13 changes: 0 additions & 13 deletions src/mapgen/mapgen_v6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,19 +360,6 @@ int MapgenV6::getSpawnLevelAtPoint(v2s16 p)

//////////////////////// Noise functions

float MapgenV6::getMudAmount(v2s16 p)
{
int index = (p.Y - node_min.Z) * ystride + (p.X - node_min.X);
return getMudAmount(index);
}


bool MapgenV6::getHaveBeach(v2s16 p)
{
int index = (p.Y - node_min.Z) * ystride + (p.X - node_min.X);
return getHaveBeach(index);
}


BiomeV6Type MapgenV6::getBiome(v2s16 p)
{
Expand Down
4 changes: 1 addition & 3 deletions src/mapgen/mapgen_v6.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ class MapgenV6 : public Mapgen {
float getHumidity(v2s16 p);
float getTreeAmount(v2s16 p);
bool getHaveAppleTree(v2s16 p);
float getMudAmount(v2s16 p);
virtual float getMudAmount(int index);
bool getHaveBeach(v2s16 p);
float getMudAmount(int index);
bool getHaveBeach(int index);
BiomeV6Type getBiome(v2s16 p);
BiomeV6Type getBiome(int index, v2s16 p);
Expand Down
45 changes: 0 additions & 45 deletions src/noise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,51 +312,6 @@ float noise2d_perlin(float x, float y, s32 seed,
}


float noise2d_perlin_abs(float x, float y, s32 seed,
int octaves, float persistence, bool eased)
{
float a = 0;
float f = 1.0;
float g = 1.0;
for (int i = 0; i < octaves; i++) {
a += g * std::fabs(noise2d_gradient(x * f, y * f, seed + i, eased));
f *= 2.0;
g *= persistence;
}
return a;
}


float noise3d_perlin(float x, float y, float z, s32 seed,
int octaves, float persistence, bool eased)
{
float a = 0;
float f = 1.0;
float g = 1.0;
for (int i = 0; i < octaves; i++) {
a += g * noise3d_gradient(x * f, y * f, z * f, seed + i, eased);
f *= 2.0;
g *= persistence;
}
return a;
}


float noise3d_perlin_abs(float x, float y, float z, s32 seed,
int octaves, float persistence, bool eased)
{
float a = 0;
float f = 1.0;
float g = 1.0;
for (int i = 0; i < octaves; i++) {
a += g * std::fabs(noise3d_gradient(x * f, y * f, z * f, seed + i, eased));
f *= 2.0;
g *= persistence;
}
return a;
}


float contour(float v)
{
v = std::fabs(v);
Expand Down
9 changes: 0 additions & 9 deletions src/noise.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,6 @@ float noise3d_gradient(float x, float y, float z, s32 seed, bool eased=false);
float noise2d_perlin(float x, float y, s32 seed,
int octaves, float persistence, bool eased=true);

float noise2d_perlin_abs(float x, float y, s32 seed,
int octaves, float persistence, bool eased=true);

float noise3d_perlin(float x, float y, float z, s32 seed,
int octaves, float persistence, bool eased=false);

float noise3d_perlin_abs(float x, float y, float z, s32 seed,
int octaves, float persistence, bool eased=false);

inline float easeCurve(float t)
{
return t * t * t * (t * (6.f * t - 15.f) + 10.f);
Expand Down
6 changes: 0 additions & 6 deletions src/rollback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,6 @@ void RollbackManager::addAction(const RollbackAction & action)
}
}

std::list<RollbackAction> RollbackManager::getEntriesSince(time_t first_time)
{
flush();
return getActionsSince(first_time);
}

std::list<RollbackAction> RollbackManager::getNodeActors(v3s16 pos, int range,
time_t seconds, int limit)
{
Expand Down
1 change: 0 additions & 1 deletion src/rollback.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class RollbackManager: public IRollbackManager
void flush();

void addAction(const RollbackAction & action);
std::list<RollbackAction> getEntriesSince(time_t first_time);
std::list<RollbackAction> getNodeActors(v3s16 pos, int range,
time_t seconds, int limit);
std::list<RollbackAction> getRevertActions(
Expand Down
13 changes: 0 additions & 13 deletions src/script/lua_api/l_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,19 +421,6 @@ void InvRef::create(lua_State *L, const InventoryLocation &loc)
luaL_getmetatable(L, className);
lua_setmetatable(L, -2);
}
void InvRef::createPlayer(lua_State *L, RemotePlayer *player)
{
NO_MAP_LOCK_REQUIRED;
InventoryLocation loc;
loc.setPlayer(player->getName());
create(L, loc);
}
void InvRef::createNodeMeta(lua_State *L, v3s16 p)
{
InventoryLocation loc;
loc.setNodeMeta(p);
create(L, loc);
}

void InvRef::Register(lua_State *L)
{
Expand Down
2 changes: 0 additions & 2 deletions src/script/lua_api/l_inventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ class InvRef : public ModApiBase {
// Creates an InvRef and leaves it on top of stack
// Not callable from Lua; all references are created on the C side.
static void create(lua_State *L, const InventoryLocation &loc);
static void createPlayer(lua_State *L, RemotePlayer *player);
static void createNodeMeta(lua_State *L, v3s16 p);
static void Register(lua_State *L);
};

Expand Down
5 changes: 4 additions & 1 deletion src/script/lua_api/l_nodemeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ int NodeMetaRef::l_get_inventory(lua_State *L)

NodeMetaRef *ref = checkobject(L, 1);
ref->getmeta(true); // try to ensure the metadata exists
InvRef::createNodeMeta(L, ref->m_p);

InventoryLocation loc;
loc.setNodeMeta(ref->m_p);
InvRef::create(L, loc);
return 1;
}

Expand Down
3 changes: 1 addition & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ Settings *Settings::createLayer(SettingsLayer sl, const std::string &end_tag)

Settings *Settings::getLayer(SettingsLayer sl)
{
sanity_check((int)sl >= 0 && sl < SL_TOTAL_COUNT);
return g_hierarchy.layers[(int)sl];
return g_hierarchy.getLayer(sl);
}


Expand Down