projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Node highlighting.
[oweals/minetest.git]
/
src
/
object_properties.cpp
diff --git
a/src/object_properties.cpp
b/src/object_properties.cpp
index 6086bf09f7e29d6fbccf01abfcf5a25330ff981d..f560f59343a6d6507e6993d8b2aaacb43c84b2af 100644
(file)
--- a/
src/object_properties.cpp
+++ b/
src/object_properties.cpp
@@
-19,9
+19,9
@@
with this program; if not, write to the Free Software Foundation, Inc.,
#include "object_properties.h"
#include "irrlichttypes_bloated.h"
#include "object_properties.h"
#include "irrlichttypes_bloated.h"
+#include "exceptions.h"
#include "util/serialize.h"
#include <sstream>
#include "util/serialize.h"
#include <sstream>
-#include <map>
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
#define PP2(x) "("<<(x).X<<","<<(x).Y<<")"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
#define PP2(x) "("<<(x).X<<","<<(x).Y<<")"
@@
-29,6
+29,7
@@
with this program; if not, write to the Free Software Foundation, Inc.,
ObjectProperties::ObjectProperties():
hp_max(1),
physical(false),
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"),
weight(5),
collisionbox(-0.5,-0.5,-0.5, 0.5,0.5,0.5),
visual("sprite"),
@@
-38,7
+39,10
@@
ObjectProperties::ObjectProperties():
initial_sprite_basepos(0,0),
is_visible(true),
makes_footstep_sound(false),
initial_sprite_basepos(0,0),
is_visible(true),
makes_footstep_sound(false),
- automatic_rotate(0)
+ automatic_rotate(0),
+ stepheight(0),
+ automatic_face_movement_dir(false),
+ automatic_face_movement_dir_offset(0.0)
{
textures.push_back("unknown_object.png");
colors.push_back(video::SColor(255,255,255,255));
{
textures.push_back("unknown_object.png");
colors.push_back(video::SColor(255,255,255,255));
@@
-49,6
+53,7
@@
std::string ObjectProperties::dump()
std::ostringstream os(std::ios::binary);
os<<"hp_max="<<hp_max;
os<<", physical="<<physical;
std::ostringstream os(std::ios::binary);
os<<"hp_max="<<hp_max;
os<<", physical="<<physical;
+ os<<", collideWithObjects="<<collideWithObjects;
os<<", weight="<<weight;
os<<", collisionbox="<<PP(collisionbox.MinEdge)<<","<<PP(collisionbox.MaxEdge);
os<<", visual="<<visual;
os<<", weight="<<weight;
os<<", collisionbox="<<PP(collisionbox.MinEdge)<<","<<PP(collisionbox.MaxEdge);
os<<", visual="<<visual;
@@
-97,6
+102,10
@@
void ObjectProperties::serialize(std::ostream &os) const
for(u32 i=0; i<colors.size(); i++){
writeARGB8(os, colors[i]);
}
for(u32 i=0; i<colors.size(); i++){
writeARGB8(os, colors[i]);
}
+ writeU8(os, collideWithObjects);
+ writeF1000(os,stepheight);
+ writeU8(os, automatic_face_movement_dir);
+ writeF1000(os, automatic_face_movement_dir_offset);
// Add stuff only at the bottom.
// Never remove anything, because we don't want new versions of this
}
// Add stuff only at the bottom.
// Never remove anything, because we don't want new versions of this
}
@@
-129,6
+138,10
@@
void ObjectProperties::deSerialize(std::istream &is)
for(u32 i=0; i<color_count; i++){
colors.push_back(readARGB8(is));
}
for(u32 i=0; i<color_count; i++){
colors.push_back(readARGB8(is));
}
+ collideWithObjects = readU8(is);
+ stepheight = readF1000(is);
+ automatic_face_movement_dir = readU8(is);
+ automatic_face_movement_dir_offset = readF1000(is);
}catch(SerializationError &e){}
}
else
}catch(SerializationError &e){}
}
else