diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2008-09-09 22:03:44 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2008-09-09 22:03:44 +0400 |
commit | 449f210c464f95de3b0bcf641ed5ff046d215617 (patch) | |
tree | a8cdf95bfcccd1a48733a060b3b1e3a6e445fd7c | |
parent | 383956574d6cf406fe6463defa55a73d61c5aecf (diff) |
* Make sure freestyle branch compiles with SCons/msvc9 on Windows. This was joint operation with mxcurioni :)
10 files changed, 105 insertions, 113 deletions
diff --git a/SConstruct b/SConstruct index 4cff807c5a6..09d5a0322da 100644 --- a/SConstruct +++ b/SConstruct @@ -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) diff --git a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp index bd38ab26c01..ed79bc7dc82 100755 --- a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp +++ b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp @@ -19,6 +19,17 @@ // /////////////////////////////////////////////////////////////////////////////// + +#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" @@ -32,16 +43,6 @@ #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() { diff --git a/source/blender/freestyle/intern/app_blender/AppConfig.cpp b/source/blender/freestyle/intern/app_blender/AppConfig.cpp index 0919259bb74..d4e6aa8e225 100755 --- a/source/blender/freestyle/intern/app_blender/AppConfig.cpp +++ b/source/blender/freestyle/intern/app_blender/AppConfig.cpp @@ -25,101 +25,72 @@ 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 diff --git a/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp b/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp index fba019f8372..e8ffc4eccff 100755 --- a/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp +++ b/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp @@ -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; diff --git a/source/blender/freestyle/intern/app_blender/AppGLWidget_config.h b/source/blender/freestyle/intern/app_blender/AppGLWidget_config.h index c2fc1b092e1..f504ccb3d77 100644 --- a/source/blender/freestyle/intern/app_blender/AppGLWidget_config.h +++ b/source/blender/freestyle/intern/app_blender/AppGLWidget_config.h @@ -18,6 +18,11 @@ 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 diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp index 80acce599ca..6f11b5ffe0e 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp @@ -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; } diff --git a/source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp b/source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp index ed0cecbcfc8..b3b77bb3ed8 100755 --- a/source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp +++ b/source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp @@ -31,7 +31,11 @@ #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) diff --git a/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h b/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h index bef95996444..28d5d54866b 100755 --- a/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h +++ b/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h @@ -35,14 +35,15 @@ # 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 /**********************************/ /* */ diff --git a/source/blender/freestyle/intern/system/FreestyleConfig.h b/source/blender/freestyle/intern/system/FreestyleConfig.h index 385f86e7d23..c483e2813ba 100755 --- a/source/blender/freestyle/intern/system/FreestyleConfig.h +++ b/source/blender/freestyle/intern/system/FreestyleConfig.h @@ -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 diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h index 719b777f38d..e042eaa2f44 100755 --- a/source/blender/freestyle/intern/system/PythonInterpreter.h +++ b/source/blender/freestyle/intern/system/PythonInterpreter.h @@ -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())); } } |