Moved mask to Style and mask related drawing to ValueViewer.

Used the same mask also for TextStyles.
To keep the text selectable (since the mask is now also used for containsPoint), the future sight cost masks needed to be updated.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1183 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-30 23:49:12 +00:00
parent a183ecc9a6
commit a2af3211a4
28 changed files with 105 additions and 214 deletions
+12 -2
View File
@@ -117,12 +117,22 @@ class CachedScriptableMask {
/// Update the script, returns true if the value has changed
bool update(Context& ctx);
inline void initDependencies(Context& ctx, const Dependency& dep) const {
script.initDependencies(ctx, dep);
}
/// Get the alpha mask; with the given options
/** if img_options.width == 0 and the mask is already loaded, just returns it. */
/** if img_options.width == 0 and the mask is already loaded, just returns it.
* Returns a reference, so calling again might change earlier results.
*/
const AlphaMask& get(const GeneratedImage::Options& img_options);
/// Get a mask that is not cached
void getNoCache(const GeneratedImage::Options& img_options, AlphaMask& mask);
void getNoCache(const GeneratedImage::Options& img_options, AlphaMask& mask) const;
/// Get the mask directly from the cache, without updating
/** Should only be used after get() was called before, otherwise an old mask might be returned */
inline const AlphaMask& getFromCache() const { return mask; }
private:
ScriptableImage script;