mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 05:46:48 +08:00
chore: cleanup old Core stuff + update shader constant to use user settings as they should
This commit is contained in:
parent
2eefc7ff64
commit
806b65b490
@ -407,15 +407,6 @@ add_executable(
|
||||
src/WallpaperEngine/Core/DynamicValues/CDynamicValue.cpp
|
||||
src/WallpaperEngine/Core/DynamicValues/CDynamicValue.h
|
||||
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingValue.cpp
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingValue.h
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingBoolean.cpp
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingBoolean.h
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingVector3.cpp
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingVector3.h
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingFloat.cpp
|
||||
src/WallpaperEngine/Core/UserSettings/CUserSettingFloat.h
|
||||
|
||||
src/WallpaperEngine/Core/Projects/CProperty.h
|
||||
src/WallpaperEngine/Core/Projects/CProperty.cpp
|
||||
src/WallpaperEngine/Core/Projects/CPropertyColor.h
|
||||
@ -429,48 +420,6 @@ add_executable(
|
||||
src/WallpaperEngine/Core/Projects/CPropertyText.h
|
||||
src/WallpaperEngine/Core/Projects/CPropertyText.cpp
|
||||
|
||||
# src/WallpaperEngine/Core/Objects/CParticle.cpp
|
||||
# src/WallpaperEngine/Core/Objects/CParticle.h
|
||||
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.cpp
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.h
|
||||
src/WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.cpp
|
||||
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CControlPoint.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CControlPoint.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CEmitter.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CEmitter.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CInitializer.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/CInitializer.h
|
||||
#
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CLifeTimeRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CLifeTimeRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CSizeRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CSizeRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CRotationRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CRotationRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CVelocityRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CVelocityRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CColorRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CColorRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CAlphaRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CAlphaRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CAngularVelocityRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CAngularVelocityRandom.h
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CTurbulentVelocityRandom.cpp
|
||||
# src/WallpaperEngine/Core/Objects/Particles/Initializers/CTurbulentVelocityRandom.h
|
||||
|
||||
src/WallpaperEngine/Data/Model/Types.h
|
||||
src/WallpaperEngine/Data/Model/Project.h
|
||||
src/WallpaperEngine/Data/Model/Wallpaper.h
|
||||
|
@ -1,12 +1,8 @@
|
||||
#include "Core.h"
|
||||
|
||||
#include "WallpaperEngine/Core/UserSettings/CUserSettingBoolean.h"
|
||||
#include "WallpaperEngine/Core/UserSettings/CUserSettingFloat.h"
|
||||
#include "WallpaperEngine/Core/UserSettings/CUserSettingVector3.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine;
|
||||
using namespace WallpaperEngine::Core::UserSettings;
|
||||
|
||||
glm::vec4 Core::aToVector4 (const char* str) {
|
||||
float x = strtof (str, const_cast<char**> (&str));
|
||||
|
@ -215,4 +215,29 @@ const bool& CDynamicValue::getBool () const {
|
||||
|
||||
CDynamicValue::UnderlyingType CDynamicValue::getType () const {
|
||||
return this->m_type;
|
||||
}
|
||||
|
||||
std::string CDynamicValue::toString () const {
|
||||
switch (this->m_type) {
|
||||
case UnderlyingType::Float:
|
||||
return std::to_string (this->m_float);
|
||||
case UnderlyingType::Int:
|
||||
return std::to_string (this->m_int);
|
||||
case UnderlyingType::Boolean:
|
||||
return std::to_string (this->m_bool);
|
||||
case UnderlyingType::Vec2:
|
||||
return std::to_string (this->m_vec2.x) + ", " + std::to_string (this->m_vec2.y);
|
||||
case UnderlyingType::Vec3:
|
||||
return std::to_string (this->m_vec3.x) + ", " + std::to_string (this->m_vec3.y) + ", " + std::to_string (this->m_vec3.z);
|
||||
case UnderlyingType::Vec4:
|
||||
return std::to_string (this->m_vec4.x) + ", " + std::to_string (this->m_vec4.y) + ", " + std::to_string (this->m_vec4.z) + ", " + std::to_string (this->m_vec4.w);
|
||||
case UnderlyingType::IVec2:
|
||||
return std::to_string (this->m_ivec2.x) + ", " + std::to_string (this->m_ivec2.y);
|
||||
case UnderlyingType::IVec3:
|
||||
return std::to_string (this->m_ivec3.x) + ", " + std::to_string (this->m_ivec3.y) + ", " + std::to_string (this->m_ivec3.z);
|
||||
case UnderlyingType::IVec4:
|
||||
return std::to_string (this->m_ivec4.x) + ", " + std::to_string (this->m_ivec4.y) + ", " + std::to_string (this->m_ivec4.z) + ", " + std::to_string (this->m_ivec4.w);
|
||||
default:
|
||||
return "Unknown conversion for dynamic value of type: " + std::to_string (static_cast<int> (this->m_type));
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@ class CDynamicValue {
|
||||
[[nodiscard]] const int& getInt () const;
|
||||
[[nodiscard]] const bool& getBool () const;
|
||||
[[nodiscard]] UnderlyingType getType () const;
|
||||
[[nodiscard]] std::string toString () const;
|
||||
|
||||
/**
|
||||
* Connects the current instance to the given instance, updating it's values
|
||||
|
@ -1,73 +0,0 @@
|
||||
#include "CParticle.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects;
|
||||
|
||||
const CParticle* CParticle::fromFile (
|
||||
std::shared_ptr <const Core::CProject> project, const std::string& filename,
|
||||
const std::shared_ptr<const CContainer>& container, const CUserSettingBoolean* visible, int id,
|
||||
const std::string& name, const CUserSettingVector3* origin, const CUserSettingVector3* angles,
|
||||
const CUserSettingVector3* scale, std::vector<int> dependencies
|
||||
) {
|
||||
json data = json::parse (container->readFileAsString (filename));
|
||||
const auto controlpoint_it = data.find ("controlpoint");
|
||||
const auto emitter_it = jsonFindRequired (data, "emitter", "Particles must have emitters");
|
||||
const auto initializer_it = jsonFindRequired (data, "initializer", "Particles must have initializers");
|
||||
|
||||
std::vector<const Particles::CControlPoint*> controlpoints;
|
||||
std::vector<const Particles::CEmitter*> emitters;
|
||||
std::vector<const Particles::CInitializer*> initializers;
|
||||
|
||||
if (controlpoint_it != data.end ())
|
||||
for (const auto& cur : (*controlpoint_it))
|
||||
controlpoints.push_back (Particles::CControlPoint::fromJSON (cur));
|
||||
|
||||
for (const auto& cur : (*emitter_it))
|
||||
emitters.push_back (Particles::CEmitter::fromJSON (cur));
|
||||
for (const auto& cur : (*initializer_it))
|
||||
initializers.push_back (Particles::CInitializer::fromJSON (cur));
|
||||
|
||||
return new CParticle (
|
||||
project,
|
||||
jsonFindRequired <uint32_t> (data, "starttime", "Particles must have start time"),
|
||||
jsonFindRequired <uint32_t> (data, "maxcount", "Particles must have maximum count"),
|
||||
visible,
|
||||
id,
|
||||
name,
|
||||
origin,
|
||||
scale,
|
||||
angles,
|
||||
controlpoints,
|
||||
emitters,
|
||||
initializers,
|
||||
std::move(dependencies)
|
||||
);
|
||||
}
|
||||
|
||||
CParticle::CParticle (
|
||||
std::shared_ptr <const Core::CProject> project, uint32_t starttime, uint32_t maxcount,
|
||||
const CUserSettingBoolean* visible, int id, const std::string& name, const CUserSettingVector3* origin,
|
||||
const CUserSettingVector3* scale, const CUserSettingVector3* angles,
|
||||
const std::vector<const Particles::CControlPoint*>& controlpoints,
|
||||
const std::vector<const Particles::CEmitter*>& emitters,
|
||||
const std::vector<const Particles::CInitializer*>& initializers, std::vector<int> dependencies
|
||||
) :
|
||||
CObject (project, visible, id, name, origin, scale, angles, std::move(dependencies)),
|
||||
m_starttime (starttime),
|
||||
m_maxcount (maxcount),
|
||||
m_controlpoints (controlpoints),
|
||||
m_emitters (emitters),
|
||||
m_initializers (initializers) {}
|
||||
|
||||
const std::vector<const Particles::CEmitter*>& CParticle::getEmitters () const {
|
||||
return this->m_emitters;
|
||||
}
|
||||
|
||||
const std::vector<const Particles::CControlPoint*>& CParticle::getControlPoints () const {
|
||||
return this->m_controlpoints;
|
||||
}
|
||||
|
||||
const std::vector<const Particles::CInitializer*>& CParticle::getInitializers () const {
|
||||
return this->m_initializers;
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CControlPoint.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CEmitter.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include "WallpaperEngine/Core/CObject.h"
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects {
|
||||
using json = nlohmann::json;
|
||||
|
||||
/**
|
||||
* Represents a particle system in the background
|
||||
*/
|
||||
class CParticle : public CObject {
|
||||
friend class CObject;
|
||||
|
||||
public:
|
||||
static const CParticle* fromFile (
|
||||
std::shared_ptr <const Core::CProject> project, const std::string& filename,
|
||||
const std::shared_ptr<const CContainer>& container, const CUserSettingBoolean* visible, int id,
|
||||
const std::string& name, const CUserSettingVector3* origin, const CUserSettingVector3* angles,
|
||||
const CUserSettingVector3* scale, std::vector<int> dependencies);
|
||||
|
||||
/**
|
||||
* @return The list of emitters for the particle system
|
||||
*/
|
||||
[[nodiscard]] const std::vector<const Particles::CEmitter*>& getEmitters () const;
|
||||
/**
|
||||
* @return The list of control points for the particle system
|
||||
*/
|
||||
[[nodiscard]] const std::vector<const Particles::CControlPoint*>& getControlPoints () const;
|
||||
/**
|
||||
* @return The list of initializers for the particle system
|
||||
*/
|
||||
[[nodiscard]] const std::vector<const Particles::CInitializer*>& getInitializers () const;
|
||||
|
||||
protected:
|
||||
CParticle (
|
||||
std::shared_ptr <const Core::CProject> project, uint32_t starttime, uint32_t maxcount,
|
||||
const CUserSettingBoolean* visible, int id, const std::string& name, const CUserSettingVector3* origin,
|
||||
const CUserSettingVector3* scale, const CUserSettingVector3* angles,
|
||||
const std::vector<const Particles::CControlPoint*>& controlpoints,
|
||||
const std::vector<const Particles::CEmitter*>& emitters,
|
||||
const std::vector<const Particles::CInitializer*>& initializers, std::vector<int> dependencies);
|
||||
|
||||
private:
|
||||
/** The time at which the particle system should start emitting */
|
||||
const uint32_t m_starttime;
|
||||
/** Maximum number of particles at the same time */
|
||||
const uint32_t m_maxcount;
|
||||
/** List of control points */
|
||||
const std::vector<const Particles::CControlPoint*> m_controlpoints;
|
||||
/** List of emitters */
|
||||
const std::vector<const Particles::CEmitter*> m_emitters;
|
||||
/** List of initializers */
|
||||
const std::vector<const Particles::CInitializer*> m_initializers;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects
|
@ -1,5 +0,0 @@
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
@ -1,40 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "WallpaperEngine/Core/DynamicValues/CDynamicValue.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constants base class
|
||||
*/
|
||||
class CShaderConstant : public DynamicValues::CDynamicValue {
|
||||
public:
|
||||
virtual ~CShaderConstant () = default;
|
||||
|
||||
template <class T> [[nodiscard]] const T* as () const {
|
||||
if (is <T> ()) {
|
||||
return static_cast <const T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] T* as () {
|
||||
if (is <T> ()) {
|
||||
return static_cast <T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] bool is () const {
|
||||
return typeid (*this) == typeid(T);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String representation of the constant's value
|
||||
*/
|
||||
[[nodiscard]] virtual std::string toString () const = 0;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,11 +0,0 @@
|
||||
#include "CShaderConstantFloat.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantFloat::CShaderConstantFloat (float value) {
|
||||
this->update (value);
|
||||
}
|
||||
|
||||
std::string CShaderConstantFloat::toString () const {
|
||||
return std::to_string (this->getFloat ());
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constant of type float
|
||||
*/
|
||||
class CShaderConstantFloat : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantFloat (float value);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,11 +0,0 @@
|
||||
#include "CShaderConstantInteger.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantInteger::CShaderConstantInteger (int32_t value) {
|
||||
this->update (value);
|
||||
}
|
||||
|
||||
std::string CShaderConstantInteger::toString () const {
|
||||
return std::to_string (this->getInt ());
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constant of type integer
|
||||
*/
|
||||
class CShaderConstantInteger : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantInteger (int32_t value);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,12 +0,0 @@
|
||||
#include "WallpaperEngine/Core/DynamicValues/CDynamicValue.h"
|
||||
#include "CShaderConstantProperty.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantProperty::CShaderConstantProperty (const std::shared_ptr <const CProperty>& property) {
|
||||
property->connectOutgoing (this);
|
||||
}
|
||||
|
||||
std::string CShaderConstantProperty::toString () const {
|
||||
return "no string representation yet!";
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Projects/CProperty.h"
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
using namespace WallpaperEngine::Core::Projects;
|
||||
/**
|
||||
* Shader constant that comes from a property
|
||||
*/
|
||||
class CShaderConstantProperty : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantProperty (const std::shared_ptr <const CProperty>& property);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,18 +0,0 @@
|
||||
#include "CShaderConstantVector2.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantVector2::CShaderConstantVector2 (glm::vec2 value) {
|
||||
this->update (value);
|
||||
}
|
||||
|
||||
std::string CShaderConstantVector2::toString () const {
|
||||
std::string result = "(";
|
||||
|
||||
result.append (std::to_string (this->getVec2 ().x));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec2 ().y));
|
||||
result.append (")");
|
||||
|
||||
return result;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <glm/vec2.hpp>
|
||||
#include <glm/vec3.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constant of vector2 type
|
||||
*/
|
||||
class CShaderConstantVector2 : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantVector2 (glm::vec2 value);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,20 +0,0 @@
|
||||
#include "CShaderConstantVector3.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantVector3::CShaderConstantVector3 (glm::vec3 value) {
|
||||
this->update (value);
|
||||
}
|
||||
|
||||
std::string CShaderConstantVector3::toString () const {
|
||||
std::string result = "(";
|
||||
|
||||
result.append (std::to_string (this->getVec3 ().x));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec3 ().y));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec3 ().z));
|
||||
result.append (")");
|
||||
|
||||
return result;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <glm/vec3.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constant of vector3 type
|
||||
*/
|
||||
class CShaderConstantVector3 : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantVector3 (glm::vec3 value);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,22 +0,0 @@
|
||||
#include "CShaderConstantVector4.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
CShaderConstantVector4::CShaderConstantVector4 (glm::vec4 value) {
|
||||
this->update (value);
|
||||
}
|
||||
|
||||
std::string CShaderConstantVector4::toString () const {
|
||||
std::string result = "(";
|
||||
|
||||
result.append (std::to_string (this->getVec4 ().x));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec4 ().y));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec4 ().z));
|
||||
result.append (",");
|
||||
result.append (std::to_string (this->getVec4 ().w));
|
||||
result.append (")");
|
||||
|
||||
return result;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CShaderConstant.h"
|
||||
|
||||
#include <glm/vec4.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Effects::Constants {
|
||||
/**
|
||||
* Shader constant of vector4 type
|
||||
*/
|
||||
class CShaderConstantVector4 : public CShaderConstant {
|
||||
public:
|
||||
explicit CShaderConstantVector4 (glm::vec4 value);
|
||||
|
||||
[[nodiscard]] std::string toString () const override;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Effects::Constants
|
@ -1,28 +0,0 @@
|
||||
#include "CControlPoint.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles;
|
||||
|
||||
const CControlPoint* CControlPoint::fromJSON (const json& data) {
|
||||
return new CControlPoint (
|
||||
jsonFindRequired <uint32_t> (data, "id", "Particle's control point must have id"),
|
||||
jsonFindDefault (data, "flags", 0),
|
||||
jsonFindDefault (data, "offset", glm::vec3())
|
||||
);
|
||||
}
|
||||
|
||||
CControlPoint::CControlPoint (uint32_t id, uint32_t flags, glm::vec3 offset) :
|
||||
m_id (id),
|
||||
m_flags (flags),
|
||||
m_offset (offset) {}
|
||||
|
||||
uint32_t CControlPoint::getId () const {
|
||||
return this->m_id;
|
||||
}
|
||||
|
||||
const glm::vec3& CControlPoint::getOffset () const {
|
||||
return this->m_offset;
|
||||
}
|
||||
|
||||
uint32_t CControlPoint::getFlags () const {
|
||||
return this->m_flags;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles {
|
||||
using json = nlohmann::json;
|
||||
|
||||
/**
|
||||
* Control point for particles
|
||||
*/
|
||||
class CControlPoint {
|
||||
public:
|
||||
static const CControlPoint* fromJSON (const json& data);
|
||||
|
||||
/**
|
||||
* @return The id of the controlpoint used for ordering purposes
|
||||
*/
|
||||
[[nodiscard]] uint32_t getId () const;
|
||||
/**
|
||||
* @return The offset from origin
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getOffset () const;
|
||||
/**
|
||||
* @return Flags for the control point, controls how it should behave
|
||||
*/
|
||||
[[nodiscard]] uint32_t getFlags () const;
|
||||
|
||||
protected:
|
||||
explicit CControlPoint (uint32_t id, uint32_t flags, glm::vec3 offset);
|
||||
|
||||
private:
|
||||
/** ID used for ordering purposes */
|
||||
const uint32_t m_id;
|
||||
/** Flags that control how it behaves */
|
||||
const uint32_t m_flags;
|
||||
/** The offset from starting position */
|
||||
const glm::vec3 m_offset;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles
|
@ -1,75 +0,0 @@
|
||||
#include "CEmitter.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles;
|
||||
|
||||
const CEmitter* CEmitter::fromJSON (const json& data) {
|
||||
const auto distancemax_it = jsonFindRequired (data, "distancemax", "Particle emitter must have maximum distance");
|
||||
const auto distancemin_it = jsonFindRequired (data, "distancemin", "Particle emitter must have minimum distance");
|
||||
|
||||
auto distancemin = glm::vec3(0);
|
||||
auto distancemax = glm::vec3(0);
|
||||
|
||||
if (distancemin_it->is_number()) {
|
||||
distancemin = glm::vec3(static_cast<uint32_t>(*distancemin_it));
|
||||
} else {
|
||||
distancemin = WallpaperEngine::Core::aToVector3(*distancemin_it);
|
||||
}
|
||||
|
||||
if (distancemax_it->is_number()) {
|
||||
distancemax = glm::vec3(static_cast<uint32_t>(*distancemax_it));
|
||||
} else {
|
||||
distancemax = WallpaperEngine::Core::aToVector3(*distancemax_it);
|
||||
}
|
||||
|
||||
return new CEmitter (
|
||||
jsonFindRequired <glm::vec3> (data, "directions", "Particle emitter must have direction specified"),
|
||||
distancemax,
|
||||
distancemin,
|
||||
jsonFindDefault (data, "id", 0),
|
||||
jsonFindRequired <std::string> (data, "name", "Particle emitter must have a name"),
|
||||
jsonFindRequired <glm::vec3> (data, "origin", "Particle emitter must have an origin"),
|
||||
jsonFindRequired <double> (data, "rate", "Particle emitter must have a rate")
|
||||
);
|
||||
}
|
||||
|
||||
CEmitter::CEmitter (
|
||||
glm::vec3 directions, glm::vec3 distancemax, glm::vec3 distancemin, uint32_t id, std::string name, glm::vec3 origin,
|
||||
double rate
|
||||
) :
|
||||
m_directions (directions),
|
||||
m_distancemax (distancemax),
|
||||
m_distancemin (distancemin),
|
||||
m_id (id),
|
||||
m_name (std::move(name)),
|
||||
m_origin (origin),
|
||||
m_rate (rate) {}
|
||||
|
||||
uint32_t CEmitter::getId () const {
|
||||
return this->m_id;
|
||||
}
|
||||
|
||||
const std::string& CEmitter::getName () const {
|
||||
return this->m_name;
|
||||
}
|
||||
|
||||
const glm::vec3& CEmitter::getDistanceMax () const {
|
||||
return this->m_distancemax;
|
||||
}
|
||||
|
||||
const glm::vec3& CEmitter::getDistanceMin () const {
|
||||
return this->m_distancemin;
|
||||
}
|
||||
|
||||
const glm::vec3& CEmitter::getDirections () const {
|
||||
return this->m_directions;
|
||||
}
|
||||
|
||||
const glm::vec3& CEmitter::getOrigin () const {
|
||||
return this->m_origin;
|
||||
}
|
||||
|
||||
const double CEmitter::getRate () const {
|
||||
return this->m_rate;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles {
|
||||
using json = nlohmann::json;
|
||||
|
||||
/**
|
||||
* Particle emitter, controls the area where the particles have to be created
|
||||
*/
|
||||
class CEmitter {
|
||||
public:
|
||||
static const CEmitter* fromJSON (const json& data);
|
||||
|
||||
/**
|
||||
* @return The ID of the emitter
|
||||
*/
|
||||
[[nodiscard]] uint32_t getId () const;
|
||||
/**
|
||||
* @return The name of the emitter, indicates what type of emission to do
|
||||
*/
|
||||
[[nodiscard]] const std::string& getName () const;
|
||||
/**
|
||||
* @return The maximum distance a particle can travel before being dead
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getDistanceMax () const;
|
||||
/**
|
||||
* @return The minimum distance a particle can travel before being dead
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getDistanceMin () const;
|
||||
/**
|
||||
* @return The direction a particle should move to
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getDirections () const;
|
||||
/**
|
||||
* @return The center of the particle emission
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getOrigin () const;
|
||||
/**
|
||||
* @return The rate of particle emission
|
||||
*/
|
||||
[[nodiscard]] const double getRate () const;
|
||||
|
||||
protected:
|
||||
CEmitter (
|
||||
glm::vec3 directions, glm::vec3 distancemax, glm::vec3 distancemin, uint32_t id, std::string name,
|
||||
glm::vec3 origin, double rate);
|
||||
|
||||
private:
|
||||
/** Direction the particles should move to */
|
||||
const glm::vec3 m_directions;
|
||||
/** Maximum distance before the particle is dead */
|
||||
const glm::vec3 m_distancemax;
|
||||
/** Minimum distance before the particle is dead */
|
||||
const glm::vec3 m_distancemin;
|
||||
/** ID of the emitter */
|
||||
const uint32_t m_id;
|
||||
/** Name of the emitter, indicates the type of emitter */
|
||||
const std::string m_name;
|
||||
/** The center of the emitter */
|
||||
const glm::vec3 m_origin;
|
||||
/** The rate of emission */
|
||||
const double m_rate;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles
|
@ -1,59 +0,0 @@
|
||||
#include "CInitializer.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CAlphaRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CAngularVelocityRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CColorRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CLifeTimeRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CRotationRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CSizeRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CTurbulentVelocityRandom.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/Initializers/CVelocityRandom.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles;
|
||||
|
||||
const CInitializer* CInitializer::fromJSON (const json& data) {
|
||||
const auto name = jsonFindRequired <std::string> (data, "name", "Particle's initializer must have a name");
|
||||
const auto id = jsonFindDefault (data, "id", 0);
|
||||
|
||||
if (name == "lifetimerandom") {
|
||||
return Initializers::CLifeTimeRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "sizerandom") {
|
||||
return Initializers::CSizeRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "rotationrandom") {
|
||||
return Initializers::CRotationRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "velocityrandom") {
|
||||
return Initializers::CVelocityRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "colorrandom") {
|
||||
return Initializers::CColorRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "alpharandom") {
|
||||
return Initializers::CAlphaRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "angularvelocityrandom") {
|
||||
return Initializers::CAngularVelocityRandom::fromJSON (data, id);
|
||||
}
|
||||
if (name == "turbulentvelocityrandom") {
|
||||
return Initializers::CTurbulentVelocityRandom::fromJSON (data, id);
|
||||
}
|
||||
|
||||
sLog.exception ("Found unknown initializer for particles: ", name);
|
||||
}
|
||||
|
||||
CInitializer::CInitializer (uint32_t id, std::string name) :
|
||||
m_id (id),
|
||||
m_name (std::move(name)) {}
|
||||
|
||||
const std::string& CInitializer::getName () const {
|
||||
return this->m_name;
|
||||
}
|
||||
|
||||
uint32_t CInitializer::getId () const {
|
||||
return this->m_id;
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles {
|
||||
using json = nlohmann::json;
|
||||
|
||||
/**
|
||||
* Initializer for particles, controls the different attributes a particle will have
|
||||
* on emission
|
||||
*/
|
||||
class CInitializer {
|
||||
public:
|
||||
static const CInitializer* fromJSON (const json& data);
|
||||
|
||||
template <class T> [[nodiscard]] const T* as () const {
|
||||
if (is <T> ()) {
|
||||
return static_cast <const T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] T* as () {
|
||||
if (is <T> ()) {
|
||||
return static_cast <T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] bool is () const {
|
||||
return typeid (*this) == typeid(T);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The name of the particle initializer, indicates what type of initialization to do
|
||||
*/
|
||||
[[nodiscard]] const std::string& getName () const;
|
||||
/**
|
||||
* @return The id of the initializer
|
||||
*/
|
||||
[[nodiscard]] uint32_t getId () const;
|
||||
|
||||
protected:
|
||||
CInitializer (uint32_t id, std::string name);
|
||||
|
||||
virtual ~CInitializer() = default;
|
||||
|
||||
private:
|
||||
/** ID for ordering purposes */
|
||||
const uint32_t m_id;
|
||||
/** The name of the initializer, indicates what type of initialization to do */
|
||||
const std::string m_name;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles
|
@ -1,24 +0,0 @@
|
||||
#include "CAlphaRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CAlphaRandom* CAlphaRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CAlphaRandom (
|
||||
id,
|
||||
jsonFindRequired<double> (data, "min", "Alpharandom initializer must have a minimum value"),
|
||||
jsonFindRequired<double> (data, "max", "Alpharandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CAlphaRandom::CAlphaRandom (uint32_t id, double min, double max) :
|
||||
CInitializer (id, "alpharandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
double CAlphaRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
double CAlphaRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base alpha for the particles
|
||||
*/
|
||||
class CAlphaRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum alpha value to be used
|
||||
*/
|
||||
[[nodiscard]] double getMinimum () const;
|
||||
/**
|
||||
* @return The maximum alpha value to be used
|
||||
*/
|
||||
[[nodiscard]] double getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CAlphaRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CAlphaRandom (uint32_t id, double min, double max);
|
||||
|
||||
private:
|
||||
/** Maximum alpha */
|
||||
const double m_max;
|
||||
/** Minimum alpha */
|
||||
const double m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,24 +0,0 @@
|
||||
#include "CAngularVelocityRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CAngularVelocityRandom* CAngularVelocityRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CAngularVelocityRandom (
|
||||
id,
|
||||
jsonFindRequired <glm::vec3> (data, "min", "Angularvelocityrandom initializer must have a minimum value"),
|
||||
jsonFindRequired <glm::vec3> (data, "max", "Angularvelocityrandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CAngularVelocityRandom::CAngularVelocityRandom (uint32_t id, glm::vec3 min, glm::vec3 max) :
|
||||
CInitializer (id, "angularvelocityrandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
const glm::vec3& CAngularVelocityRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
const glm::vec3& CAngularVelocityRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base angular velocity for particles
|
||||
*/
|
||||
class CAngularVelocityRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return Minimum angular velocity (direction * speed)
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getMinimum () const;
|
||||
/**
|
||||
* @return Maximum angular velocity (direction * speed)
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CAngularVelocityRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CAngularVelocityRandom (uint32_t id, glm::vec3 min, glm::vec3 max);
|
||||
|
||||
private:
|
||||
/** Maximum velocity (direction * speed) */
|
||||
const glm::vec3 m_max;
|
||||
/** Minimum velocity (direction * speed) */
|
||||
const glm::vec3 m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,24 +0,0 @@
|
||||
#include "CColorRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CColorRandom* CColorRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CColorRandom (
|
||||
id,
|
||||
jsonFindRequired <glm::ivec3> (data, "min", "Colorrandom initializer must have a minimum value"),
|
||||
jsonFindRequired <glm::ivec3> (data, "max", "Colorrandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CColorRandom::CColorRandom (uint32_t id, glm::ivec3 min, glm::ivec3 max) :
|
||||
CInitializer (id, "colorrandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
const glm::ivec3& CColorRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
const glm::ivec3& CColorRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base color
|
||||
*/
|
||||
class CColorRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum color to use (RGB)
|
||||
*/
|
||||
[[nodiscard]] const glm::ivec3& getMinimum () const;
|
||||
/**
|
||||
* @return The maximum color to use (RGB)
|
||||
*/
|
||||
[[nodiscard]] const glm::ivec3& getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CColorRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CColorRandom (uint32_t id, glm::ivec3 min, glm::ivec3 max);
|
||||
|
||||
private:
|
||||
/** Maximum color */
|
||||
const glm::ivec3 m_max;
|
||||
/** Minimum color */
|
||||
const glm::ivec3 m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,24 +0,0 @@
|
||||
#include "CLifeTimeRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CLifeTimeRandom* CLifeTimeRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CLifeTimeRandom (
|
||||
id,
|
||||
jsonFindRequired <uint32_t> (data, "min", "Lifetimerandom initializer must have a minimum value"),
|
||||
jsonFindRequired <uint32_t> (data, "max", "Lifetimerandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CLifeTimeRandom::CLifeTimeRandom (uint32_t id, uint32_t min, uint32_t max) :
|
||||
CInitializer (id, "lifetimerandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
uint32_t CLifeTimeRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
uint32_t CLifeTimeRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the lifetime of each particle on startup
|
||||
*/
|
||||
class CLifeTimeRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum lifetime to be used
|
||||
*/
|
||||
[[nodiscard]] uint32_t getMinimum () const;
|
||||
/**
|
||||
* @return The maximum lifetime to be used
|
||||
*/
|
||||
[[nodiscard]] uint32_t getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CLifeTimeRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CLifeTimeRandom (uint32_t id, uint32_t min, uint32_t max);
|
||||
|
||||
private:
|
||||
/** Maximum lifetime */
|
||||
const uint32_t m_max;
|
||||
/** Minimum lifetime */
|
||||
const uint32_t m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,77 +0,0 @@
|
||||
#include "CRotationRandom.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CRotationRandom* CRotationRandom::fromJSON (const json& data, uint32_t id) {
|
||||
const auto min_it = data.find ("minVector");
|
||||
const auto max_it = data.find ("max");
|
||||
|
||||
glm::vec3 minVector = glm::vec3 ();
|
||||
glm::vec3 maxVector = glm::vec3 ();
|
||||
double minNumber = 0.0f;
|
||||
double maxNumber = 0.0f;
|
||||
bool isMinVector = false;
|
||||
bool isMaxVector = false;
|
||||
|
||||
if (min_it != data.end () && min_it->is_string ()) {
|
||||
minVector = WallpaperEngine::Core::aToVector3 (*min_it);
|
||||
isMinVector = true;
|
||||
} else if (min_it != data.end () && min_it->is_number ()) {
|
||||
minNumber = *min_it;
|
||||
isMinVector = false;
|
||||
}
|
||||
|
||||
if (max_it != data.end () && max_it->is_string ()) {
|
||||
maxVector = WallpaperEngine::Core::aToVector3 (*max_it);
|
||||
isMaxVector = true;
|
||||
} else if (max_it != data.end () && max_it->is_number ()) {
|
||||
maxNumber = *max_it;
|
||||
isMaxVector = false;
|
||||
}
|
||||
|
||||
return new CRotationRandom (id, minVector, minNumber, isMinVector, maxVector, maxNumber, isMaxVector);
|
||||
}
|
||||
|
||||
CRotationRandom::CRotationRandom (uint32_t id, glm::vec3 minVector, double minNumber, bool isMinimumVector,
|
||||
glm::vec3 maxVector, double maxNumber, bool isMaximumVector) :
|
||||
CInitializer (id, "rotationrandom"),
|
||||
m_maxVector (maxVector),
|
||||
m_maxNumber (maxNumber),
|
||||
m_minVector (minVector),
|
||||
m_minNumber (minNumber),
|
||||
m_isMinimumVector (isMinimumVector),
|
||||
m_isMaximumVector (isMaximumVector) {}
|
||||
|
||||
glm::vec3 CRotationRandom::getMinimumVector () const {
|
||||
return this->m_minVector;
|
||||
}
|
||||
|
||||
glm::vec3 CRotationRandom::getMaximumVector () const {
|
||||
return this->m_maxVector;
|
||||
}
|
||||
|
||||
double CRotationRandom::getMinimumNumber () const {
|
||||
return this->m_minNumber;
|
||||
}
|
||||
|
||||
double CRotationRandom::getMaximumNumber () const {
|
||||
return this->m_maxNumber;
|
||||
}
|
||||
|
||||
bool CRotationRandom::isMinimumVector () const {
|
||||
return this->m_isMinimumVector;
|
||||
}
|
||||
|
||||
bool CRotationRandom::isMinimumNumber () const {
|
||||
return !this->m_isMinimumVector;
|
||||
}
|
||||
|
||||
bool CRotationRandom::isMaximumVector () const {
|
||||
return this->m_isMaximumVector;
|
||||
}
|
||||
|
||||
bool CRotationRandom::isMaximumNumber () const {
|
||||
return !this->m_isMaximumVector;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base rotation for the particles
|
||||
*/
|
||||
class CRotationRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum rotation in vector format if available
|
||||
*/
|
||||
[[nodiscard]] glm::vec3 getMinimumVector () const;
|
||||
/**
|
||||
* @return The maximum rotation in vector format if available
|
||||
*/
|
||||
[[nodiscard]] glm::vec3 getMaximumVector () const;
|
||||
/**
|
||||
* @return The minimum rotation in angle format if available
|
||||
*/
|
||||
[[nodiscard]] double getMinimumNumber () const;
|
||||
/**
|
||||
* @return The maximum rotation in angle format if available
|
||||
*/
|
||||
[[nodiscard]] double getMaximumNumber () const;
|
||||
|
||||
/**
|
||||
* @return Indicates if the minimum rotation is a vector
|
||||
*/
|
||||
[[nodiscard]] bool isMinimumVector () const;
|
||||
/**
|
||||
* @return Indicates if the minimum rotation is an angle
|
||||
*/
|
||||
[[nodiscard]] bool isMinimumNumber () const;
|
||||
/**
|
||||
* @return Indicates if the maximum rotation is a vector
|
||||
*/
|
||||
[[nodiscard]] bool isMaximumVector () const;
|
||||
/**
|
||||
* @return Indicates if the maximum rotation is an angle
|
||||
*/
|
||||
[[nodiscard]] bool isMaximumNumber () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CRotationRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CRotationRandom (uint32_t id, glm::vec3 minVector, double minNumber, bool isMinimumVector, glm::vec3 maxVector,
|
||||
double maxNumber, bool isMaximumVector);
|
||||
|
||||
private:
|
||||
/** Maximum rotation vector */
|
||||
const glm::vec3 m_maxVector;
|
||||
/** Maximum rotation angle */
|
||||
const double m_maxNumber;
|
||||
/** Minimum rotation vector */
|
||||
const glm::vec3 m_minVector;
|
||||
/** Minimum rotation angle */
|
||||
const double m_minNumber;
|
||||
|
||||
/** If minimum is a vector */
|
||||
const bool m_isMinimumVector;
|
||||
/** If maximum is a vector */
|
||||
const bool m_isMaximumVector;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,24 +0,0 @@
|
||||
#include "CSizeRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CSizeRandom* CSizeRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CSizeRandom (
|
||||
id,
|
||||
jsonFindRequired <uint32_t> (data, "min", "Sizerandom initializer must have a minimum value"),
|
||||
jsonFindRequired <uint32_t> (data, "max", "Sizerandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CSizeRandom::CSizeRandom (uint32_t id, uint32_t min, uint32_t max) :
|
||||
CInitializer (id, "sizerandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
uint32_t CSizeRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
uint32_t CSizeRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base size for the particles
|
||||
*/
|
||||
class CSizeRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum size to be used
|
||||
*/
|
||||
[[nodiscard]] uint32_t getMinimum () const;
|
||||
/**
|
||||
* @return The maximum size to be used
|
||||
*/
|
||||
[[nodiscard]] uint32_t getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CSizeRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CSizeRandom (uint32_t id, uint32_t min, uint32_t max);
|
||||
|
||||
private:
|
||||
/** Maximum size */
|
||||
const uint32_t m_max;
|
||||
/** Minimum size */
|
||||
const uint32_t m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,46 +0,0 @@
|
||||
#include "CTurbulentVelocityRandom.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CTurbulentVelocityRandom* CTurbulentVelocityRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CTurbulentVelocityRandom (
|
||||
id,
|
||||
jsonFindRequired <double> (data, "phasemax", "TurbulentVelocityRandom initializer must have a phasemax value"),
|
||||
jsonFindRequired <double> (data, "scale", "TurbulentVelocityRandom initializer must have a scale value"),
|
||||
jsonFindRequired <double>(data, "timescale", "TurbulentVelocityRandom initializer must have a timescale value"),
|
||||
jsonFindRequired <uint32_t> (data, "speedmin", "TurbulentVelocityRandom initializer must have a minimum speed value"),
|
||||
jsonFindRequired <uint32_t> (data, "speedmax", "TurbulentVelocityRandom initializer must have a maximum speed value")
|
||||
);
|
||||
}
|
||||
|
||||
CTurbulentVelocityRandom::CTurbulentVelocityRandom (uint32_t id, double phasemax, double scale, double timescale,
|
||||
uint32_t speedmin, uint32_t speedmax) :
|
||||
CInitializer (id, "turbulentvelocityrandom"),
|
||||
m_phasemax (phasemax),
|
||||
m_scale (scale),
|
||||
m_timescale (timescale),
|
||||
m_speedmin (speedmin),
|
||||
m_speedmax (speedmax) {}
|
||||
|
||||
double CTurbulentVelocityRandom::getPhaseMax () const {
|
||||
return this->m_phasemax;
|
||||
}
|
||||
|
||||
double CTurbulentVelocityRandom::getScale () const {
|
||||
return this->m_scale;
|
||||
}
|
||||
|
||||
double CTurbulentVelocityRandom::getTimeScale () const {
|
||||
return this->m_timescale;
|
||||
}
|
||||
|
||||
uint32_t CTurbulentVelocityRandom::getMinimumSpeed () const {
|
||||
return this->m_speedmin;
|
||||
}
|
||||
|
||||
uint32_t CTurbulentVelocityRandom::getMaximumSpeed () const {
|
||||
return this->m_speedmax;
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the turbulent velocity for the particles
|
||||
*/
|
||||
class CTurbulentVelocityRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The phase to use
|
||||
*/
|
||||
double getPhaseMax () const;
|
||||
/**
|
||||
* @return The scale to use
|
||||
*/
|
||||
double getScale () const;
|
||||
/**
|
||||
* @return How time affects to the scale
|
||||
*/
|
||||
double getTimeScale () const;
|
||||
/**
|
||||
* @return The minimum speed
|
||||
*/
|
||||
uint32_t getMinimumSpeed () const;
|
||||
/**
|
||||
* @return The maximum speed
|
||||
*/
|
||||
uint32_t getMaximumSpeed () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CTurbulentVelocityRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CTurbulentVelocityRandom (uint32_t id, double phasemax, double scale, double timescale, uint32_t speedmin,
|
||||
uint32_t speedmax);
|
||||
|
||||
private:
|
||||
/** Phase */
|
||||
const double m_phasemax;
|
||||
/** Scale */
|
||||
const double m_scale;
|
||||
/** Time scale, how the time affects the scale */
|
||||
const double m_timescale;
|
||||
/** Minimum speed */
|
||||
const uint32_t m_speedmin;
|
||||
/** Maximum speed */
|
||||
const uint32_t m_speedmax;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,24 +0,0 @@
|
||||
#include "CVelocityRandom.h"
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Particles::Initializers;
|
||||
|
||||
const CVelocityRandom* CVelocityRandom::fromJSON (const json& data, uint32_t id) {
|
||||
return new CVelocityRandom (
|
||||
id,
|
||||
jsonFindRequired <glm::vec3> (data, "min", "Velocityrandom initializer must have a minimum value"),
|
||||
jsonFindRequired <glm::vec3> (data, "max", "Velocityrandom initializer must have a maximum value")
|
||||
);
|
||||
}
|
||||
|
||||
CVelocityRandom::CVelocityRandom (uint32_t id, glm::vec3 min, glm::vec3 max) :
|
||||
CInitializer (id, "velocityrandom"),
|
||||
m_max (max),
|
||||
m_min (min) {}
|
||||
|
||||
const glm::vec3& CVelocityRandom::getMinimum () const {
|
||||
return this->m_min;
|
||||
}
|
||||
|
||||
const glm::vec3& CVelocityRandom::getMaximum () const {
|
||||
return this->m_max;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Particles/CInitializer.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Objects::Particles::Initializers {
|
||||
/**
|
||||
* Initializer for particles that decides the base velocity for the particles
|
||||
*/
|
||||
class CVelocityRandom : CInitializer {
|
||||
public:
|
||||
/**
|
||||
* @return The minimum velocity (direction * speed)
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getMinimum () const;
|
||||
/**
|
||||
* @return The maximum velocity (direction * speed)
|
||||
*/
|
||||
[[nodiscard]] const glm::vec3& getMaximum () const;
|
||||
|
||||
protected:
|
||||
friend class CInitializer;
|
||||
|
||||
static const CVelocityRandom* fromJSON (const json& data, uint32_t id);
|
||||
|
||||
CVelocityRandom (uint32_t id, glm::vec3 min, glm::vec3 max);
|
||||
|
||||
private:
|
||||
/** Maximum velocity */
|
||||
const glm::vec3 m_max;
|
||||
/** Minimum velocity */
|
||||
const glm::vec3 m_min;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::Objects::Particles::Initializers
|
@ -1,91 +0,0 @@
|
||||
#include "CUserSettingBoolean.h"
|
||||
|
||||
#include <utility>
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Projects/CProperty.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertyBoolean.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertyCombo.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertySlider.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertyText.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine::Core;
|
||||
using namespace WallpaperEngine::Core::Projects;
|
||||
using namespace WallpaperEngine::Core::UserSettings;
|
||||
|
||||
CUserSettingBoolean::CUserSettingBoolean (
|
||||
bool hasCondition, bool defaultValue, std::shared_ptr <const Projects::CProperty> source, std::string expectedValue
|
||||
) :
|
||||
CUserSettingValue (),
|
||||
m_hasCondition (hasCondition),
|
||||
m_source (source),
|
||||
m_expectedValue (std::move(expectedValue)) {
|
||||
this->update (defaultValue);
|
||||
|
||||
if (this->m_source != nullptr) {
|
||||
this->m_source->subscribe ([this](const Projects::CProperty* property) -> void {
|
||||
if (!this->m_hasCondition) {
|
||||
this->update (property->getBool ());
|
||||
} else if (property->is <CPropertyCombo> ()) {
|
||||
this->update (
|
||||
property->as <CPropertyCombo> ()->translateValueToIndex (this->m_expectedValue) == property->getInt ()
|
||||
);
|
||||
} else {
|
||||
sLog.error ("Cannot update boolean user setting for an unknown property type ", property->getType ());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const CUserSettingBoolean* CUserSettingBoolean::fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties) {
|
||||
bool hasCondition = false;
|
||||
std::shared_ptr <const Projects::CProperty> sourceProperty = nullptr;
|
||||
bool defaultValue;
|
||||
std::string source;
|
||||
std::string expectedValue;
|
||||
|
||||
if (data.is_object ()) {
|
||||
auto animation = data.find ("animation");
|
||||
auto userIt = data.find ("user");
|
||||
defaultValue = jsonFindDefault (data, "value", true); // is this default value right?
|
||||
|
||||
if (userIt != data.end ()) {
|
||||
if (userIt->is_string ()) {
|
||||
source = *userIt;
|
||||
} else {
|
||||
hasCondition = true;
|
||||
source = jsonFindRequired <std::string> (userIt, "name", "Name for conditional setting must be present");
|
||||
expectedValue =
|
||||
jsonFindRequired <std::string> (userIt, "condition", "Condition for conditional setting must be present");
|
||||
}
|
||||
|
||||
const auto propertyIt = properties.find (source);
|
||||
|
||||
if (propertyIt != properties.end ()) {
|
||||
sourceProperty = propertyIt->second;
|
||||
}
|
||||
|
||||
if (sourceProperty == nullptr) {
|
||||
sLog.error ("Cannot find property ", source, " to get value from for user setting value, using default value: ", defaultValue);
|
||||
}
|
||||
} else {
|
||||
sLog.error ("Boolean property doesn't have user member, this could mean an scripted value");
|
||||
}
|
||||
|
||||
if (animation != data.end ()) {
|
||||
sLog.error ("Detected a setting with animation data, which is not supported yet!");
|
||||
}
|
||||
} else {
|
||||
if (!data.is_boolean ())
|
||||
sLog.error ("Expected boolean value on user setting");
|
||||
|
||||
defaultValue = data.get<bool> ();
|
||||
}
|
||||
|
||||
return new CUserSettingBoolean (hasCondition, defaultValue, sourceProperty, expectedValue);
|
||||
}
|
||||
|
||||
const CUserSettingBoolean* CUserSettingBoolean::fromScalar (const bool value) {
|
||||
return new CUserSettingBoolean (false, value, nullptr, "");
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CUserSettingValue.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Projects {
|
||||
class CProperty;
|
||||
}
|
||||
|
||||
namespace WallpaperEngine::Core::UserSettings {
|
||||
class CUserSettingBoolean : public CUserSettingValue {
|
||||
public:
|
||||
typedef bool data_type;
|
||||
|
||||
static const CUserSettingBoolean* fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties);
|
||||
static const CUserSettingBoolean* fromScalar (bool value);
|
||||
|
||||
private:
|
||||
CUserSettingBoolean (
|
||||
bool hasCondition, bool defaultValue, std::shared_ptr <const Projects::CProperty> source, std::string expectedValue);
|
||||
|
||||
const bool m_hasCondition;
|
||||
const std::string m_expectedValue;
|
||||
const std::shared_ptr <const Projects::CProperty> m_source;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::UserSettings
|
@ -1,85 +0,0 @@
|
||||
#include "CUserSettingFloat.h"
|
||||
|
||||
#include <utility>
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Projects/CProperty.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertySlider.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine::Core;
|
||||
using namespace WallpaperEngine::Core::Projects;
|
||||
using namespace WallpaperEngine::Core::UserSettings;
|
||||
|
||||
CUserSettingFloat::CUserSettingFloat (
|
||||
bool hasCondition, float defaultValue, std::shared_ptr <const Projects::CProperty> source, std::string expectedValue
|
||||
) :
|
||||
CUserSettingValue (),
|
||||
m_default (defaultValue),
|
||||
m_hasCondition (hasCondition),
|
||||
m_source (source),
|
||||
m_expectedValue (std::move(expectedValue)) {
|
||||
this->update (defaultValue);
|
||||
|
||||
if (this->m_source != nullptr) {
|
||||
this->m_source->subscribe ([this](const Projects::CProperty* property) -> void {
|
||||
if (!this->m_hasCondition) {
|
||||
this->update (property->getFloat ());
|
||||
} else {
|
||||
sLog.error ("Don't know how to check for condition on a float property... Expected value: ", this->m_expectedValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const CUserSettingFloat* CUserSettingFloat::fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties) {
|
||||
float defaultValue;
|
||||
std::string source;
|
||||
std::string expectedValue;
|
||||
bool hasCondition = false;
|
||||
std::shared_ptr <const Projects::CProperty> sourceProperty = nullptr;
|
||||
|
||||
if (data.is_object ()) {
|
||||
auto animation = data.find ("animation");
|
||||
auto userIt = data.find ("user");
|
||||
defaultValue = jsonFindDefault (data, "value", 1.0f); // is this default value right?
|
||||
|
||||
if (userIt != data.end ()) {
|
||||
if (userIt->is_string ()) {
|
||||
source = *userIt;
|
||||
} else {
|
||||
hasCondition = true;
|
||||
source = jsonFindRequired <std::string> (userIt, "name", "Name for conditional setting must be present");
|
||||
expectedValue =
|
||||
jsonFindRequired <std::string> (userIt, "condition", "Condition for conditional setting must be present");
|
||||
}
|
||||
|
||||
const auto propertyIt = properties.find (source);
|
||||
|
||||
if (propertyIt != properties.end ()) {
|
||||
sourceProperty = propertyIt->second;
|
||||
}
|
||||
|
||||
if (sourceProperty == nullptr) {
|
||||
sLog.error ("Cannot find property ", source, " to get value from for user setting value, using default value: ", defaultValue);
|
||||
}
|
||||
|
||||
if (animation != data.end ()) {
|
||||
sLog.error ("Detected a setting with animation data, which is not supported yet!");
|
||||
}
|
||||
} else {
|
||||
sLog.error ("Float property doesn't have user member, this could mean an scripted value");
|
||||
}
|
||||
} else {
|
||||
if (!data.is_number ())
|
||||
sLog.exception ("Expected numeric value on user settings");
|
||||
|
||||
defaultValue = data.get<float> ();
|
||||
}
|
||||
|
||||
return new CUserSettingFloat (hasCondition, defaultValue, sourceProperty, expectedValue);
|
||||
}
|
||||
|
||||
const CUserSettingFloat* CUserSettingFloat::fromScalar (const float value) {
|
||||
return new CUserSettingFloat (false, value, nullptr, "");
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CUserSettingValue.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Projects {
|
||||
class CProperty;
|
||||
}
|
||||
|
||||
namespace WallpaperEngine::Core::UserSettings {
|
||||
class CUserSettingFloat : public CUserSettingValue {
|
||||
public:
|
||||
typedef float data_type;
|
||||
|
||||
static const CUserSettingFloat* fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties);
|
||||
static const CUserSettingFloat* fromScalar (float value);
|
||||
|
||||
private:
|
||||
CUserSettingFloat (
|
||||
bool hasCondition, float defaultValue, std::shared_ptr <const Projects::CProperty> source, std::string expectedValue);
|
||||
|
||||
const double m_default;
|
||||
const bool m_hasCondition;
|
||||
const std::shared_ptr <const Projects::CProperty> m_source;
|
||||
const std::string m_expectedValue;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::UserSettings
|
@ -1,5 +0,0 @@
|
||||
#include "CUserSettingValue.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
using namespace WallpaperEngine::Core::UserSettings;
|
@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "WallpaperEngine/Core/DynamicValues/CDynamicValue.h"
|
||||
|
||||
namespace WallpaperEngine::Core::UserSettings {
|
||||
using namespace WallpaperEngine::Core::DynamicValues;
|
||||
|
||||
class CUserSettingValue : public CDynamicValue {
|
||||
public:
|
||||
template <class T> [[nodiscard]] const T* as () const {
|
||||
if (is <T> ()) {
|
||||
return static_cast <const T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] T* as () {
|
||||
if (is <T> ()) {
|
||||
return static_cast <T*> (this);
|
||||
}
|
||||
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
template <class T> [[nodiscard]] bool is () const {
|
||||
return typeid (*this) == typeid(T);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~CUserSettingValue() = default;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::UserSettings
|
@ -1,86 +0,0 @@
|
||||
#include "CUserSettingVector3.h"
|
||||
|
||||
#include <utility>
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Projects/CProperty.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertyColor.h"
|
||||
#include "WallpaperEngine/Core/Projects/CPropertySlider.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine::Core;
|
||||
using namespace WallpaperEngine::Core::Projects;
|
||||
using namespace WallpaperEngine::Core::UserSettings;
|
||||
|
||||
CUserSettingVector3::CUserSettingVector3 (
|
||||
bool hasCondition, glm::vec3 defaultValue, std::shared_ptr <const Projects::CProperty> source, std::string expectedValue
|
||||
) :
|
||||
CUserSettingValue (),
|
||||
m_hasCondition (hasCondition),
|
||||
m_source (source),
|
||||
m_expectedValue (std::move(expectedValue)) {
|
||||
this->update (defaultValue);
|
||||
|
||||
if (this->m_source != nullptr) {
|
||||
this->m_source->subscribe ([this](const Projects::CProperty* property) -> void {
|
||||
if (this->m_hasCondition) {
|
||||
sLog.error ("Don't know how to check for condition on a float property... Expected value: ", this->m_expectedValue);
|
||||
return;
|
||||
}
|
||||
|
||||
this->update (property->getVec3 ());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const CUserSettingVector3* CUserSettingVector3::fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties) {
|
||||
bool hasCondition = false;
|
||||
std::shared_ptr <const Projects::CProperty> sourceProperty = nullptr;
|
||||
glm::vec3 defaultValue;
|
||||
std::string source;
|
||||
std::string expectedValue;
|
||||
|
||||
if (data.is_object ()) {
|
||||
auto animation = data.find ("animation");
|
||||
auto userIt = data.find ("user");
|
||||
defaultValue = jsonFindDefault (data, "value", glm::vec3()); // is this default value right?
|
||||
|
||||
if (userIt != data.end ()) {
|
||||
if (userIt->is_string ()) {
|
||||
source = *userIt;
|
||||
} else {
|
||||
hasCondition = true;
|
||||
source = jsonFindRequired <std::string> (userIt, "name", "Name for conditional setting must be present");
|
||||
expectedValue =
|
||||
jsonFindRequired <std::string> (userIt, "condition", "Condition for conditional setting must be present");
|
||||
}
|
||||
|
||||
const auto propertyIt = properties.find (source);
|
||||
|
||||
if (propertyIt != properties.end ()) {
|
||||
sourceProperty = propertyIt->second;
|
||||
}
|
||||
|
||||
if (sourceProperty == nullptr) {
|
||||
sLog.error ("Cannot find property ", source, " to get value from for user setting value, using default value: (", defaultValue.x, ",", defaultValue.y, ",", defaultValue.z, ")");
|
||||
}
|
||||
} else {
|
||||
sLog.error ("Vector property doesn't have user member, this could mean an scripted value");
|
||||
}
|
||||
|
||||
if (animation != data.end ()) {
|
||||
sLog.error ("Detected a setting with animation data, which is not supported yet!");
|
||||
}
|
||||
} else {
|
||||
if (!data.is_string ())
|
||||
sLog.exception ("Expected vector value on user settings");
|
||||
|
||||
defaultValue = WallpaperEngine::Core::aToColorf (data.get<std::string> ().c_str ());
|
||||
}
|
||||
|
||||
return new CUserSettingVector3 (hasCondition, defaultValue, sourceProperty, expectedValue);
|
||||
}
|
||||
|
||||
const CUserSettingVector3* CUserSettingVector3::fromScalar (const glm::vec3 value) {
|
||||
return new CUserSettingVector3 (false, value, nullptr, "");
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
#include "CUserSettingValue.h"
|
||||
|
||||
namespace WallpaperEngine::Core::Projects {
|
||||
class CProperty;
|
||||
}
|
||||
|
||||
namespace WallpaperEngine::Core::UserSettings {
|
||||
class CUserSettingVector3 : public CUserSettingValue {
|
||||
public:
|
||||
typedef glm::vec3 data_type;
|
||||
|
||||
static const CUserSettingVector3* fromJSON (const nlohmann::json& data, const std::map <std::string, std::shared_ptr <Projects::CProperty>>& properties);
|
||||
static const CUserSettingVector3* fromScalar (glm::vec3 value);
|
||||
|
||||
private:
|
||||
CUserSettingVector3 (
|
||||
bool hasCondition, glm::vec3 defaultValue, std::shared_ptr<const Projects::CProperty> source,
|
||||
std::string expectedValue);
|
||||
|
||||
const bool m_hasCondition;
|
||||
const std::shared_ptr <const Projects::CProperty> m_source;
|
||||
const std::string m_expectedValue;
|
||||
};
|
||||
} // namespace WallpaperEngine::Core::UserSettings
|
@ -8,12 +8,12 @@ using namespace WallpaperEngine::Data::Model;
|
||||
class UserSettingBuilder {
|
||||
public:
|
||||
template <typename T>
|
||||
static UserSettingSharedPtr fromValue (T defaultValue) {
|
||||
static UserSettingUniquePtr fromValue (T defaultValue) {
|
||||
DynamicValueUniquePtr value = std::make_unique <DynamicValue> ();
|
||||
|
||||
value->update (defaultValue);
|
||||
|
||||
return std::make_shared <UserSetting> (UserSetting {
|
||||
return std::make_unique <UserSetting> (UserSetting {
|
||||
.value = std::move (value),
|
||||
.property = PropertyWeakPtr (),
|
||||
.condition = std::nullopt,
|
||||
|
@ -191,7 +191,7 @@ void StringPrinter::printImageEffectPassOverride (const ImageEffectPassOverride&
|
||||
|
||||
for (const auto& constant : imageEffectPass.constants) {
|
||||
this->lineEnd ();
|
||||
this->m_out << "Constant " << constant.first << "=" << constant.second->toString();
|
||||
this->m_out << "Constant " << constant.first << "=" << constant.second->value->toString();
|
||||
}
|
||||
|
||||
this->decreaseIndentation ();
|
||||
|
@ -5,7 +5,7 @@
|
||||
using namespace WallpaperEngine::Data::JSON;
|
||||
using namespace WallpaperEngine::Data::Model;
|
||||
|
||||
UserSettingSharedPtr JsonExtensions::user (const std::string& key, const Properties& properties) const {
|
||||
UserSettingUniquePtr JsonExtensions::user (const std::string& key, const Properties& properties) const {
|
||||
const auto value = this->require (key, "User setting without default value must be present");
|
||||
|
||||
return UserSettingParser::parse (value, properties);
|
||||
|
@ -130,9 +130,9 @@ class JsonExtensions {
|
||||
|
||||
return (*it);
|
||||
}
|
||||
[[nodiscard]] UserSettingSharedPtr user (const std::string& key, const Properties& properties) const;
|
||||
[[nodiscard]] UserSettingUniquePtr user (const std::string& key, const Properties& properties) const;
|
||||
template <typename T>
|
||||
[[nodiscard]] UserSettingSharedPtr user (const std::string& key, const Properties& properties, T defaultValue) const {
|
||||
[[nodiscard]] UserSettingUniquePtr user (const std::string& key, const Properties& properties, T defaultValue) const {
|
||||
const auto value = this->optional (key);
|
||||
|
||||
if (!value.has_value ()) {
|
||||
|
@ -4,13 +4,6 @@
|
||||
|
||||
#include "WallpaperEngine/Assets/CContainer.h"
|
||||
#include "WallpaperEngine/Core/DynamicValues/CDynamicValue.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h"
|
||||
#include "WallpaperEngine/Core/Projects/CProperty.h"
|
||||
|
||||
namespace WallpaperEngine::Data::Model {
|
||||
@ -35,13 +28,6 @@ struct ModelStruct;
|
||||
|
||||
// TODO: REMOVE ONCE THESE ARE RENAMED AND MOVED
|
||||
using Container = WallpaperEngine::Assets::CContainer;
|
||||
using ShaderConstant = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstant;
|
||||
using ShaderConstantProperty = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantProperty;
|
||||
using ShaderConstantFloat = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantFloat;
|
||||
using ShaderConstantInteger = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantInteger;
|
||||
using ShaderConstantVector2 = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantVector2;
|
||||
using ShaderConstantVector3 = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantVector3;
|
||||
using ShaderConstantVector4 = WallpaperEngine::Core::Objects::Effects::Constants::CShaderConstantVector4;
|
||||
|
||||
using Property = WallpaperEngine::Core::Projects::CProperty;
|
||||
using PropertySharedPtr = std::shared_ptr <Property>;
|
||||
@ -52,11 +38,11 @@ using DynamicValueUniquePtr = std::unique_ptr <DynamicValue>;
|
||||
using DynamicValueSharedPtr = std::shared_ptr <DynamicValue>;
|
||||
using DynamicValueWeakPtr = std::weak_ptr <DynamicValue>;
|
||||
using UserSettingSharedPtr = std::shared_ptr <UserSetting>;
|
||||
using UserSettingUniquePtr = std::unique_ptr <UserSetting>;
|
||||
using UserSettingWeakPtr = std::weak_ptr <UserSetting>;
|
||||
using ShaderConstantUniquePtr = std::unique_ptr <ShaderConstant>;
|
||||
// TODO: UP TO THIS POINT
|
||||
|
||||
using ShaderConstantMap = std::map <std::string, ShaderConstantUniquePtr>;
|
||||
using ShaderConstantMap = std::map <std::string, UserSettingUniquePtr>;
|
||||
|
||||
using ProjectUniquePtr = std::unique_ptr <Project>;
|
||||
using WallpaperUniquePtr = std::unique_ptr <Wallpaper>;
|
||||
|
@ -27,5 +27,6 @@ struct UserSetting {
|
||||
PropertyWeakPtr property;
|
||||
/** Condition required for this setting, this should be possible to run in JS' V8 */
|
||||
std::optional <ConditionInfo> condition;
|
||||
/** TODO: Value might come from a script and not have conditions, implement this later */
|
||||
};
|
||||
} // namespace WallpaperEngine::Data::Model
|
@ -44,7 +44,7 @@ struct SceneData {
|
||||
struct {
|
||||
glm::vec3 ambient;
|
||||
glm::vec3 skylight;
|
||||
UserSettingSharedPtr clear;
|
||||
UserSettingUniquePtr clear;
|
||||
} colors;
|
||||
/**
|
||||
* Camera configuration
|
||||
@ -60,11 +60,11 @@ struct SceneData {
|
||||
*/
|
||||
struct {
|
||||
/** If bloom is enabled or not */
|
||||
UserSettingSharedPtr enabled;
|
||||
UserSettingUniquePtr enabled;
|
||||
/** Bloom's strength to pass onto the shader */
|
||||
UserSettingSharedPtr strength;
|
||||
UserSettingUniquePtr strength;
|
||||
/** Bloom's threshold to pass onto the shader */
|
||||
UserSettingSharedPtr threshold;
|
||||
UserSettingUniquePtr threshold;
|
||||
} bloom;
|
||||
/**
|
||||
* Parallax effect configuration
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "ShaderConstantParser.h"
|
||||
|
||||
#include "WallpaperEngine/Data/Parsers/UserSettingParser.h"
|
||||
#include "WallpaperEngine/Data/Model/Project.h"
|
||||
|
||||
using namespace WallpaperEngine::Data::Parsers;
|
||||
@ -10,68 +11,11 @@ ShaderConstantMap ShaderConstantParser::parse (const JSON& it, Project& project)
|
||||
return {};
|
||||
}
|
||||
|
||||
std::map <std::string, ShaderConstantUniquePtr> result = {};
|
||||
ShaderConstantMap result = {};
|
||||
|
||||
for (const auto& cur : it.items ()) {
|
||||
result.emplace (cur.key(), parseConstant (cur.value(), project));
|
||||
result.emplace (cur.key(), UserSettingParser::parse (cur.value(), project.properties));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ShaderConstantUniquePtr ShaderConstantParser::parseConstant (const JSON& it, Project& project) {
|
||||
ShaderConstant* constant = nullptr;
|
||||
auto valueIt = it;
|
||||
|
||||
if (it.is_object ()) {
|
||||
auto user = it.find ("user");
|
||||
auto value = it.find ("value");
|
||||
|
||||
if (user == it.end () && value == it.end ()) {
|
||||
sLog.error (R"(Found object for shader constant without "value" and "user" setting)");
|
||||
return ShaderConstantUniquePtr (constant);
|
||||
}
|
||||
|
||||
if (user != it.end () && user->is_string ()) {
|
||||
const auto& properties = project.properties;
|
||||
const auto& propertyIt = properties.find (*user);
|
||||
|
||||
if (propertyIt != properties.end ()) {
|
||||
constant = new ShaderConstantProperty (propertyIt->second);
|
||||
} else {
|
||||
sLog.error ("Shader constant pointing to non-existant project property: ", user->get <std::string> ());
|
||||
}
|
||||
} else {
|
||||
valueIt = *value;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: REFACTOR THIS, SAME OLD THING WE HAD BEFORE, THESE SHADERCONSTANT CLASSES HAVE TO GO AND WE SHOULD HAVE JUST ONE
|
||||
if (constant == nullptr) {
|
||||
if (valueIt.is_number_float ()) {
|
||||
constant = new ShaderConstantFloat (valueIt);
|
||||
} else if (valueIt.is_number_integer ()) {
|
||||
constant = new ShaderConstantInteger (valueIt);
|
||||
} else if (valueIt.is_string ()) {
|
||||
// TODO: USE VECTOR PARSER HERE? MAKE USE OF CDYNAMICVALUE FOR SHADERCONSTANTS TOO
|
||||
|
||||
// count the number of spaces to determine which type of vector we have
|
||||
std::string value = valueIt;
|
||||
|
||||
size_t spaces =
|
||||
std::count_if (value.begin (), value.end (), [&] (const auto& item) { return item == ' '; });
|
||||
|
||||
if (spaces == 1) {
|
||||
constant = new ShaderConstantVector2 (valueIt);
|
||||
} else if (spaces == 2) {
|
||||
constant = new ShaderConstantVector3 (valueIt);
|
||||
} else if (spaces == 3) {
|
||||
constant = new ShaderConstantVector4 (valueIt);
|
||||
} else {
|
||||
sLog.exception ("unknown shader constant type ", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ShaderConstantUniquePtr (constant);
|
||||
}
|
@ -10,6 +10,5 @@ using namespace WallpaperEngine::Data::Model;
|
||||
class ShaderConstantParser {
|
||||
public:
|
||||
static ShaderConstantMap parse (const JSON& it, Project& project);
|
||||
static ShaderConstantUniquePtr parseConstant (const JSON& it, Project& project);
|
||||
};
|
||||
} // namespace WallpaperEngine::Data::Parsers
|
||||
|
@ -5,19 +5,26 @@
|
||||
using namespace WallpaperEngine::Data::Parsers;
|
||||
using namespace WallpaperEngine::Data::Builders;
|
||||
|
||||
UserSettingSharedPtr UserSettingParser::parse (const json& data, const Properties& properties) {
|
||||
UserSettingUniquePtr UserSettingParser::parse (const json& data, const Properties& properties) {
|
||||
DynamicValueUniquePtr value = std::make_unique <DynamicValue> ();
|
||||
PropertyWeakPtr property;
|
||||
std::optional<ConditionInfo> condition;
|
||||
auto valueIt = data;
|
||||
std::string content = data.dump ();
|
||||
|
||||
if (data.is_object ()) {
|
||||
const auto user = data.optional ("user");
|
||||
const auto script = data.optional ("script");
|
||||
valueIt = data.require ("value", "User setting must have a value");
|
||||
|
||||
if (user.has_value ()) {
|
||||
// TODO: PARSE SCRIPT VALUES
|
||||
if (script.has_value () && !script->is_null ()) {
|
||||
sLog.error ("Found user setting with script value: ", script.value ().dump ());
|
||||
}
|
||||
|
||||
if (user.has_value () && !user->is_null ()) {
|
||||
std::string source;
|
||||
const auto& it = user.value ();
|
||||
const auto& it = *user;
|
||||
|
||||
if (it.is_string ()) {
|
||||
source = it;
|
||||
@ -61,7 +68,7 @@ UserSettingSharedPtr UserSettingParser::parse (const json& data, const Propertie
|
||||
sLog.exception ("Unsupported user setting type ", valueIt.type_name ());
|
||||
}
|
||||
|
||||
return std::make_shared <UserSetting> (UserSetting {
|
||||
return std::make_unique <UserSetting> (UserSetting {
|
||||
.value = std::move (value),
|
||||
.property = property,
|
||||
.condition = condition,
|
||||
|
@ -11,6 +11,6 @@ using namespace WallpaperEngine::Data::Model;
|
||||
|
||||
class UserSettingParser {
|
||||
public:
|
||||
static UserSettingSharedPtr parse (const json& data, const Properties& properties);
|
||||
static UserSettingUniquePtr parse (const json& data, const Properties& properties);
|
||||
};
|
||||
} // namespace WallpaperEngine::Data::Parsers
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "CImage.h"
|
||||
#include <sstream>
|
||||
|
||||
#include "WallpaperEngine/Core/UserSettings/CUserSettingBoolean.h"
|
||||
#include "WallpaperEngine/Data/Parsers/MaterialParser.h"
|
||||
#include "WallpaperEngine/Data/Builders/UserSettingBuilder.h"
|
||||
#include "WallpaperEngine/Data/Model/Object.h"
|
||||
|
@ -23,21 +23,12 @@
|
||||
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariableVector3.h"
|
||||
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariableVector4.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantProperty.h"
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
using namespace WallpaperEngine;
|
||||
using namespace WallpaperEngine::Render;
|
||||
using namespace WallpaperEngine::Render::Objects;
|
||||
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
|
||||
using namespace WallpaperEngine::Render::Shaders::Variables;
|
||||
using namespace WallpaperEngine::Render::Objects::Effects;
|
||||
|
||||
@ -725,7 +716,7 @@ void CPass::setupShaderVariables () {
|
||||
|
||||
// this takes care of all possible casts, even invalid ones, which will use whatever default behaviour
|
||||
// of the underlying CDynamicValue used for the value
|
||||
this->addUniform (var, value.get ());
|
||||
this->addUniform (var, value->value.get ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "WallpaperEngine/Assets/ITexture.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h"
|
||||
#include "WallpaperEngine/Core/UserSettings/CUserSettingValue.h"
|
||||
#include "WallpaperEngine/Render/CFBO.h"
|
||||
#include "WallpaperEngine/Render/CFBOProvider.h"
|
||||
#include "WallpaperEngine/Render/Helpers/CContextAware.h"
|
||||
@ -20,7 +18,6 @@ namespace WallpaperEngine::Render::Objects::Effects {
|
||||
using namespace WallpaperEngine::Assets;
|
||||
using namespace WallpaperEngine::Render::Shaders::Variables;
|
||||
using namespace WallpaperEngine::Core::Projects;
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
using namespace WallpaperEngine::Data::Model;
|
||||
|
||||
class CPass final : public Helpers::CContextAware {
|
||||
|
@ -3,9 +3,6 @@
|
||||
#include <utility>
|
||||
|
||||
// shader compiler
|
||||
#include <WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h>
|
||||
#include <WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h>
|
||||
#include <WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h>
|
||||
#include <WallpaperEngine/Render/Shaders/CShader.h>
|
||||
#include <regex>
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "WallpaperEngine/Assets/CContainer.h"
|
||||
#include "WallpaperEngine/Assets/ITexture.h"
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h"
|
||||
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariable.h"
|
||||
|
||||
#include "CShaderUnit.h"
|
||||
@ -18,7 +17,6 @@
|
||||
namespace WallpaperEngine::Render::Shaders {
|
||||
using json = nlohmann::json;
|
||||
using namespace WallpaperEngine::Assets;
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
using namespace WallpaperEngine::Data::Model;
|
||||
|
||||
/**
|
||||
|
@ -6,12 +6,6 @@
|
||||
#include <utility>
|
||||
#include "WallpaperEngine/Logging/CLog.h"
|
||||
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantFloat.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantInteger.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector2.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector3.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstantVector4.h"
|
||||
|
||||
#include "CGLSLContext.h"
|
||||
#include "WallpaperEngine/Assets/CAssetLoadException.h"
|
||||
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariable.h"
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "CGLSLContext.h"
|
||||
#include "WallpaperEngine/Assets/CContainer.h"
|
||||
#include "WallpaperEngine/Core/Core.h"
|
||||
#include "WallpaperEngine/Core/Objects/Effects/Constants/CShaderConstant.h"
|
||||
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariable.h"
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
@ -16,7 +15,6 @@
|
||||
namespace WallpaperEngine::Render::Shaders {
|
||||
using json = nlohmann::json;
|
||||
using namespace WallpaperEngine::Assets;
|
||||
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
|
||||
using namespace WallpaperEngine::Data::Model;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user