From f10f7bbeb7f782c09c290e2474df2dcedd9a2820 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Fri, 27 Aug 2004 20:34:01 +0000 Subject: [PATCH 1/1] Added a mask to be applied to a sprite. TODO: put that inside a filter. SVN-Revision: 1849 --- lib/special/sprite.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/special/sprite.cpp b/lib/special/sprite.cpp index c6a3289a8..4525cfbde 100644 --- a/lib/special/sprite.cpp +++ b/lib/special/sprite.cpp @@ -79,15 +79,32 @@ Sprite::parse_action(LispReader& lispreader) if(!lispreader.read_string_vector("images", images)) Termination::abort("Sprite contains no images: ", action->name.c_str()); - for(std::vector::size_type i = 0; i < images.size(); ++i) + for(std::vector::size_type i = 0; i < images.size(); i++) { action->surfaces.push_back( new Surface(datadir + "/images/" + images[i], true)); - } + } + + // TODO: add a top filter entry + std::vector mask_color; + lispreader.read_int_vector("apply-mask", mask_color); + if(mask_color.size() == 4) + { + for(std::vector::iterator i = action->surfaces.begin(); + i < action->surfaces.end(); i++) + { + (*i)->apply_mask(Color(mask_color)); + } + } actions[action->name] = action; } +/*void Sprite::parse_filter(LispReader& lispreader) +{ + +}*/ + void Sprite::init_defaults(Action* act) { -- 2.11.0