aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-03-09 11:01:13 +0100
committersapier <Sapier at GMX dot net>2014-03-09 11:01:13 +0100
commit16a028dd6bae0c7c2e797489e12d17d719842f99 (patch)
tree69c52694fd074f08f8f4523c84203d6d10a3e6c0 /src/util
parent28d6326bd42a88d5a9245c70d7044d19e4d07954 (diff)
downloadminetest-16a028dd6bae0c7c2e797489e12d17d719842f99.tar.gz
minetest-16a028dd6bae0c7c2e797489e12d17d719842f99.tar.bz2
minetest-16a028dd6bae0c7c2e797489e12d17d719842f99.zip
Fix race condition on exit to menu
Diffstat (limited to 'src/util')
0 files changed, 0 insertions, 0 deletions
ublic License for more details. You should have received a copy of the GNU 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. */ #include "luaentity_common.h" #include "utility.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" LuaEntityProperties::LuaEntityProperties(): physical(true), weight(5), collisionbox(-0.5,-0.5,-0.5, 0.5,0.5,0.5), visual("single_sprite") { textures.push_back("unknown_object.png"); } std::string LuaEntityProperties::dump() { std::ostringstream os(std::ios::binary); os<<"physical="<<physical; os<<", weight="<<weight; os<<", collisionbox="<<PP(collisionbox.MinEdge)<<","<<PP(collisionbox.MaxEdge); os<<", visual="<<visual; os<<", textures=["; for(u32 i=0; i<textures.size(); i++){ os<<"\""<<textures[i]<<"\" "; } os<<"]"; return os.str(); } void LuaEntityProperties::serialize(std::ostream &os) { writeU8(os, 0); // version writeU8(os, physical); writeF1000(os, weight); writeV3F1000(os, collisionbox.MinEdge); writeV3F1000(os, collisionbox.MaxEdge); os<<serializeString(visual); writeU16(os, textures.size()); for(u32 i=0; i<textures.size(); i++){ os<<serializeString(textures[i]); } } void LuaEntityProperties::deSerialize(std::istream &is) { int version = readU8(is); if(version != 0) throw SerializationError( "unsupported LuaEntityProperties version"); physical = readU8(is); weight = readF1000(is); collisionbox.MinEdge = readV3F1000(is); collisionbox.MaxEdge = readV3F1000(is); visual = deSerializeString(is); textures.clear(); u32 texture_count = readU16(is); for(u32 i=0; i<texture_count; i++){ textures.push_back(deSerializeString(is)); } }