diff options
Diffstat (limited to 'source/blender/freestyle/intern/stroke/Stroke.h')
-rw-r--r-- | source/blender/freestyle/intern/stroke/Stroke.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h index 66dc5a1acf4..27a105bb1cc 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.h +++ b/source/blender/freestyle/intern/stroke/Stroke.h @@ -43,6 +43,14 @@ #include "MEM_guardedalloc.h" #endif +extern "C" { +#include "DNA_material_types.h" +} + +#ifndef MAX_MTEX +#define MAX_MTEX 18 +#endif + namespace Freestyle { // @@ -528,9 +536,11 @@ private: float _Length; // The stroke length viewedge_container _ViewEdges; float _sampling; + float _textureStep; // StrokeRenderer *_renderer; // mark implementation OpenGL renderer MediumType _mediumType; unsigned int _textureId; + MTex *_mtex[MAX_MTEX]; bool _tips; Vec2r _extremityOrientations[2]; // the orientations of the first and last extermity StrokeRep *_rep; @@ -635,6 +645,13 @@ public: /*! Returns the id of the texture used to simulate th marks system for this Stroke */ inline unsigned int getTextureId() {return _textureId;} + /*! Returns the spacing of texture coordinates along the stroke lenght */ + inline float getTextureStep() {return _textureStep;} + + /*! Returns the texture used at given index to simulate the marks system for this Stroke */ + inline MTex *getMTex(int idx) { + return _mtex[idx];} + /*! Returns true if this Stroke uses a texture with tips, false otherwise. */ inline bool hasTips() const { @@ -725,6 +742,25 @@ public: _textureId = id; } + /*! sets the spacing of texture coordinates along the stroke lenght. */ + inline void setTextureStep(float step) + { + _textureStep = step; + } + + /*! assigns a blender texture to the first available slot. */ + inline int setMTex(MTex *mtex) + { + for (int a = 0; a < MAX_MTEX; a++) { + if (!_mtex[a]) { + _mtex[a] = mtex; + + return 0; + } + } + return -1; /* no free slots */ + } + /*! sets the flag telling whether this stroke is using a texture with tips or not. */ inline void setTips(bool iTips) { |