Finally, fixed the evil dll problem. It works now

on my win32 box with my tests without crashing.
But be aware! There may be more of them watching
us, waiting for a moment of distraction, nobody
is safe.
This commit is contained in:
2004-06-27 20:10:20 +00:00
parent b8f73db964
commit 7febd4547d
3 changed files with 135 additions and 7 deletions

View File

@@ -207,12 +207,12 @@ bool yafrayPluginRender_t::writeRender()
{
yafray::paramMap_t params;
params["camera_name"]=yafray::parameter_t("MAINCAM");
params["raydepth"]=yafray::parameter_t(R.r.YF_raydepth);
params["raydepth"]=yafray::parameter_t((float)R.r.YF_raydepth);
params["gamma"]=yafray::parameter_t(R.r.YF_gamma);
params["exposure"]=yafray::parameter_t(R.r.YF_exposure);
if(R.r.YF_AA)
{
params["AA_passes"]=yafray::parameter_t(R.r.YF_AApasses);
params["AA_passes"]=yafray::parameter_t((int)R.r.YF_AApasses);
params["AA_minsamples"]=yafray::parameter_t(R.r.YF_AAsamples);
}
else
@@ -235,7 +235,7 @@ bool yafrayPluginRender_t::writeRender()
}
if (hasworld) params["background_name"]=yafray::parameter_t("world_background");
params["AA_pixelwidth"]=yafray::parameter_t(1.5);
params["AA_threshold"]=yafray::parameter_t(0.05);
params["AA_threshold"]=yafray::parameter_t(0.05f);
params["bias"]=yafray::parameter_t(R.r.YF_raybias);
//params["outfile"]=yafray::parameter_t(imgout);
blenderYafrayOutput_t output;
@@ -532,7 +532,9 @@ void yafrayPluginRender_t::writeMaterialsAndModulators()
params["type"]=yafray::parameter_t("blendershader");
params["name"]=yafray::parameter_t(blendmat->first);
float diff=matr->alpha;
params["color"]=yafray::parameter_t(yafray::color_t(matr->r*diff,matr->g*diff,matr->b*diff));
params["specular_color"]=yafray::parameter_t(yafray::color_t(matr->specr,
matr->specg,
matr->specb));
@@ -896,7 +898,7 @@ void yafrayPluginRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_
caus=true;
}
bool has_orco=(VLR_list[0]->v1->orco!=NULL);
float sm_angle=0.1;
float sm_angle=0.1f;
if (obj->type==OB_MESH)
{
Mesh* mesh = (Mesh*)obj->data;

View File

@@ -27,6 +27,121 @@ parameter_t::~parameter_t()
{
}
paramMap_t::paramMap_t()
{
}
paramMap_t::~paramMap_t()
{
}
bool paramMap_t::getParam(const std::string &name,const std::string *&s)
{
if(includes(name,TYPE_STRING))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
s=&(i->second.getStr());
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,bool &b)
{
std::string str;
if(includes(name,TYPE_STRING))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
str=i->second.getStr();
if(str=="on") b=true;
else if(str=="off") b=false;
else return false;
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,float &f)
{
if(includes(name,TYPE_FLOAT))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
f=i->second.getFnum();
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,double &f)
{
if(includes(name,TYPE_FLOAT))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
f=i->second.getFnum();
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,int &in)
{
if(includes(name,TYPE_FLOAT))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
in=(int)(i->second.getFnum());
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,point3d_t &p)
{
if(includes(name,TYPE_POINT))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
p=i->second.getP();
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,color_t &c)
{
if(includes(name,TYPE_COLOR))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
c=i->second.getC();
}
else return false;
return true;
}
bool paramMap_t::getParam(const std::string &name,colorA_t &c)
{
if(includes(name,TYPE_COLOR))
{
std::map<std::string,parameter_t>::iterator i=dicc.find(name);
c=i->second.getAC();
}
else return false;
return true;
}
bool paramMap_t::includes(const std::string &label,int type)const
{
std::map<std::string,parameter_t>::const_iterator i=dicc.find(label);
if(i==dicc.end()) return false;
if((*i).second.type!=type) return false;
return true;
}
void paramMap_t::checkUnused(const std::string &env)const
{
for(std::map<std::string,parameter_t>::const_iterator i=dicc.begin();i!=dicc.end();++i)
if(!( (*i).second.used ))
std::cout<<"[WARNING]:Unused param "<<(*i).first<<" in "<<env<<"\n";
}
parameter_t & paramMap_t::operator [] (const std::string &key)
{
return dicc[key];

View File

@@ -82,9 +82,20 @@ class parameter_t
class paramMap_t
{
public:
parameter_t & operator [] (const std::string &key);
void clear();
~paramMap_t() {};
paramMap_t();
virtual bool getParam(const std::string &name,const std::string *&s);
virtual bool getParam(const std::string &name,bool &b);
virtual bool getParam(const std::string &name,float &f);
virtual bool getParam(const std::string &name,double &f);
virtual bool getParam(const std::string &name,int &i);
virtual bool getParam(const std::string &name,point3d_t &p);
virtual bool getParam(const std::string &name,color_t &c);
virtual bool getParam(const std::string &name,colorA_t &c);
virtual bool includes(const std::string &label,int type)const;
virtual void checkUnused(const std::string &env)const;
virtual parameter_t & operator [] (const std::string &key);
virtual void clear();
virtual ~paramMap_t();
protected:
std::map<std::string,parameter_t> dicc;
};