implement brush presets save and restore from file, fix stencil nullptr, limit preview stroke max size

This commit is contained in:
2019-01-23 16:53:58 +01:00
parent e26fcf1163
commit 879be9d4fe
17 changed files with 282 additions and 65 deletions

View File

@@ -8,8 +8,10 @@ class Brush
public:
Brush() = default;
Brush(const Brush& brush) = default;
int id = 0;
std::string m_name;
std::string m_brush_path;
std::string m_brush_thumb_path;
std::string m_stencil_path;
std::shared_ptr<Texture2D> m_tip_texture;
std::shared_ptr<Texture2D> m_stencil_texture;
//uint16_t m_tex_id = 0;
@@ -41,7 +43,7 @@ public:
float m_jitter_sat = 0;
float m_jitter_val = 0;
int m_blend_mode = 0;
bool load_texture(const std::string& path);
bool load_texture(const std::string& path, const std::string& thumb);
bool load_stencil(const std::string& path);
};
@@ -94,6 +96,7 @@ public:
float m_curve = 0;
float m_dist = 0;
float m_step = 0;
float m_max_size = FLT_MAX;
Camera m_camera;
std::shared_ptr<Brush> m_brush;
cbuffer<float, 3> m_curve_angles;