Fixed mask for image fields, added mask support to slice window

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@243 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-29 18:27:05 +00:00
parent cb1c0a9afb
commit f025630b8b
7 changed files with 60 additions and 21 deletions
+3 -2
View File
@@ -177,7 +177,8 @@ ChoiceStyle::~ChoiceStyle() {
bool ChoiceStyle::update(Context& ctx) {
// Don't update the choice images, leave that to invalidate()
return Style::update(ctx);
return Style ::update(ctx)
| mask_filename.update(ctx);
}
void ChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const {
Style::initDependencies(ctx, dep);
@@ -199,7 +200,7 @@ void ChoiceStyle::invalidate() {
}
void ChoiceStyle::loadMask(Package& pkg) {
if (mask.Ok() || mask_filename.empty()) return;
if (mask.Ok() || mask_filename().empty()) return;
// load file
InputStreamP image_file = pkg.openIn(mask_filename);
mask.LoadFile(*image_file);
+12 -12
View File
@@ -121,18 +121,18 @@ class ChoiceStyle : public Style {
DECLARE_STYLE_TYPE(Choice);
~ChoiceStyle();
ChoicePopupStyle popup_style; ///< Style of popups/menus
ChoiceRenderStyle render_style; ///< Style of rendering
Font font; ///< Font for drawing text (when RENDER_TEXT)
map<String,ScriptableImage> choice_images; ///< Images for the various choices (when RENDER_IMAGE)
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
bool colors_card_list;///< Does this field determine colors of the rows in the card list?
String mask_filename; ///< Filename of an additional mask over the images
ImageCombine combine; ///< Combining mode for drawing the images
Alignment alignment; ///< Alignment of images
Image mask; ///< The actual mask image
wxImageList* thumbnails; ///< Thumbnails for the choices
Age thumbnail_age; ///< Age the thumbnails were generated
ChoicePopupStyle popup_style; ///< Style of popups/menus
ChoiceRenderStyle render_style; ///< Style of rendering
Font font; ///< Font for drawing text (when RENDER_TEXT)
map<String,ScriptableImage> choice_images; ///< Images for the various choices (when RENDER_IMAGE)
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
bool colors_card_list; ///< Does this field determine colors of the rows in the card list?
Scriptable<String> mask_filename; ///< Filename of an additional mask over the images
ImageCombine combine; ///< Combining mode for drawing the images
Alignment alignment; ///< Alignment of images
Image mask; ///< The actual mask image
wxImageList* thumbnails; ///< Thumbnails for the choices
Age thumbnail_age; ///< Age the thumbnails were generated
bool invalidated_images; ///< Have the images been invalidated?
/// Load the mask image, if it's not already done
+4
View File
@@ -28,6 +28,10 @@ IMPLEMENT_REFLECTION(ImageStyle) {
REFLECT_N("mask", mask_filename);
}
bool ImageStyle::update(Context& ctx) {
return Style ::update(ctx)
| mask_filename.update(ctx);
}
// ----------------------------------------------------------------------------- : ImageValue
+2
View File
@@ -39,6 +39,8 @@ class ImageStyle : public Style {
Scriptable<String> mask_filename; ///< Filename for a mask image
virtual bool update(Context&);
private:
DECLARE_REFLECTION();
};