Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-09-25 20:35:53 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-09-25 20:35:53 +0400
commit4be21b18f83a7606fdb764caa537e42ec9aa72fc (patch)
treebddf912a7cb5a05a1540c2a7b2038136444b3390 /source/blender/freestyle/intern/stroke
parent7bb09a8a1cc188302c0aefaeed77d0d0a168cfd8 (diff)
soc-2008-mxcurioni: corrected texture loading feedback, removed paper textures from the project
Diffstat (limited to 'source/blender/freestyle/intern/stroke')
-rwxr-xr-xsource/blender/freestyle/intern/stroke/Canvas.cpp16
-rwxr-xr-xsource/blender/freestyle/intern/stroke/Canvas.h8
-rwxr-xr-xsource/blender/freestyle/intern/stroke/StrokeRenderer.cpp27
-rwxr-xr-xsource/blender/freestyle/intern/stroke/StrokeRenderer.h8
4 files changed, 2 insertions, 57 deletions
diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp
index bdca8f968fe..ee8213609dd 100755
--- a/source/blender/freestyle/intern/stroke/Canvas.cpp
+++ b/source/blender/freestyle/intern/stroke/Canvas.cpp
@@ -56,9 +56,7 @@ Canvas::Canvas()
_SelectedFEdge = 0;
_pInstance = this;
PseudoNoise::init(42);
- _paperTextureIndex = 0;
_Renderer = 0;
- _drawPaper = true;
_current_sm = NULL;
_steerableViewMap = new SteerableViewMap(NB_STEERABLE_VIEWMAP-1);
}
@@ -68,9 +66,7 @@ Canvas::Canvas(const Canvas& iBrother)
_SelectedFEdge = iBrother._SelectedFEdge;
_pInstance = this;
PseudoNoise::init(42);
- _paperTextureIndex = iBrother._paperTextureIndex;
_Renderer = iBrother._Renderer;
- _drawPaper = iBrother._drawPaper;
_current_sm = iBrother._current_sm;
_steerableViewMap = new SteerableViewMap(*(iBrother._steerableViewMap));
@@ -282,18 +278,6 @@ void Canvas::causalStyleModules(vector<unsigned>& vec, unsigned index) {
vec.push_back(i);
}
-void Canvas::changePaperTexture(bool increment)
-{
- if(increment)
- _paperTextureIndex = (_paperTextureIndex+1) % TextureManager::getPaperTexturesNumber();
- else
- {
- _paperTextureIndex--;
- if(_paperTextureIndex < 0)
- _paperTextureIndex = TextureManager::getPaperTexturesNumber() - 1;
- }
-}
-
void Canvas::Render(const StrokeRenderer *iRenderer)
{
for (unsigned i = 0; i < _StyleModules.size(); i++) {
diff --git a/source/blender/freestyle/intern/stroke/Canvas.h b/source/blender/freestyle/intern/stroke/Canvas.h
index dbcfccfd8cf..4f57cd9c36c 100755
--- a/source/blender/freestyle/intern/stroke/Canvas.h
+++ b/source/blender/freestyle/intern/stroke/Canvas.h
@@ -76,8 +76,7 @@ protected:
std::deque<StrokeLayer*> _Layers;
std::deque<StyleModule*> _StyleModules;
FEdge *_SelectedFEdge;
- int _paperTextureIndex;
- bool _drawPaper;
+
StrokeRenderer *_Renderer;
StyleModule* _current_sm;
mapsMap _maps;
@@ -171,7 +170,6 @@ public:
inline FEdge * selectedFEdge() {return _SelectedFEdge;}
virtual int width() const = 0;
virtual int height() const = 0;
- inline int currentPaperTextureIndex() const {return _paperTextureIndex;}
virtual BBox<Vec3r> scene3DBBox() const = 0;
inline const StrokeRenderer * renderer() const {return _Renderer;}
inline StyleModule* getCurrentStyleModule() { return _current_sm; }
@@ -187,10 +185,6 @@ public:
void setVisible(unsigned index, bool iVisible) ;
//inline void setDensityMap(InformationMap<RGBImage>* iMap) {_DensityMap = iMap;}
inline void AddLayer(StrokeLayer *iLayer) {_Layers.push_back(iLayer);}
- inline void setCurrentPaperTextureIndex(int i) {_paperTextureIndex = i;}
- void changePaperTexture(bool increment=true) ;
- /*! enables/disables paper texture */
- inline void togglePaperTexture() {_drawPaper = !_drawPaper;}
void resetModified(bool iMod=false);
void causalStyleModules(std::vector<unsigned>& vec, unsigned index = 0);
void setModified(unsigned index, bool b);
diff --git a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
index e747fb4f5cd..19e5ba35fed 100755
--- a/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
@@ -48,11 +48,6 @@ bool StrokeRenderer::loadTextures()
return true;
}
-// unsigned int StrokeRenderer::getPaperTextureIndex(unsigned int index)
-// {
- // return _textureManager->getPaperTextureIndex(index);
-// }
-
/**********************************/
/* */
@@ -67,9 +62,6 @@ LIB_STROKE_EXPORT
TextureManager* TextureManager::_pInstance = 0;
LIB_STROKE_EXPORT
-vector<string> TextureManager::_papertextures;
-
-LIB_STROKE_EXPORT
string TextureManager::_patterns_path;
LIB_STROKE_EXPORT
@@ -77,7 +69,6 @@ string TextureManager::_brushes_path;
TextureManager::TextureManager ()
{
- _papertexname = NULL;
_hasLoadedTextures=false;
_pInstance = this;
_defaultTextureId = 0;
@@ -85,8 +76,6 @@ TextureManager::TextureManager ()
TextureManager::~TextureManager ()
{
- if (_papertexname)
- delete _papertexname;
if(!_brushesMap.empty())
_brushesMap.clear();
_pInstance = 0;
@@ -95,8 +84,7 @@ TextureManager::~TextureManager ()
void TextureManager::load()
{
if(_hasLoadedTextures)
- return ;
- loadPapers();
+ return;
loadStandardBrushes();
_hasLoadedTextures = true;
}
@@ -116,14 +104,6 @@ unsigned TextureManager::getBrushTextureIndex(string name, Stroke::MediumType lo
}
}
-vector<string>& TextureManager::Options::getPaperTextures() {
- return _papertextures;
-}
-
-void TextureManager::Options::setPaperTextures(const vector<string>& sl) {
- _papertextures = sl;
-}
-
void TextureManager::Options::setPatternsPath(const string& path) {
_patterns_path = path;
}
@@ -139,8 +119,3 @@ void TextureManager::Options::setBrushesPath(const string& path) {
string TextureManager::Options::getBrushesPath() {
return _brushes_path;
}
-
-unsigned TextureManager::getPaperTexturesNumber() {
- return _papertextures.size();
-}
-
diff --git a/source/blender/freestyle/intern/stroke/StrokeRenderer.h b/source/blender/freestyle/intern/stroke/StrokeRenderer.h
index d192fe30145..339e401aa41 100755
--- a/source/blender/freestyle/intern/stroke/StrokeRenderer.h
+++ b/source/blender/freestyle/intern/stroke/StrokeRenderer.h
@@ -59,16 +59,12 @@ public:
static TextureManager * getInstance() {return _pInstance;}
void load () ;
unsigned getBrushTextureIndex(string name, Stroke::MediumType iType = Stroke::OPAQUE_MEDIUM) ;
- unsigned getPaperTextureIndex(unsigned i) { return _papertexname[i]; }
- static unsigned getPaperTexturesNumber();
inline bool hasLoaded() const {return _hasLoadedTextures;}
inline unsigned int getDefaultTextureId() const {return _defaultTextureId;}
struct LIB_STROKE_EXPORT Options
{
- static void setPaperTextures(const vector<string>& sl);
- static vector<string>& getPaperTextures();
static void setPatternsPath(const string& path);
static string getPatternsPath();
@@ -78,7 +74,6 @@ public:
};
protected:
- virtual void loadPapers() = 0;
virtual void loadStandardBrushes() = 0;
virtual unsigned loadBrush(string fileName, Stroke::MediumType = Stroke::OPAQUE_MEDIUM) = 0;
@@ -97,10 +92,8 @@ public:
static TextureManager * _pInstance;
bool _hasLoadedTextures;
brushesMap _brushesMap;
- unsigned* _papertexname;
static string _patterns_path;
static string _brushes_path;
- static vector<string> _papertextures;
unsigned int _defaultTextureId;
};
@@ -132,7 +125,6 @@ class LIB_STROKE_EXPORT StrokeRenderer
static bool loadTextures() ;
//static unsigned int getTextureIndex(unsigned int index) ;
- //static unsigned int getPaperTextureIndex(unsigned int index) ;
static TextureManager *_textureManager;
};