mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 07:43:57 +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 {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ToneMappingConfig() : render::Job::Config(true) {}
|
||||
Q_PROPERTY(float exposure MEMBER exposure NOTIFY dirty);
|
||||
Q_PROPERTY(int curve MEMBER curve NOTIFY dirty);
|
||||
float exposure{ 0.0 };
|
||||
|
|
|
@ -53,13 +53,15 @@ protected:
|
|||
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 {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JobConfig() : enabled{ true } {}
|
||||
JobConfig(bool enabled) : enabled{ enabled } {}
|
||||
JobConfig() : alwaysEnabled{ true }, enabled{ true } {}
|
||||
JobConfig(bool enabled) : alwaysEnabled{ false }, enabled{ enabled } {}
|
||||
|
||||
Q_PROPERTY(bool enabled MEMBER enabled)
|
||||
bool alwaysEnabled{ true };
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
|
@ -126,7 +128,8 @@ public:
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue