[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16725] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: corrected texture loading feedback, removed paper textures from the project

Maxime Curioni maxime.curioni at gmail.com
Thu Sep 25 18:35:54 CEST 2008


Revision: 16725
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16725
Author:   mxcurioni
Date:     2008-09-25 18:35:53 +0200 (Thu, 25 Sep 2008)

Log Message:
-----------
soc-2008-mxcurioni: corrected texture loading feedback, removed paper textures from the project

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRenderer.h

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript	2008-09-25 16:35:53 UTC (rev 16725)
@@ -8,7 +8,7 @@
 
 incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../python '
 incs += '../render/extern/include ../render/intern/include ../include ../src'
-incs += ' #/extern/glew/include'
+incs += ' #/extern/glew/include #/intern/guardedalloc'
 incs += ' ' + env['BF_PYTHON_INC']	
 incs += ' ' + env['BF_PNG_INC']
 

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp	2008-09-25 16:35:53 UTC (rev 16725)
@@ -265,27 +265,6 @@
   
   glBlendFunc(GL_DST_COLOR, GL_ZERO);
   
-  if(_drawPaper)
-  {
-    glEnable(GL_BLEND);
-    glEnable(GL_TEXTURE_2D);
-    float zfar = _pViewer->zfar();
-    zfar = zfar+0.1*zfar;
-    //draw background paper // FIXME
-    //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-    glBindTexture(GL_TEXTURE_2D, StrokeRenderer::_textureManager->getPaperTextureIndex(_paperTextureIndex)); 
-    glColor4f(1,1,1,0.0);
-    glBegin(GL_TRIANGLE_STRIP);
-    { 
-      glTexCoord2f(0,0); glVertex3f(0, 0, -1);
-      glTexCoord2f(4,0); glVertex3f(2048, 0, -1);
-      glTexCoord2f(0,4); glVertex3f(0, 2048, -1);
-      glTexCoord2f(4,4); glVertex3f(2048, 2048, -1);
-    } 
-    glEnd();
-  }
-  
   glPushAttrib(GL_COLOR_BUFFER_BIT);
   glBlendEquation(GL_FUNC_SUBTRACT);
   glBlendFunc(GL_ONE, GL_ONE);
@@ -362,26 +341,6 @@
   }
 
   glBlendFunc(GL_DST_COLOR, GL_ZERO);
-  if(_drawPaper)
-  {
-    glEnable(GL_BLEND);
-    glEnable(GL_TEXTURE_2D);
-    float zfar = _pViewer->zfar();
-    zfar = zfar+0.1*zfar;
-    //draw background paper // FIXME
-    //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-    glBindTexture(GL_TEXTURE_2D, StrokeRenderer::_textureManager->getPaperTextureIndex(_paperTextureIndex)); 
-    glColor4f(1,1,1,0.0);
-    glBegin(GL_TRIANGLE_STRIP);
-    { 
-      glTexCoord2f(0,0); glVertex3f(0, 0, -1);
-      glTexCoord2f(4,0); glVertex3f(2048, 0, -1);
-      glTexCoord2f(0,4); glVertex3f(0, 2048, -1);
-      glTexCoord2f(4,4); glVertex3f(2048, 2048, -1);
-    } 
-    glEnd();
-  }
 
   glDisable(GL_DEPTH_TEST);
   glPushAttrib(GL_COLOR_BUFFER_BIT);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp	2008-09-25 16:35:53 UTC (rev 16725)
@@ -57,9 +57,6 @@
 	_HelpIndexPath = _ProjectDir + string(DIR_SEP.c_str()) + "doc"
 			+ string(DIR_SEP.c_str()) + "html" + string(DIR_SEP.c_str())
 			+ "index.html";
-	_PapersDir = _ProjectDir + string(DIR_SEP.c_str()) + "data"
-			+ string(DIR_SEP.c_str()) + "textures" + string(DIR_SEP.c_str())
-			+ "papers" + string(DIR_SEP.c_str());
 	_EnvMapDir = _ProjectDir + string(DIR_SEP.c_str()) + "data"
 			+ string(DIR_SEP.c_str()) + "env_map" + string(DIR_SEP.c_str());
 	_MapsDir = _ProjectDir + string(DIR_SEP.c_str()) + "data"

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.h	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.h	2008-09-25 16:35:53 UTC (rev 16725)
@@ -46,7 +46,6 @@
     string _PythonPath;
     string _BrowserCmd;
     string _HelpIndexPath;
-    string _PapersDir;
     string _EnvMapDir;
     string _MapsDir;
     string _HomeDir;
@@ -65,7 +64,6 @@
     const string& getPythonPath() const {return _PythonPath;}
     const string& getBrowserCmd() const {return _BrowserCmd;}
     const string& getHelpIndexpath() const {return _HelpIndexPath;}
-    const string& getPapersDir() const {return _PapersDir;}
     const string& getEnvMapDir() const {return _EnvMapDir;}
     const string& getMapsDir() const {return _MapsDir;}
     const string& getHomeDir() const {return _HomeDir;}
@@ -102,10 +100,6 @@
   static const real DEFAULT_SPHERE_RADIUS = 1.0;
   static const real DEFAULT_DKR_EPSILON = 0.0;
 
