From: Carlos Lopez Date: Sat, 21 Aug 2010 11:04:11 +0000 (+0200) Subject: Make bitmap layer parameters to be able set static X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e44a07877e3a2e5f0e25db2fc2d67582e50ca327;p=synfig.git Make bitmap layer parameters to be able set static --- diff --git a/synfig-core/src/synfig/layer_bitmap.cpp b/synfig-core/src/synfig/layer_bitmap.cpp index 8443429..7338078 100644 --- a/synfig-core/src/synfig/layer_bitmap.cpp +++ b/synfig-core/src/synfig/layer_bitmap.cpp @@ -67,7 +67,11 @@ synfig::Layer_Bitmap::Layer_Bitmap(): c (1), surface (128,128), trimmed (false), - gamma_adjust (1.0) + gamma_adjust (1.0), + tl_static (false), + br_static (false), + c_static (true), + gamma_adjust_static(false) { } @@ -521,3 +525,29 @@ Layer_Bitmap::get_bounding_rect()const { return Rect(tl,br); } + + +bool +Layer_Bitmap::set_param_static(const String ¶m, const bool x) +{ + + SET_STATIC(tl, x) + SET_STATIC(br, x) + SET_STATIC(c, x) + SET_STATIC(gamma_adjust, x) + + return Layer_Composite::set_param_static(param, x); +} + + +bool +Layer_Bitmap::get_param_static(const String ¶m) const +{ + + GET_STATIC(tl) + GET_STATIC(br) + GET_STATIC(c) + GET_STATIC(gamma_adjust) + + return Layer_Composite::get_param_static(param); +} diff --git a/synfig-core/src/synfig/layer_bitmap.h b/synfig-core/src/synfig/layer_bitmap.h index b62a93e..7578f8c 100644 --- a/synfig-core/src/synfig/layer_bitmap.h +++ b/synfig-core/src/synfig/layer_bitmap.h @@ -50,11 +50,15 @@ public: Point tl; Point br; int c; + bool tl_static; + bool br_static; + bool c_static; mutable Surface surface; mutable bool trimmed; mutable unsigned int width, height, top, left; Real gamma_adjust; + bool gamma_adjust_static; Layer_Bitmap(); @@ -62,6 +66,9 @@ public: virtual ValueBase get_param(const String & param)const; + virtual bool set_param_static(const String ¶m, const bool x); + virtual bool get_param_static(const String ¶m) const; + virtual Color get_color(Context context, const Point &pos)const; virtual Vocab get_param_vocab()const;