mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 20:06:02 +02:00
Add alwaysEnabled render::Job::Config
This commit is contained in:
parent
b70108bb9a
commit
75cddec647
2 changed files with 7 additions and 3 deletions
|
@ -44,6 +44,7 @@ public:
|
||||||
class ToneMappingConfig : public render::Job::Config {
|
class ToneMappingConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
ToneMappingConfig() : render::Job::Config(true) {}
|
||||||
Q_PROPERTY(float exposure MEMBER exposure NOTIFY dirty);
|
Q_PROPERTY(float exposure MEMBER exposure NOTIFY dirty);
|
||||||
Q_PROPERTY(int curve MEMBER curve NOTIFY dirty);
|
Q_PROPERTY(int curve MEMBER curve NOTIFY dirty);
|
||||||
float exposure{ 0.0 };
|
float exposure{ 0.0 };
|
||||||
|
|
|
@ -53,13 +53,15 @@ protected:
|
||||||
std::shared_ptr<Concept> _concept;
|
std::shared_ptr<Concept> _concept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// A default Config is always on; to create an enableable Config, use the ctor JobConfig(bool enabled)
|
||||||
class JobConfig : public QObject {
|
class JobConfig : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
JobConfig() : enabled{ true } {}
|
JobConfig() : alwaysEnabled{ true }, enabled{ true } {}
|
||||||
JobConfig(bool enabled) : enabled{ enabled } {}
|
JobConfig(bool enabled) : alwaysEnabled{ false }, enabled{ enabled } {}
|
||||||
|
|
||||||
Q_PROPERTY(bool enabled MEMBER enabled)
|
Q_PROPERTY(bool enabled MEMBER enabled)
|
||||||
|
bool alwaysEnabled{ true };
|
||||||
bool enabled;
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,7 +128,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
|
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
|
||||||
if (std::static_pointer_cast<Job::Config>(_config)->enabled) {
|
std::shared_ptr<Job::Config>& config = std::static_pointer_cast<Job::Config>(_config);
|
||||||
|
if (config->alwaysEnabled || config->enabled) {
|
||||||
jobRun(_data, sceneContext, renderContext);
|
jobRun(_data, sceneContext, renderContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue