X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fstaticobject.h;h=575c15b18d9de747c9fbaf717cb30ce169d90a22;hb=00fc0babe0c6c5464fa9ffbc5a257b1e2aa93111;hp=a55471b7f8753bc73ce9ed15baaf2b3f12974730;hpb=d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d;p=oweals%2Fminetest.git diff --git a/src/staticobject.h b/src/staticobject.h index a55471b7f..575c15b18 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2010-2011 celeron55, Perttu Ahola +Minetest +Copyright (C) 2010-2013 celeron55, Perttu Ahola 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 @@ -20,10 +20,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef STATICOBJECT_HEADER #define STATICOBJECT_HEADER -#include "common_irrlicht.h" +#include "irrlichttypes_bloated.h" #include #include -#include "util/serialize.h" +#include +#include +#include "debug.h" struct StaticObject { @@ -43,33 +45,8 @@ struct StaticObject { } - void serialize(std::ostream &os) - { - char buf[12]; - // type - buf[0] = type; - os.write(buf, 1); - // pos - writeV3S32((u8*)buf, v3s32(pos.X*1000,pos.Y*1000,pos.Z*1000)); - os.write(buf, 12); - // data - os<::Iterator - i = m_stored.begin(); - i != m_stored.end(); i++) - { - StaticObject &s_obj = *i; - s_obj.serialize(os); - } - for(core::map::Iterator - i = m_active.getIterator(); - i.atEnd()==false; i++) - { - StaticObject s_obj = i.getNode()->getValue(); - s_obj.serialize(os); - } - } - void deSerialize(std::istream &is) - { - char buf[12]; - // version - is.read(buf, 1); - u8 version = buf[0]; - // count - is.read(buf, 2); - u16 count = readU16((u8*)buf); - for(u16 i=0; i m_stored; - core::map m_active; + std::list m_stored; + std::map m_active; private: };