ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 02 00 00 00 02 00 08 03 00 00 00 c3 a6 24 | .PNG........IHDR...............$ |
0020 | c8 00 00 00 3f 50 4c 54 45 00 00 00 de de de ff ff ff bd bd bd ce ce ce e7 e7 e7 63 63 63 a5 a5 | ....?PLTE..................ccc.. |
0040 | a5 8c 8c 8c f7 f7 f7 c6 c6 c6 7b 7b 7b ef ef ef d6 d6 d6 ad b5 ad 94 9c 94 bd c6 bd de e7 de b5 | ..........{{{................... |
0060 | b5 b5 ef f7 ef e7 ef e7 19 07 11 e2 00 00 00 01 74 52 4e 53 00 40 e6 d8 66 00 00 71 da 49 44 41 | ................tRNS.@..f..q.IDA |
0080 | 54 78 5e ec bd 8b 72 e4 b8 ae 25 ba 00 f0 fd 3c 33 73 ff ff 5b 6f 08 84 92 a1 4c d9 59 ae 76 77 | Tx^...r...%....<3s..[o....L.Y.vw |
00a0 | f5 de c7 28 0b 5c 82 f8 26 82 69 af 82 92 f8 35 09 04 0a f8 df 25 cc 3b 7d 15 be bb 71 06 78 6b | ...(.\..&.i....5.....%.;}...q.xk |
00c0 | b6 84 f1 7d e2 19 0c f6 f8 4e d1 2a 2f 03 12 16 6b 0c 0c 17 11 9d 3e 78 95 e4 31 73 9e 3a 46 e6 | ...}.....N.*/...k.....>x..1s.:F. |
00e0 | 1c 0f 55 80 a8 b7 cc a8 9e 79 a1 c2 5c 10 8f bc f7 c2 ec 4e 48 a4 a5 07 2a 69 69 5f 57 15 bb 46 | ..U......y..\......NH...*ii_W..F |
0100 | 06 f4 16 80 de 15 3a a7 5c 84 c1 02 3e bb 95 e3 03 0d 20 66 ad c6 2a 68 29 35 2d c6 a0 18 09 24 | ......:.\...>......f..*h)5-....$ |
0120 | 10 b2 a6 60 4e cf 80 f7 30 89 e5 ce 01 ee d3 ab 37 7c 9f b0 fd 3c 37 2f bc 90 0d 62 ad dd ce c7 | ...`N...0.......7|...<7/...b.... |
0140 | fe bd 03 d4 2e 11 92 75 fc 89 cf ca 19 19 40 86 14 2e f2 32 18 17 e1 53 f2 66 ae 87 0e 0c 34 36 | .......u......@....2...S.f....46 |
0160 | 0b 45 cd 36 09 39 84 8c 5c eb 9e 4d 43 5e b3 4c 2d 57 38 47 2c 6f 42 65 f4 d5 e0 f0 78 74 07 34 | .E.6.9..\..MC^.L-W8G,oBe....xt.4 |
0180 | 9e 66 81 c1 b3 9d 4f b9 77 06 37 f0 ea 16 a3 e6 07 da 25 ec a7 8f d1 41 09 89 90 5a 4b a8 39 e5 | .f....O.w.7.......%....A...ZK.9. |
01a0 | 0a a0 77 b0 ad b6 fa 7f 74 d8 f2 77 3a 00 7f d9 01 76 39 0e 0b d7 1c 72 05 23 57 bb 27 a6 0a e2 | ..w.....t..w:....v9....r.#W.'... |
01c0 | 5d 62 9b af ed ca 72 fd c9 8a bd 8b a8 1c 1f d5 df 3b 40 c8 00 d3 a3 47 ea 09 2c 88 c4 07 68 11 | ]b....r..........;@....G..,...h. |
01e0 | ec 59 00 f4 88 c1 3c c0 b5 f2 ca ed fc 08 d0 16 c3 f0 0e a8 b9 0d 48 47 6d 07 ac 6b e9 f8 1c b1 | .Y....<...............HGm..k.... |
0200 | 21 53 2f 0e 90 c7 e3 41 ce 0c a6 68 ad 68 2d 1b a1 f5 b4 4b 43 9c 13 90 63 47 6b d7 81 63 07 60 | !S/....A...h.h-....KC...cGk..c.` |
0220 | e6 55 99 bf 5d 13 66 07 26 16 cc c6 0c 61 62 c4 cc 05 cc 8c c8 9e c1 c4 0e 8f cd a9 e6 68 33 e8 | .U..].f.&....ab..............h3. |
0240 | 7d a6 f5 30 e6 1c b5 8e 55 fc 28 54 74 ee f7 de 34 67 43 0b 08 0d ae 77 07 1f a3 b7 c7 4e ab 73 | }..0....U.(Tt...4gC....w.....N.s |
0260 | 0c 13 6d de 26 83 1a 81 b9 69 2d 3d 8f bd 23 c0 7b 06 1c 9c 56 b2 cd 57 c7 f3 b5 01 92 39 0f c4 | ..m.&....i-=..#.{...V..W.....9.. |
0280 | e2 59 d0 c4 33 80 6c d7 1a 93 55 b0 b4 c8 9e 4e 20 aa d7 d5 8c 96 96 3f 64 5d f1 55 3c d7 9a 21 | .Y..3.l...U....N.......?d].U<..! |
02a0 | ec ad 31 75 00 95 e5 00 98 0c e4 e0 32 63 10 0d 30 73 d9 8b ad ed 9a c2 89 b6 03 f4 bd 03 b/*
Minetest
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MG_SCHEMATIC_HEADER
#define MG_SCHEMATIC_HEADER
#include <map>
#include "mg_decoration.h"
#include "util/string.h"
class Map;
class Mapgen;
class MMVManip |
3 - Added y-slice probabilities; this allows for variable height structures
4 - Compressed range of node occurence prob., added per-node force placement bit
*/
//// Schematic constants
#define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM'
#define MTSCHEM_FILE_VER_HIGHEST_READ 4
#define MTSCHEM_FILE_VER_HIGHEST_WRITE 4
#define MTSCHEM_PROB_MASK 0x7F
#define MTSCHEM_PROB_NEVER 0x00
#define MTSCHEM_PROB_ALWAYS 0x7F
#define MTSCHEM_PROB_ALWAYS_OLD 0xFF
#define MTSCHEM_FORCE_PLACE 0x80
enum SchematicType
{
SCHEMATIC_NORMAL,
};
enum SchematicFormatType {
SCHEM_FMT_HANDLE,
SCHEM_FMT_MTS,
SCHEM_FMT_LUA,
};
class Schematic : public ObjDef, public NodeResolver {
public:
Schematic();
virtual ~Schematic();
virtual void resolveNodeNames();
bool loadSchematicFromFile(const std::string &filename, INodeDefManager *ndef,
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);
bool serializeToMts(std::ostream *os, const std::vector<std::string> &names);
bool serializeToLua(std::ostream *os, const std::vector<
07e0 | 87 9c a1 8b 06 d7 01 16 a3 dc 0c 01 8a 6c 5c a1 99 c5 b1 28 30 8e 91 d9 10 31 19 8a d1 c5 fd bb | .............l\....(0....1...... |
0800 | 13 2c c6 50 ab 36 68 46 ed bc e5 2c 11 8a d4 b4 4b 6f 1b d8 4c 06 9c 81 3d 95 9b 58 64 4b 40 4c | .,.P.6hF...,....Ko..L...=..XdK@L |
0820 | 86 bc 87 21 ed 9e a2 3d 37 ab 27 c6 88 42 e4 84 cc d6 b7 3d bb f7 88 c6 2f a1 ed 00 b6 96 17 6f | ...!...=7.'..B.....=..../......o |
0840 | 90 bd 88 9f a4 06 af d6 d9 f0 de 01 dc 89 ec 47 71 9d 9a a1 25 70 b3 dc b7 88 92 59 2a b2 82 cd | ...............Gq...%p.....Y*... |
0860 | 31 de a2 16 78 f7 a6 f2 05 3e 23 e0 3d 32 c8 af e0 c6 01 80 5f 46 16 e8 a8 62 8c e8 05 f6 0e 95 | 1...x....>#.=2......_F...b...... |
0880 | cd 0a
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 {
public:
SchematicManager(IGameDef *gamedef);
virtual ~SchematicManager() {}
virtual void clear();
const char *getObjectTitle() const
{
return "schematic";
}
static Schematic *create(SchematicType type)
{
return new Schematic;
}
private:
IGameDef *m_gamedef;
};
void generate_nodelist_and_update_ids(MapNode *nodes, size_t nodecount,
std::vector<std::string> *usednodes, INodeDefManager *ndef);
#endif
|