* Make sure freestyle branch compiles with SCons/msvc9 on Windows. This was joint...
authorNathan Letwory <nathan@letworyinteractive.com>
Tue, 9 Sep 2008 18:03:44 +0000 (18:03 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Tue, 9 Sep 2008 18:03:44 +0000 (18:03 +0000)
SConstruct
source/blender/freestyle/intern/app_blender/AppCanvas.cpp
source/blender/freestyle/intern/app_blender/AppConfig.cpp
source/blender/freestyle/intern/app_blender/AppGLWidget.cpp
source/blender/freestyle/intern/app_blender/AppGLWidget_config.h
source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp
source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp
source/blender/freestyle/intern/rendering/GLStrokeRenderer.h
source/blender/freestyle/intern/system/FreestyleConfig.h
source/blender/freestyle/intern/system/PythonInterpreter.h

index 4cff807c5a6b3fe2d2b3c48e181d5c576cae6c78..09d5a0322da472add229ee03600c68437cfea03f 100644 (file)
@@ -493,7 +493,7 @@ if env['WITH_BF_PLAYER']:
     Depends(blenderplayer,installtarget)
 
 if not env['WITH_BF_GAMEENGINE']:
-    blendernogame = env.Alias('blendernogame', B.game)
+    blendernogame = env.Alias('blendernogame', B.program_list)
     Depends(blendernogame,installtarget)
 
 Depends(nsiscmd, allinstall)
index bd38ab26c015fe750bae49811bd472a0f4bbd0b1..ed79bc7dc824491e8ade52f616bc5820d256fd69 100755 (executable)
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+
+#ifdef WIN32
+# include <GL/glew.h>
+# include <windows.h>
+#endif
+#ifdef __MACH__
+# include <OpenGL/gl.h>
+#else
+# include <GL/gl.h>
+#endif
+
 #include "AppGLWidget.h"
 #include "../image/Image.h"
 #include "../system/TimeStamp.h"
 
 #include "../system/StringUtils.h"
 
-#ifdef WIN32
-# include <windows.h>
-# include "GL/glew.h"
-#endif
-#ifdef __MACH__
-# include <OpenGL/gl.h>
-#else
-# include <GL/gl.h>
-#endif
-
 AppCanvas::AppCanvas()
 :Canvas()
 {
index 0919259bb743a3ce466cfec4f8bcbdab8b590532..d4e6aa8e225de3161e1b3cc73f141e5814756e71 100755 (executable)
 
 using namespace std;
 
-namespace Config{
-  Path* Path::_pInstance = 0;
-  Path::Path(){
-    // get the home directory
-    _HomeDir = getEnvVar("HOME");
-    // get the root directory
+namespace Config {
+Path* Path::_pInstance = 0;
+Path::Path() {
+       // get the home directory
+       _HomeDir = getEnvVar("HOME");
+       // get the root directory
        //soc
        setRootDir(getEnvVar("FREESTYLE_BLENDER_DIR"));
 
-    _pInstance = this;
-  }
-  void Path::setRootDir(const string& iRootDir){
-    _ProjectDir = iRootDir;
-    _ModelsPath = "";
-    _PatternsPath = _ProjectDir +
-                                            string(DIR_SEP.c_str()) +
-                                            "data" +
-                                            string(DIR_SEP.c_str()) +
-                                            "textures" +
-                                            string(DIR_SEP.c_str()) +
-                                            "variation_patterns" +
-                                            string(DIR_SEP.c_str());
-    _BrushesPath = _ProjectDir +
-                                            string(DIR_SEP.c_str()) +
-                                            "data" +
-                                            string(DIR_SEP.c_str()) +
-                                            "textures" +
-                                            string(DIR_SEP.c_str()) +
-                                            "brushes" +
-                                            string(DIR_SEP.c_str());
-    _PythonPath = _ProjectDir + 
-              string(DIR_SEP.c_str()) + 
-              "python" + 
-              string(PATH_SEP.c_str()) +
-              _ProjectDir +
-                               string(DIR_SEP.c_str()) +
-              "style_modules_blender" +
-              string(DIR_SEP.c_str()) ;
-    if (getenv("PYTHONPATH")) {
-      _PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
-    }
+       _pInstance = this;
+}
+void Path::setRootDir(const string& iRootDir) {
+       _ProjectDir = iRootDir;
+       _ModelsPath = "";
+       _PatternsPath = _ProjectDir + string(DIR_SEP.c_str()) + "data"
+                       + string(DIR_SEP.c_str()) + "textures" + string(DIR_SEP.c_str())
+                       + "variation_patterns" + string(DIR_SEP.c_str());
+       _BrushesPath = _ProjectDir + string(DIR_SEP.c_str()) + "data"
+                       + string(DIR_SEP.c_str()) + "textures" + string(DIR_SEP.c_str())
+                       + "brushes" + string(DIR_SEP.c_str());
+       _PythonPath = _ProjectDir + string(DIR_SEP.c_str()) + "python"
+                       + string(PATH_SEP.c_str()) + _ProjectDir + string(DIR_SEP.c_str())
+                       + "style_modules_blender" + string(DIR_SEP.c_str()) ;
+       if (getenv("PYTHONPATH")) {
+               _PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
+       }
 #ifdef WIN32
-    _BrowserCmd = "C:\\Program Files\\Internet Explorer\\iexplore.exe %s";
+       _BrowserCmd = "C:\\Program Files\\Internet Explorer\\iexplore.exe %s";
 #else
-    _BrowserCmd = "mozilla %s";
+       _BrowserCmd = "mozilla %s";
 #endif
-    _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" +
-           string(DIR_SEP.c_str()) +
-                                  "maps" +
-                                  string(DIR_SEP.c_str());
-  }
-  void Path::setHomeDir(const string& iHomeDir){
-    _HomeDir = iHomeDir;
-  }
-  Path::~Path(){
-    _pInstance = 0;
-  }
-  Path* Path::getInstance() {
-    return _pInstance;
-  }
-  string Path::getEnvVar(const string& iEnvVarName){
-    string value;
-       if (!getenv( StringUtils::toAscii(iEnvVarName).c_str() ) ) {
-      cerr << "Warning: You may want to set the $"<< StringUtils::toAscii(iEnvVarName)
-                 << " environment variable to use " << string(Config::APPLICATION_NAME) << "." << endl
-           << "         Otherwise, the current directory will be used instead." << endl;
-      value = ".";
-    }else{
-      value = getenv( StringUtils::toAscii(iEnvVarName).c_str()  );
-    } 
-    return value;
-  }
+       _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"
+                       + string(DIR_SEP.c_str()) + "maps" + string(DIR_SEP.c_str());
+}
+void Path::setHomeDir(const string& iHomeDir) {
+       _HomeDir = iHomeDir;
+}
+Path::~Path() {
+       _pInstance = 0;
+}
+Path* Path::getInstance() {
+       return _pInstance;
+}
+string Path::getEnvVar(const string& iEnvVarName) {
+       string value;
+       if (!getenv(StringUtils::toAscii(iEnvVarName).c_str() ) ) {
+               cerr << "Warning: You may want to set the $"
+                               << StringUtils::toAscii(iEnvVarName)
+                               << " environment variable to use "
+                               << string(Config::APPLICATION_NAME) << "." << endl
+                               << "         Otherwise, the current directory will be used instead."
+                               << endl;
+               value = ".";
+       } else {
+               value = getenv(StringUtils::toAscii(iEnvVarName).c_str() );
+       }
+       return value;
+}
 
 } // End of namepace Config
 
index fba019f83723012a2e28767e5b47beaf7295acb3..e8ffc4eccff2cd4fdc48ef92868a2f0bea7906d9 100755 (executable)
@@ -47,7 +47,11 @@ extern "C" {
 #ifdef __MACH__
 # include <GLUT/glut.h>
 #else
+# ifdef _WIN32
+# include <GL/glu.h>
+# else
 # include <GL/glut.h>
+# endif
 #endif
 
 GLuint texture = 0;
index c2fc1b092e1d033d86a0eb93c78a9fcf41f0a4a3..f504ccb3d7710fecc1653781e59f4528902b6fc7 100644 (file)
 
 using namespace std;
 
+// Pi definition
+# ifndef M_PI
+#  define M_PI 3.14159265
+# endif // M_PI
+
 #include "AppGLWidget_point.h"
 
 # ifdef WIN32
@@ -32,7 +37,11 @@ using namespace std;
 #ifdef __APPLE_CC__
        #include <GLUT/glut.h>
 #else
-       #include <GL/glut.h>
+# ifdef WIN32
+# include <GL/glu.h>
+# else
+# include <GL/glut.h>
+# endif
 #endif
 
 #ifndef Q_UNUSED
index 80acce599ca970f2e8199154bcc4522794408733..6f11b5ffe0e64e5ad48aa9abd7bf2b3d1c17ef75 100644 (file)
@@ -108,7 +108,7 @@ int SmoothingShader___init__( BPy_SmoothingShader* self, PyObject *args)
                return -1;
        }
 
-       self->py_ss.ss = new SmoothingShader::SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8);
+       self->py_ss.ss = new SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8);
        return 0;
 
 }
