LocalPlayer::accelerateHorizontal: cleanups
[oweals/minetest.git] / src / object_properties.cpp
index 3cec51672a99713e3b31513910b983930414e55e..af442806b11749267b972e1aed61911236c040b8 100644 (file)
@@ -21,31 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes_bloated.h"
 #include "exceptions.h"
 #include "util/serialize.h"
+#include "util/basic_macros.h"
 #include <sstream>
 
-#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
-#define PP2(x) "("<<(x).X<<","<<(x).Y<<")"
-
-ObjectProperties::ObjectProperties():
-       hp_max(1),
-       physical(false),
-       collideWithObjects(true),
-       weight(5),
-       collisionbox(-0.5,-0.5,-0.5, 0.5,0.5,0.5),
-       visual("sprite"),
-       mesh(""),
-       visual_size(1,1),
-       spritediv(1,1),
-       initial_sprite_basepos(0,0),
-       is_visible(true),
-       makes_footstep_sound(false),
-       automatic_rotate(0),
-       stepheight(0),
-       automatic_face_movement_dir(false),
-       automatic_face_movement_dir_offset(0.0),
-       backface_culling(true),
-       nametag(""),
-       nametag_color(255, 255, 255, 255)
+ObjectProperties::ObjectProperties()
 {
        textures.push_back("unknown_object.png");
        colors.push_back(video::SColor(255,255,255,255));
@@ -116,6 +95,10 @@ void ObjectProperties::serialize(std::ostream &os) const
        writeU8(os, backface_culling);
        os << serializeString(nametag);
        writeARGB8(os, nametag_color);
+       writeF1000(os, automatic_face_movement_max_rotation_per_sec);
+       os << serializeString(infotext);
+       os << serializeString(wield_item);
+
        // Add stuff only at the bottom.
        // Never remove anything, because we don't want new versions of this
 }
@@ -155,6 +138,9 @@ void ObjectProperties::deSerialize(std::istream &is)
                        backface_culling = readU8(is);
                        nametag = deSerializeString(is);
                        nametag_color = readARGB8(is);
+                       automatic_face_movement_max_rotation_per_sec = readF1000(is);
+                       infotext = deSerializeString(is);
+                       wield_item = deSerializeString(is);
                }catch(SerializationError &e){}
        }
        else