diff options
Diffstat (limited to 'src/luaentity_common.cpp')
-rw-r--r-- | src/luaentity_common.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/luaentity_common.cpp b/src/luaentity_common.cpp index 503083d0b..cf1ac7bed 100644 --- a/src/luaentity_common.cpp +++ b/src/luaentity_common.cpp @@ -22,12 +22,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "utility.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" +#define PP2(x) "("<<(x).X<<","<<(x).Y<<")" LuaEntityProperties::LuaEntityProperties(): physical(false), weight(5), collisionbox(-0.5,-0.5,-0.5, 0.5,0.5,0.5), - visual("single_sprite") + visual("single_sprite"), + visual_size(1,1), + spritediv(1,1), + initial_sprite_basepos(0,0) { textures.push_back("unknown_object.png"); } @@ -39,11 +43,14 @@ std::string LuaEntityProperties::dump() os<<", weight="<<weight; os<<", collisionbox="<<PP(collisionbox.MinEdge)<<","<<PP(collisionbox.MaxEdge); os<<", visual="<<visual; + os<<", visual_size="<<PP2(visual_size); os<<", textures=["; for(u32 i=0; i<textures.size(); i++){ os<<"\""<<textures[i]<<"\" "; } os<<"]"; + os<<", spritediv="<<PP2(spritediv); + os<<", initial_sprite_basepos="<<PP2(initial_sprite_basepos); return os.str(); } @@ -55,10 +62,13 @@ void LuaEntityProperties::serialize(std::ostream &os) writeV3F1000(os, collisionbox.MinEdge); writeV3F1000(os, collisionbox.MaxEdge); os<<serializeString(visual); + writeV2F1000(os, visual_size); writeU16(os, textures.size()); for(u32 i=0; i<textures.size(); i++){ os<<serializeString(textures[i]); } + writeV2S16(os, spritediv); + writeV2S16(os, initial_sprite_basepos); } void LuaEntityProperties::deSerialize(std::istream &is) @@ -71,11 +81,14 @@ void LuaEntityProperties::deSerialize(std::istream &is) collisionbox.MinEdge = readV3F1000(is); collisionbox.MaxEdge = readV3F1000(is); visual = deSerializeString(is); + visual_size = readV2F1000(is); textures.clear(); u32 texture_count = readU16(is); for(u32 i=0; i<texture_count; i++){ textures.push_back(deSerializeString(is)); } + spritediv = readV2S16(is); + initial_sprite_basepos = readV2S16(is); } |