aboutsummaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorMuhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>2016-12-08 15:40:14 +0000
committerest31 <MTest31@outlook.com>2016-12-14 00:30:39 +0100
commit728909284a2ffa2decb543a9dea53a95e839bdcf (patch)
treec8488a1e37f53092da318df7a78c9da1f7001b18 /src/guiFormSpecMenu.cpp
parent47b1a118effc6d0d553cf572fc3b3706a2fa7832 (diff)
downloadminetest-728909284a2ffa2decb543a9dea53a95e839bdcf.tar.gz
minetest-728909284a2ffa2decb543a9dea53a95e839bdcf.tar.bz2
minetest-728909284a2ffa2decb543a9dea53a95e839bdcf.zip
Translated using Weblate (Indonesian)
Currently translated at 58.6% (538 of 918 strings) This is a merger of 2 commits.
Diffstat (limited to 'src/guiFormSpecMenu.cpp')
0 files changed, 0 insertions, 0 deletions
if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "staticobject.h" #include "util/serialize.h" #include "log.h" void StaticObject::serialize(std::ostream &os) { // type writeU8(os, type); // pos writeV3F1000(os, pos); // data os<<serializeString(data); } void StaticObject::deSerialize(std::istream &is, u8 version) { // type type = readU8(is); // pos pos = readV3F1000(is); // data data = deSerializeString(is); } void StaticObjectList::serialize(std::ostream &os) { // version u8 version = 0; writeU8(os, version); // count size_t count = m_stored.size() + m_active.size(); // Make sure it fits into u16, else it would get truncated and cause e.g. // issue #2610 (Invalid block data in database: unsupported NameIdMapping version). if (count > U16_MAX) { errorstream << "StaticObjectList::serialize(): " << "too many objects (" << count << ") in list, " << "not writing them to disk." << std::endl; writeU16(os, 0); // count = 0 return; } writeU16(os, count); for(std::vector<StaticObject>::iterator i = m_stored.begin(); i != m_stored.end(); ++i) { StaticObject &s_obj = *i; s_obj.serialize(os); } for(std::map<u16, StaticObject>::iterator i = m_active.begin(); i != m_active.end(); ++i) { StaticObject s_obj = i->second; s_obj.serialize(os); } } void StaticObjectList::deSerialize(std::istream &is) { // version