summaryrefslogtreecommitdiff
path: root/src/mg_schematic.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-05-08 00:05:08 -0400
committerkwolekr <kwolekr@minetest.net>2015-05-08 00:55:42 -0400
commit2dba29ebf20e95068872b758a9c16daeb4c74440 (patch)
tree67a202271b962916f43e4e110ce0a269865c8718 /src/mg_schematic.h
parent33c11415bf9f05192c104c4bb38f579824addfa5 (diff)
downloadminetest-2dba29ebf20e95068872b758a9c16daeb4c74440.tar.gz
minetest-2dba29ebf20e95068872b758a9c16daeb4c74440.tar.bz2
minetest-2dba29ebf20e95068872b758a9c16daeb4c74440.zip
Tests: Add schematic unittests
Improve schematic file-saving interface Add ability to create temporary test files
Diffstat (limited to 'src/mg_schematic.h')
-rw-r--r--src/mg_schematic.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/mg_schematic.h b/src/mg_schematic.h
index 5b546f879..3d3e328d3 100644
--- a/src/mg_schematic.h
+++ b/src/mg_schematic.h
@@ -85,26 +85,14 @@ enum SchematicFormatType {
class Schematic : public ObjDef, public NodeResolver {
public:
- std::vector<content_t> c_nodes;
-
- u32 flags;
- v3s16 size;
- MapNode *schemdata;
- u8 *slice_probs;
-
Schematic();
virtual ~Schematic();
virtual void resolveNodeNames();
- void updateContentIds();
-
- void blitToVManip(v3s16 p, MMVManip *vm,
- Rotation rot, bool force_placement);
-
bool loadSchematicFromFile(const std::string &filename, INodeDefManager *ndef,
- StringMap *replace_names);
- bool saveSchematicToFile(const std::string &filename);
+ StringMap *replace_names=NULL);
+ bool saveSchematicToFile(const std::string &filename, INodeDefManager *ndef);
bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2);
bool deserializeFromMts(std::istream *is, std::vector<std::string> *names);
@@ -112,11 +100,18 @@ public:
bool serializeToLua(std::ostream *os, const std::vector<std::string> &names,
bool use_comments, u32 indent_spaces);
- void placeStructure(Map *map, v3s16 p, u32 flags,
- Rotation rot, bool force_placement);
+ void blitToVManip(v3s16 p, MMVManip *vm, Rotation rot, bool force_place);
+ void placeStructure(Map *map, v3s16 p, u32 flags, Rotation rot, bool force_place);
+
void applyProbabilities(v3s16 p0,
std::vector<std::pair<v3s16, u8> > *plist,
std::vector<std::pair<s16, u8> > *splist);
+
+ std::vector<content_t> c_nodes;
+ u32 flags;
+ v3s16 size;
+ MapNode *schemdata;
+ u8 *slice_probs;
};
class SchematicManager : public ObjDefManager {