-  // Papers
-  static const string DEFAULT_PAPER_TEXTURE("whitepaper.jpg");
-
-
 } // End of namepace Config
 
 #endif // APP_CONFIG_H

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp	2008-09-25 16:35:53 UTC (rev 16725)
@@ -988,16 +988,6 @@
   return dir;
 }
 
-void		Controller::setPapersDir(const string& dir) {
-  //_current_dirs->setValue("papers/dir", dir);
-}
-
-string		Controller::getPapersDir() const {
-  string dir = Config::Path::getInstance()->getPapersDir();
-  //_current_dirs->getValue("papers/dir", dir);
-  return dir;
-}
-
 void		Controller::setHelpIndex(const string& index) {
   _help_index = index;
 }
@@ -1077,11 +1067,6 @@
 	// Visibility
 	setQuantitativeInvisibility(true);
 
-	 // Papers Textures
-	vector<string> sl;
-	sl.push_back( StringUtils::toAscii( cpath->getPapersDir() + Config::DEFAULT_PAPER_TEXTURE ) );
-	TextureManager::Options::setPaperTextures( sl );
-
 	// Drawing Buffers
 	setFrontBufferFlag(false);
 	setBackBufferFlag(true);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.h	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.h	2008-09-25 16:35:53 UTC (rev 16725)
@@ -132,8 +132,6 @@
   string	getModelsDir() const;
   void		setModulesDir(const string& dir);
   string	getModulesDir() const;
-  void		setPapersDir(const string& dir);
-  string	getPapersDir() const;
   void		setHelpIndex(const string& dir);
   string	getHelpIndex() const;
   void		setBrowserCmd(const string& cmd);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp	2008-09-25 16:35:53 UTC (rev 16725)
@@ -5,7 +5,7 @@
 #include "BPy_Id.h"
 #include "BPy_IntegrationType.h"
 #include "BPy_Interface0D.h"
-#include "Interface0D/BPy_CurvePoint.cpp"
+#include "Interface0D/BPy_CurvePoint.h"
 #include "Interface0D/CurvePoint/BPy_StrokeVertex.h"
 #include "Interface0D/BPy_SVertex.h"
 #include "Interface0D/BPy_ViewVertex.h"

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp	2008-09-25 16:19:07 UTC (rev 16724)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp	2008-09-25 16:35:53 UTC (rev 16725)
@@ -31,6 +31,7 @@
 #include "BLI_blenlib.h"
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
+#include "MEM_guardedalloc.h"
 }
 
 #include "../system/StringUtils.h"
@@ -112,7 +113,6 @@
 
   //first texture, basically the only one for lighter strokes
   glBindTexture(GL_TEXTURE_2D, iStrokeRep->getTextureId()); 
-  //glBindTexture(GL_TEXTURE_2D, _textureManager.getPaperTextureIndex()); 
   
   vector<Strip*>& strips = iStrokeRep->getStrips();
   for(vector<Strip*>::iterator s=strips.begin(), send=strips.end();
@@ -173,7 +173,6 @@
 
   //first texture, basically the only one for lighter strokes
   glBindTexture(GL_TEXTURE_2D, iStrokeRep->getTextureId()); 
-  //glBindTexture(GL_TEXTURE_2D, _textureManager.getPaperTextureIndex()); 
   
   vector<Strip*>& strips = iStrokeRep->getStrips();
   for(vector<Strip*>::iterator s=strips.begin(), send=strips.end();
@@ -272,29 +271,6 @@
 {
 }
 
-void
-GLTextureManager::loadPapers ()
-{
-  unsigned size = _papertextures.size();
-  _papertexname = new unsigned[size];
-  GLuint *tmp = new GLuint[size];
-  glGenTextures(size, tmp);
-  for(unsigned i=0;i<size;++i){
-    _papertexname[i] = tmp[i];
-  }
-  delete [] tmp;
-
-  // Papers textures
-  cout << "Loading papers textures..." << endl;
-
-  for (unsigned i = 0; i < size; i++){
-	cout << i << ": " << _papertextures[i] << endl;
-	preparePaper(_papertextures[i].c_str(), _papertexname[i]);
-  }
-
-  cout << "Done." << endl << endl;
-}
-
 void GLTextureManager::loadStandardBrushes()
 {
   //  getBrushTextureIndex(TEXTURES_DIR "/brushes/charcoalAlpha.bmp", Stroke::HUMID_MEDIUM);
@@ -356,12 +332,11 @@
 	char * name = (char *) sname.c_str();
 	
   //soc 
-  // QImage qim(name);
-  // QFileInfo fi(name);
-  // QString filename = fi.fileName();
 	ImBuf *qim = IMB_loadiffname(name, 0);
 	char filename[FILE_MAXFILE];
-	BLI_splitdirstring(name, filename);
+	char *p = BLI_strdup(name);
+	BLI_splitdirstring(p, filename);
+	MEM_freeN(p);
 
 //soc  if (qim.isNull()) 
   if (!qim) //soc 
@@ -394,7 +369,7 @@
 	       GL_ALPHA, GL_UNSIGNED_BYTE, qim->rect);	//soc
 
   //soc cout << "  \"" << filename.toAscii().data() << "\" loaded with "<< qim.depth() << " bits per pixel" << endl;
-	cout << "  \"" << StringUtils::toAscii(filename) << "\" loaded with "<< qim->depth << " bits per pixel" << endl;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list