ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 04 00 00 00 04 00 08 03 00 00 00 48 c3 db | .PNG........IHDR.............H.. |
0020 | b1 00 00 00 4e 50 4c 54 45 00 00 00 ff ff ff de de de 8c 8c 8c f7 f7 f7 bd bd bd a5 a5 a5 63 63 | ....NPLTE.....................cc |
0040 | 63 ef ef ef 7b 7b 7b e7 e7 e7 ce ce ce d6 d6 d6 94 9c 94 ad b5 ad c6 c6 c6 f7 ff f7 bd c6 bd ef | c...{{{......................... |
0060 | f7 ef d6 de d6 e7 ef e7 ad ad ad b5 bd b5 c6 ce c6 de e7 de b5 b5 b5 46 01 57 84 00 00 00 01 74 | .......................F.W.....t |
0080 | 52 4e 53 00 40 e6 d8 66 00 01 07 7d 49 44 41 54 78 5e ec fd 89 76 e3 3a cc 35 0a 72 73 9e 24 7d | RNS.@..f...}IDATx^...v.:.5.rs.$} |
00a0 | ff 70 6f 77 bf ff 8b f6 32 20 2c 50 a1 15 c5 b1 ab 52 55 c7 38 a7 42 00 e2 3c 6c 53 b4 b4 6d fe | .pow....2.,P.....RU.8.B..<lS..m. |
00c0 | 32 79 cb 5b de 12 61 77 cd 22 de 82 8a 7a 0b 36 6c 06 c6 18 c0 00 1c 31 9e e7 f0 77 ca 5b de f2 | 2y.[..aw."...z.6l......1...w.[.. |
00e0 | 16 e7 1b 85 cd 3b 0a 5a 6a 37 07 08 02 06 00 f0 c9 5f e4 f0 05 81 f9 07 e4 2d 0d 8b 79 85 00 aa | .....;.Zj7......._.......-..y... |
0100 | fc 5b 02 fc 9a 36 2d 68 8f 55 03 b3 92 57 f3 1d f1 c9 3f de 01 5c ec 06 b3 a2 08 00 98 62 61 0b | .[...6-h.U...W....?..\.......ba. |
0120 | 47 8b 59 50 c6 24 6f 8d f5 e9 4b 38 e1 60 8d 59 32 f2 62 8c b3 54 88 eb 40 5d 77 25 73 2f ad 5c | G.YP.$o...K8.`.Y2.b../*
Minetest-c55
Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU 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 SERIALIZATION_HEADER
#define SERIALIZATION_HEADER
#include "common_irrlicht.h"
#include "exceptions.h"
#include <iostream>
#include "utility.h"
/*
NOTE: The goal is to increment this so that saved maps will be
loadable by any version. Other compatibility is not
maintained.
Serialization format versions:
== Unsupported ==
0: original networked test with 1-byte nodes
1: update with 2-byte nodes
== Supported ==
2: lighting is transmitted in param
3: optional fetching of far blocks
4: block compression
5: sector objects NOTE: block compression was left accidentally out
6: failed attempt at switching block compression on again
7: block compression switched on again
8: (dev) server-initiated block transfers and all kinds of stuff
9: (dev) block objects
10: (dev) water pressure
11: (dev) zlib'd blocks, block flags
12: (dev) UnlimitedHeightmap now uses interpolated areas
*/
// This represents an uninitialized or invalid format
#define SER_FMT_VER_INVALID 255
// Highest supported serialization version
#define SER_FMT_VER_HIGHEST 12
// Lowest supported serialization version
#define SER_FMT_VER_LOWEST 2
#define ser_ver_supported(v) (v >= SER_FMT_VER_LOWEST && v <= SER_FMT_VER_HIGHEST)
void compress(SharedBuffer<u8> data, std::ostream &os, u8 version);
void decompress(std::istream &is, std::ostream &os, u8 version);
/*class Serializable
{
public:
void serialize(std::ostream &os, u8 version) = 0;
void deSerialize(std::istream &istr);
};*/
#endif
|