mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean nodefeat and content_mapnode a bit
This commit is contained in:
parent
9fc78cbece
commit
cde35d1606
3 changed files with 53 additions and 36 deletions
|
@ -27,7 +27,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "log.h"
|
||||
#include "settings.h"
|
||||
|
||||
void NodeBox::serialize(std::ostream &os)
|
||||
/*
|
||||
NodeBox
|
||||
*/
|
||||
|
||||
void NodeBox::serialize(std::ostream &os) const
|
||||
{
|
||||
writeU8(os, 0); // version
|
||||
writeU8(os, type);
|
||||
|
@ -57,7 +61,11 @@ void NodeBox::deSerialize(std::istream &is)
|
|||
wall_side.MaxEdge = readV3F1000(is);
|
||||
}
|
||||
|
||||
void MaterialSpec::serialize(std::ostream &os)
|
||||
/*
|
||||
MaterialSpec
|
||||
*/
|
||||
|
||||
void MaterialSpec::serialize(std::ostream &os) const
|
||||
{
|
||||
os<<serializeString(tname);
|
||||
writeU8(os, backface_culling);
|
||||
|
@ -69,6 +77,10 @@ void MaterialSpec::deSerialize(std::istream &is)
|
|||
backface_culling = readU8(is);
|
||||
}
|
||||
|
||||
/*
|
||||
ContentFeatures
|
||||
*/
|
||||
|
||||
ContentFeatures::ContentFeatures()
|
||||
{
|
||||
reset();
|
||||
|
@ -248,6 +260,20 @@ void ContentFeatures::setTexture(u16 i, std::string name)
|
|||
tname_inventory = name;
|
||||
}
|
||||
|
||||
void ContentFeatures::setAllTextures(std::string name)
|
||||
{
|
||||
for(u16 i=0; i<6; i++)
|
||||
setTexture(i, name);
|
||||
// Force inventory texture too
|
||||
setInventoryTexture(name);
|
||||
}
|
||||
|
||||
void ContentFeatures::setSpecialMaterial(u16 i, const MaterialSpec &mspec)
|
||||
{
|
||||
assert(i < CF_SPECIAL_COUNT);
|
||||
mspec_special[i] = mspec;
|
||||
}
|
||||
|
||||
void ContentFeatures::setInventoryTexture(std::string imgname)
|
||||
{
|
||||
tname_inventory = imgname + "^[forcesingle";
|
||||
|
@ -270,6 +296,10 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
|
|||
tname_inventory = imgname_full;
|
||||
}
|
||||
|
||||
/*
|
||||
CNodeDefManager
|
||||
*/
|
||||
|
||||
class CNodeDefManager: public IWritableNodeDefManager
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue