X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fstaticobject.h;h=575c15b18d9de747c9fbaf717cb30ce169d90a22;hb=00fc0babe0c6c5464fa9ffbc5a257b1e2aa93111;hp=c3369af3cd6b5b2724bdc1828e77e239e2457af2;hpb=89eaaa3e6e44acfb9b61569437c7c8cadeeec7a0;p=oweals%2Fminetest.git diff --git a/src/staticobject.h b/src/staticobject.h index c3369af3c..575c15b18 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -1,18 +1,18 @@ /* -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 General Public License as published by -the Free Software Foundation; either version 2 of the License, or +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 General Public License for more details. +GNU Lesser General Public License for more details. -You should have received a copy of the GNU General Public License along +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. */ @@ -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 "utility.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: };