chore: fix inconsistencies

This commit is contained in:
Almamu 2025-09-02 00:55:28 +02:00
parent bf74a94420
commit bf44e7d7f0
8 changed files with 16 additions and 19 deletions

View File

@ -29,6 +29,7 @@ struct EffectPass {
/** The target this material renders to (if specified) */ /** The target this material renders to (if specified) */
std::optional <std::string> target; std::optional <std::string> target;
}; };
struct Effect { struct Effect {
/** Effect's name for the UI */ /** Effect's name for the UI */
std::string name; std::string name;

View File

@ -7,13 +7,14 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "Types.h" #include "Types.h"
#include "Effect.h" #include "UserSetting.h"
#include "Material.h" #include "Material.h"
#include "Model.h" #include "Model.h"
#include "Effect.h"
#include "WallpaperEngine/Data/Utils/TypeCaster.h" #include "WallpaperEngine/Data/Utils/TypeCaster.h"
namespace WallpaperEngine::Data::Model { namespace WallpaperEngine::Data::Model {
using TypeCaster = WallpaperEngine::Data::Utils::TypeCaster; using namespace WallpaperEngine::Data::Utils;
struct ObjectData { struct ObjectData {
int id; int id;
@ -48,7 +49,7 @@ struct ImageEffectPassOverride {
int id; int id;
ComboMap combos; ComboMap combos;
ShaderConstantMap constants; ShaderConstantMap constants;
std::map <int, std::string> textures; TextureMap textures;
}; };
/** /**

View File

@ -10,7 +10,6 @@ namespace WallpaperEngine::Data::Model {
* Represents a wallpaper engine project * Represents a wallpaper engine project
*/ */
struct Project { struct Project {
public:
enum Type { enum Type {
Type_Scene = 0, Type_Scene = 0,
Type_Web = 1, Type_Web = 1,

View File

@ -60,7 +60,7 @@ class PropertyBoolean : public Property {
class PropertyColor : public Property { class PropertyColor : public Property {
public: public:
explicit PropertyColor (PropertyData data, std::string value) : Property (std::move(data)) { explicit PropertyColor (PropertyData data, std::string value) : Property (std::move(data)) {
this->update (value); this->PropertyColor::update (value);
} }
using Property::update; using Property::update;
@ -113,7 +113,7 @@ class PropertyColor : public Property {
class PropertyCombo : public Property, ComboData { class PropertyCombo : public Property, ComboData {
public: public:
PropertyCombo (PropertyData data, ComboData comboData, std::string value) : Property (std::move(data)), ComboData (std::move(comboData)) { PropertyCombo (PropertyData data, ComboData comboData, std::string value) : Property (std::move(data)), ComboData (std::move(comboData)) {
this->update (value); this->PropertyCombo::update (value);
} }
using Property::update; using Property::update;
@ -139,7 +139,7 @@ class PropertyText : public Property {
class PropertySceneTexture : public Property { class PropertySceneTexture : public Property {
public: public:
explicit PropertySceneTexture (PropertyData data, std::string value) : Property (std::move(data)) { explicit PropertySceneTexture (PropertyData data, std::string value) : Property (std::move(data)) {
this->update (value); this->PropertySceneTexture::update (value);
} }
void update(const std::string& value) override { void update(const std::string& value) override {

View File

@ -14,7 +14,7 @@ class Wallpaper;
class Scene; class Scene;
class Web; class Web;
class Video; class Video;
class UserSetting; struct UserSetting;
class Object; class Object;
class Sound; class Sound;
class Image; class Image;

View File

@ -8,12 +8,11 @@
namespace WallpaperEngine::Data::Model { namespace WallpaperEngine::Data::Model {
struct ConditionInfo { struct ConditionInfo {
public:
std::string name; std::string name;
std::string condition; std::string condition;
}; };
struct UserSetting { struct UserSetting {
public:
/** /**
* The value of this setting, can be a few different things: * The value of this setting, can be a few different things:
* - a value connected to the property * - a value connected to the property

View File

@ -8,11 +8,9 @@
#include "Types.h" #include "Types.h"
#include "Object.h" #include "Object.h"
#include "WallpaperEngine/Data/Utils/TypeCaster.h" #include "WallpaperEngine/Data/Utils/TypeCaster.h"
#include "WallpaperEngine/Data/JSON.h"
namespace WallpaperEngine::Data::Model { namespace WallpaperEngine::Data::Model {
using json = WallpaperEngine::Data::JSON::JSON; using namespace WallpaperEngine::Data::Utils;
using TypeCaster = WallpaperEngine::Data::Utils::TypeCaster;
struct WallpaperData { struct WallpaperData {
std::string filename; std::string filename;
@ -110,10 +108,8 @@ struct SceneData {
class Scene : public Wallpaper, public SceneData { class Scene : public Wallpaper, public SceneData {
public: public:
explicit Scene (WallpaperData data, SceneData sceneData) noexcept : SceneData (std::move(sceneData)), Wallpaper (data) {} explicit Scene (WallpaperData data, SceneData sceneData) noexcept : Wallpaper (std::move (data)), SceneData (std::move (sceneData)) {}
~Scene () override = default; ~Scene () override = default;
// TODO: ADD OBJECTS HERE
}; };
} // namespace WallpaperEngine::Data::Model } // namespace WallpaperEngine::Data::Model

View File

@ -17,6 +17,7 @@ using namespace WallpaperEngine::Render;
using namespace WallpaperEngine::Data::Model; using namespace WallpaperEngine::Data::Model;
using namespace WallpaperEngine::Data::Parsers; using namespace WallpaperEngine::Data::Parsers;
using namespace WallpaperEngine::Render::Wallpapers; using namespace WallpaperEngine::Render::Wallpapers;
using JSON = WallpaperEngine::Data::JSON::JSON;
CScene::CScene ( CScene::CScene (
const Wallpaper& wallpaper, CRenderContext& context, CAudioContext& audioContext, const Wallpaper& wallpaper, CRenderContext& context, CAudioContext& audioContext,
@ -88,7 +89,7 @@ CScene::CScene (
const auto bloomOrigin = glm::vec3 { sceneWidth / 2, sceneHeight / 2, 0.0f }; const auto bloomOrigin = glm::vec3 { sceneWidth / 2, sceneHeight / 2, 0.0f };
const auto bloomSize = glm::vec2 { sceneWidth, sceneHeight }; const auto bloomSize = glm::vec2 { sceneWidth, sceneHeight };
const nlohmann::json bloom = { const JSON bloom = {
{"image", "models/wpenginelinux.json"}, {"image", "models/wpenginelinux.json"},
{"name", "bloomimagewpenginelinux"}, {"name", "bloomimagewpenginelinux"},
{"visible", true}, {"visible", true},
@ -98,14 +99,14 @@ CScene::CScene (
{"size", std::to_string (bloomSize.x) + " " + std::to_string (bloomSize.y)}, {"size", std::to_string (bloomSize.x) + " " + std::to_string (bloomSize.y)},
{"id", -1}, {"id", -1},
{"effects", {"effects",
json::array ( JSON::array (
{ {
{ {
{"file", "effects/wpenginelinux/bloomeffect.json"}, {"file", "effects/wpenginelinux/bloomeffect.json"},
{"id", 15242000}, {"id", 15242000},
{"name", ""}, {"name", ""},
{"passes", {"passes",
json::array ( JSON::array (
{ {
{ {
{"constantshadervalues", {"constantshadervalues",