index ed0cecbcfc8c6a1a86d697d2d1a0b044e708456b..b3b77bb3ed818856ad60d272aba2f27ecc1b6d2c 100755 (executable)
 #ifdef __MACH__
 #include <GLUT/glut.h>
 #else
-#include <GL/glut.h>
+# ifdef WIN32
+# include <GL/glu.h>
+# else
+# include <GL/glut.h>
+# endif
 #endif
 
 void GLDebugRenderer::visitIndexedFaceSet(IndexedFaceSet& iFaceSet)  
index bef95996444b610855db8409fccc2c38cbc7e5d1..28d5d54866b6cdb5c4f091fc3e1e12ecbde44d9e 100755 (executable)
 # include "../stroke/StrokeRep.h"
 
 
-# ifdef WIN32
-#  include <windows.h>
-# endif
-# ifdef __MACH__
-#  include <OpenGL/gl.h>
-# else
-#  include <GL/gl.h>
-# endif
+#ifdef WIN32
+# include <GL/glew.h>
+# include <windows.h>
+#endif
+#ifdef __MACH__
+# include <OpenGL/gl.h>
+#else
+# include <GL/gl.h>
+#endif
 
 /**********************************/
 /*                                */
index 385f86e7d231a753cc504ac975781d16a1fc0544..c483e2813ba9b0a68d6296611dc2853767f82623 100755 (executable)
@@ -44,13 +44,15 @@ namespace Config {
 
   // Directory separators
 # ifdef WIN32
-  static const string DIR_SEP("\\");
+  static const string DIR_SEP("\\\\");
   static const string PATH_SEP(";");
 # else
   static const string DIR_SEP("/");
   static const string PATH_SEP(":");
 # endif // WIN32
 
+  // DLL import/export macros for Win32
+
 #  ifndef LIB_SYSTEM_EXPORT
 #   define LIB_SYSTEM_EXPORT
 #  endif // LIB_SYSTEM_EXPORT
index 719b777f38d9997ab60257c5bcdec30c508cab8d..e042eaa2f44a030b47a3dd15b0fe16687ab2993b 100755 (executable)
@@ -115,7 +115,7 @@ private:
        for (vector<string>::const_iterator it = pathnames.begin(); it != pathnames.end();++it) {
                if ( !it->empty() ) {
                        cout << "Adding Python path: " << *it << endl;
-                       cmd = "sys.path.append(\"" + *it + "\")\n";
+                       cmd = "sys.path.append(r\"" + *it + "\")\n";
                        txt_insert_buf(text, const_cast<char*>(cmd.c_str()));
                }
        }