summaryrefslogtreecommitdiff
path: root/src/object_properties.cpp
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2012-10-27 01:49:01 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 18:14:15 +0200
commite42eeec8f626acbaa54ae31c10ca06c868c7931c (patch)
tree61ea64416548b5ad858c6d275da90ace607fd163 /src/object_properties.cpp
parent118285e6babd511c285780b07c275d527d7da9b1 (diff)
downloadminetest-e42eeec8f626acbaa54ae31c10ca06c868c7931c.tar.gz
minetest-e42eeec8f626acbaa54ae31c10ca06c868c7931c.tar.bz2
minetest-e42eeec8f626acbaa54ae31c10ca06c868c7931c.zip
Framework for the attachment system, new object property which allows changing the color and alpha of mesh materials
New object property which allows changing the color and alpha of mesh materials. Due to the current lighting systems it doesn't work yet, but the full implementation is there Framework for the attachment system, with no actual functionality yet Send bone and player object to the setAttachment function in content_sao.cpp, but we need a way to translate it there and send it to the client I will also want position and rotation offsets to be possible to apply to attachments Network object ID from server to client. This will be used to identify the parent client-side and know what to attach to
Diffstat (limited to 'src/object_properties.cpp')
-rw-r--r--src/object_properties.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/object_properties.cpp b/src/object_properties.cpp
index 57e255f58..79b3eaf72 100644
--- a/src/object_properties.cpp
+++ b/src/object_properties.cpp
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "object_properties.h"
+#include "irrlichttypes_bloated.h"
#include "util/serialize.h"
#include <sstream>
#include <map>
@@ -40,6 +41,7 @@ ObjectProperties::ObjectProperties():
automatic_rotate(0)
{
textures.push_back("unknown_object.png");
+ colors.push_back(video::SColor(255,255,255,255));
}
std::string ObjectProperties::dump()
@@ -57,6 +59,11 @@ std::string ObjectProperties::dump()
os<<"\""<<textures[i]<<"\" ";
}
os<<"]";
+ os<<", colors=[";
+ for(u32 i=0; i<colors.size(); i++){
+ os<<"\""<<colors[i].getAlpha()<<","<<colors[i].getRed()<<","<<colors[i].getGreen()<<","<<colors[i].getBlue()<<"\" ";
+ }
+ os<<"]";
os<<", spritediv="<<PP2(spritediv);
os<<", initial_sprite_basepos="<<PP2(initial_sprite_basepos);
os<<", is_visible="<<is_visible;
@@ -80,6 +87,10 @@ void ObjectProperties::serialize(std::ostream &os) const
for(u32 i=0; i<textures.size(); i++){
os<<serializeString(textures[i]);
}
+ writeU16(os, colors.size());
+ for(u32 i=0; i<colors.size(); i++){
+ writeARGB8(os, colors[i]);
+ }
writeV2S16(os, spritediv);
writeV2S16(os, initial_sprite_basepos);
writeU8(os, is_visible);
@@ -105,6 +116,10 @@ void ObjectProperties::deSerialize(std::istream &is)
for(u32 i=0; i<texture_count; i++){
textures.push_back(deSerializeString(is));
}
+ u32 color_count = readU16(is);
+ for(u32 i=0; i<color_count; i++){
+ colors.push_back(readARGB8(is));
+ }
spritediv = readV2S16(is);
initial_sprite_basepos = readV2S16(is);
is_visible = readU8(is);