mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Header file tweaking; mainly for speed
This commit is contained in:
parent
b60b58b627
commit
9e46cbf7ea
37 changed files with 1198 additions and 946 deletions
|
@ -19,7 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
#include "common_irrlicht.h"
|
||||
#include "mapnode.h"
|
||||
#ifndef SERVER
|
||||
#include "tile.h"
|
||||
#endif
|
||||
#include "porting.h"
|
||||
#include <string>
|
||||
#include "mineral.h"
|
||||
|
@ -31,10 +33,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
ContentFeatures::~ContentFeatures()
|
||||
{
|
||||
delete initial_metadata;
|
||||
#ifndef SERVER
|
||||
delete special_material;
|
||||
delete special_atlas;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef SERVER
|
||||
void ContentFeatures::setTexture(u16 i, std::string name, u8 alpha)
|
||||
{
|
||||
if(g_texturesource)
|
||||
|
@ -81,6 +86,7 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
|
|||
imgname_full += right;
|
||||
inventory_texture = g_texturesource->getTextureRaw(imgname_full);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct ContentFeatures g_content_features[MAX_CONTENT+1];
|
||||
|
||||
|
@ -118,7 +124,8 @@ void init_mapnode()
|
|||
/*
|
||||
Initialize content feature table
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SERVER
|
||||
/*
|
||||
Set initial material type to same in all tiles, so that the
|
||||
same material can be used in more stuff.
|
||||
|
@ -140,6 +147,7 @@ void init_mapnode()
|
|||
for(u16 j=0; j<6; j++)
|
||||
f->tiles[j].material_type = initial_material_type;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
Initially set every block to be shown as an unknown block.
|
||||
|
@ -184,6 +192,7 @@ v3s16 facedir_rotate(u8 facedir, v3s16 dir)
|
|||
return newdir;
|
||||
}
|
||||
|
||||
#ifndef SERVER
|
||||
TileSpec MapNode::getTile(v3s16 dir)
|
||||
{
|
||||
if(content_features(*this).param_type == CPT_FACEDIR_SIMPLE)
|
||||
|
@ -235,6 +244,7 @@ TileSpec MapNode::getTile(v3s16 dir)
|
|||
|
||||
return spec;
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 MapNode::getMineral()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue