From 625e7fb12cacf2f2db81196fbe54c8efe3e3cd90 Mon Sep 17 00:00:00 2001 From: Alejandro Conty Estevez Date: Mon, 21 Jun 2004 08:17:05 +0000 Subject: [PATCH] These are changes sent by Luis_F who got this working on win32. Only applies to that platform and fixes a problem findind yafray dll's --- .../blender/yafray/intern/export_Plugin.cpp | 47 ++++++++++++------- source/blender/yafray/intern/export_Plugin.h | 13 ++++- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index 08919292e57..2c6b21abaf1 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -1,7 +1,6 @@ #include"export_Plugin.h" #include - using namespace std; @@ -94,7 +93,8 @@ static string YafrayPath() { #ifdef WIN32 string path=find_path(); - return path+"\\libyafrayplugin.dll"; + return path; + #else static char *alternative[]= { @@ -117,7 +117,7 @@ static string YafrayPath() static string YafrayPluginPath() { #ifdef WIN32 - return find_path(); + return find_path()+"\\plugins"; #else static char *alternative[]= { @@ -142,15 +142,30 @@ yafrayPluginRender_t::~yafrayPluginRender_t() { if(yafrayGate!=NULL) delete yafrayGate; if(handle!=NULL) PIL_dynlib_close(handle); +#ifdef WIN32 + if(corehandle!=NULL) PIL_dynlib_close(corehandle); +#endif } bool yafrayPluginRender_t::initExport() { - imgout="YBPtest.tga"; if(handle==NULL) { string location=YafrayPath(); - //handle=dlopen(location.c_str(),RTLD_NOW); +#ifdef WIN32 + /* Win 32 loader cannot find needed libs in yafray dir, so we have to load them + * by hand. This could be fixed using setdlldirectory function, but it is not + * available in all win32 versions + */ + corehandle=PIL_dynlib_open((char *)(location+"\\yafraycore.dll").c_str()); + if(corehandle==NULL) + { + cerr<<"Error loading yafray plugin: "<