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

Log Message:
-----------
soc-2008-mxcurioni: incorporated Tamito Kajiyama's patch, improving robustness 
for the Win32 build on older machines. In detail, the _blendEquation variable 
from AppCanvas is replaced by a _basic variable in Canvas, determing the 
rendering mode (standard with blending or basic). This latter variable is used 
to make sure that strokes are rendered in the right mode

Modified Paths:
--------------
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.h
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h

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 17:53:15 UTC (rev 16728)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
       2008-09-25 18:02:15 UTC (rev 16729)
@@ -46,7 +46,6 @@
 :Canvas()
 {
   _pViewer = 0;
-  _blendEquation = true;
        _MapsPath = StringUtils::toAscii( 
Config::Path::getInstance()->getMapsDir() ).c_str();
 }
 
@@ -54,14 +53,12 @@
 :Canvas()
 {
   _pViewer = iViewer;
-  _blendEquation = true;
 }
 
 AppCanvas::AppCanvas(const AppCanvas& iBrother)
 :Canvas(iBrother)
 {
   _pViewer = iBrother._pViewer;
-  _blendEquation = iBrother._blendEquation;
 }
 
 AppCanvas::~AppCanvas()
@@ -118,7 +115,7 @@
        cout << "GLEW initialized" << endl;
 
        if(!glBlendEquation) {
-        _blendEquation = false;
+        _basic = true;
         cout << "glBlendEquation unavailable on this hardware -> switching to 
strokes basic rendering mode" << endl;
      }
     firsttime=false;
@@ -227,7 +224,7 @@
 
 void AppCanvas::Render(const StrokeRenderer *iRenderer)
 {
-  if(!_blendEquation){
+  if(_basic){
     RenderBasic(iRenderer);
     return;
   }
@@ -359,9 +356,13 @@
 
 
 void AppCanvas::RenderStroke(Stroke *iStroke) {
-  iStroke->Render(_Renderer);
+
+       if(_basic)
+               iStroke->RenderBasic(_Renderer);
+       else
+               iStroke->Render(_Renderer);
+
   if(_pViewer->getRecordFlag()){
-    //Sleep(1000);
      _pViewer->saveSnapshot(true);
   }
 }

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.h
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.h
 2008-09-25 17:53:15 UTC (rev 16728)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.h
 2008-09-25 18:02:15 UTC (rev 16729)
@@ -8,7 +8,6 @@
 {
 private:
   mutable AppGLWidget *_pViewer;
-  bool _blendEquation;
 public:
   AppCanvas();
   AppCanvas(AppGLWidget *iViewer);

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp   
    2008-09-25 17:53:15 UTC (rev 16728)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp   
    2008-09-25 18:02:15 UTC (rev 16729)
@@ -59,6 +59,7 @@
   _Renderer = 0;
   _current_sm = NULL;
   _steerableViewMap = new SteerableViewMap(NB_STEERABLE_VIEWMAP-1);
+  _basic = false;
 }
 
 Canvas::Canvas(const Canvas& iBrother)
@@ -69,7 +70,7 @@
   _Renderer = iBrother._Renderer;
   _current_sm = iBrother._current_sm;
   _steerableViewMap = new SteerableViewMap(*(iBrother._steerableViewMap));
-  
+  _basic = iBrother._basic;
 }
 
 Canvas::~Canvas()
@@ -109,17 +110,28 @@
     _current_sm = _StyleModules[i];
     if (!_StyleModules[i]->getModified())
     {
-      if (_StyleModules[i]->getDrawable() && _Layers[i])
-       _Layers[i]->Render(_Renderer);
-      continue;
+
+       if (_StyleModules[i]->getDrawable() && _Layers[i]) {
+               if (_basic)
+                       _Layers[i]->RenderBasic(_Renderer);
+               else
+                       _Layers[i]->Render(_Renderer);
+       }
+       continue;
+
+
     }
     if (i < _Layers.size() && _Layers[i])
       delete _Layers[i];
 
     _Layers[i] = _StyleModules[i]->execute();
 
-    if (_StyleModules[i]->getDrawable() && _Layers[i])
-      _Layers[i]->Render(_Renderer);
+       if (_StyleModules[i]->getDrawable() && _Layers[i]) {
+               if (_basic)
+                       _Layers[i]->RenderBasic(_Renderer);
+               else
+                       _Layers[i]->Render(_Renderer);
+       }
 
     timestamp->increment();
   }

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h 
2008-09-25 17:53:15 UTC (rev 16728)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h 
2008-09-25 18:02:15 UTC (rev 16729)
@@ -82,7 +82,8 @@
   mapsMap _maps;
   static const char * _MapsPath;
   SteerableViewMap *_steerableViewMap;
-  
+  bool _basic;
+
 public:
   /* Builds the Canvas */
   Canvas();
@@ -184,7 +185,7 @@
   void ReplaceStyleModule(unsigned index, StyleModule *iStyleModule);
   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 AddLayer(StrokeLayer *iLayer) {_Layers.push_back(iLayer);}       
   void resetModified(bool iMod=false);
   void causalStyleModules(std::vector<unsigned>& vec, unsigned index = 0);
   void setModified(unsigned index, bool b);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to