mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Added thread-safety to thumbnail request system.
Marked symbol requests as not being thread-safe. Added icon to symbol editor Made *.* actually register on * git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@407 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -45,6 +45,9 @@ class GeneratedImage : public ScriptValue {
|
||||
/// Equality should mean that every pixel in the generated images is the same if the same options are used
|
||||
virtual bool operator == (const GeneratedImage& that) const = 0;
|
||||
inline bool operator != (const GeneratedImage& that) const { return !(*this == that); }
|
||||
|
||||
/// Can this image be generated safely from another thread?
|
||||
virtual bool threadSafe() const = 0;
|
||||
|
||||
virtual ScriptType type() const;
|
||||
virtual String typeName() const;
|
||||
@@ -61,6 +64,8 @@ class LinearBlendImage : public GeneratedImage {
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual ImageCombine combine() const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
GeneratedImageP image1, image2;
|
||||
double x1, y1, x2, y2;
|
||||
@@ -77,6 +82,8 @@ class MaskedBlendImage : public GeneratedImage {
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual ImageCombine combine() const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
GeneratedImageP light, dark, mask;
|
||||
};
|
||||
@@ -92,6 +99,8 @@ class CombineBlendImage : public GeneratedImage {
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual ImageCombine combine() const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
GeneratedImageP image1, image2;
|
||||
ImageCombine image_combine;
|
||||
@@ -108,6 +117,8 @@ class SetMaskImage : public GeneratedImage {
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual ImageCombine combine() const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
GeneratedImageP image, mask;
|
||||
};
|
||||
@@ -123,6 +134,8 @@ class SetCombineImage : public GeneratedImage {
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual ImageCombine combine() const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
GeneratedImageP image;
|
||||
ImageCombine image_combine;
|
||||
@@ -138,6 +151,8 @@ class PackagedImage : public GeneratedImage {
|
||||
{}
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
String filename;
|
||||
};
|
||||
@@ -152,6 +167,8 @@ class BuiltInImage : public GeneratedImage {
|
||||
{}
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return true;}
|
||||
private:
|
||||
String name;
|
||||
};
|
||||
@@ -165,6 +182,8 @@ class SymbolToImage : public GeneratedImage {
|
||||
~SymbolToImage();
|
||||
virtual Image generate(const Options& opt) const;
|
||||
virtual bool operator == (const GeneratedImage& that) const;
|
||||
|
||||
virtual bool threadSafe() const {return false;}
|
||||
private:
|
||||
SymbolToImage(const SymbolToImage&); // copy ctor
|
||||
String filename;
|
||||
|
||||
Reference in New Issue
Block a user