From: <mg...@us...> - 2009-03-27 13:41:03
|
Revision: 3330 http://planeshift.svn.sourceforge.net/planeshift/?rev=3330&view=rev Author: mgist Date: 2009-03-27 13:40:55 +0000 (Fri, 27 Mar 2009) Log Message: ----------- - Fixed bug in shader parsing. Modified Paths: -------------- trunk/src/common/engine/loader.cpp trunk/src/common/engine/loader.h Modified: trunk/src/common/engine/loader.cpp =================================================================== --- trunk/src/common/engine/loader.cpp 2009-03-27 12:24:34 UTC (rev 3329) +++ trunk/src/common/engine/loader.cpp 2009-03-27 13:40:55 UTC (rev 3330) @@ -47,6 +47,7 @@ engine = csQueryRegistry<iEngine> (object_reg); loader = csQueryRegistry<iLoader> (object_reg); tloader = csQueryRegistry<iThreadedLoader> (object_reg); + tman = csQueryRegistry<iThreadManager> (object_reg); vfs = csQueryRegistry<iVFS> (object_reg); svstrings = csQueryRegistryTagInterface<iShaderVarStringSet>(object_reg, "crystalspace.shader.variablenameset"); strings = csQueryRegistryTagInterface<iStringSet>(object_reg, "crystalspace.shared.stringset"); @@ -69,8 +70,8 @@ if(vfs->Exists(path)) { - // For the plugins load. - csRef<iThreadReturn> plugins; + // For the plugin and shader loads. + csRefArray<iThreadReturn> rets; // Restores any directory changes. csVfsDirectoryChanger dirchange(vfs); @@ -112,18 +113,18 @@ node = root->GetNode("plugins"); if(node.IsValid()) { - plugins = tloader->LoadNode(vfs->GetCwd(), node); + rets.Push(tloader->LoadNode(vfs->GetCwd(), node)); } node = root->GetNode("shaders"); if(node.IsValid()) { - nodeItr = root->GetNodes("shader"); + nodeItr = node->GetNodes("shader"); while(nodeItr->HasNext()) { node = nodeItr->Next(); node = node->GetNode("file"); - tloader->LoadShader(vfs->GetCwd(), node->GetContentsValue()); + rets.Push(tloader->LoadShader(vfs->GetCwd(), node->GetContentsValue())); } } @@ -684,11 +685,8 @@ } } - // Wait for plugins load to finish. - if(plugins.IsValid()) - { - plugins->Wait(); - } + // Wait for plugin and shader loads to finish. + tman->Wait(rets); } return true; @@ -1143,10 +1141,6 @@ if(ready) { - csArray<csStringID> shadertypes; - csArray<iShader*> shaderptrs; - csRefArray<csShaderVariable> shadervars; - csRef<iMaterial> mat (engine->CreateBaseMaterial(0)); engine->GetMaterialList()->NewMaterial(mat, material->name); Modified: trunk/src/common/engine/loader.h =================================================================== --- trunk/src/common/engine/loader.h 2009-03-27 12:24:34 UTC (rev 3329) +++ trunk/src/common/engine/loader.h 2009-03-27 13:40:55 UTC (rev 3330) @@ -87,7 +87,7 @@ csVector2 vec2; ShaderVar(const char* name, csShaderVariable::VariableType type) - : name(name), type(type) + : name(name), type(type), vec2(0.0f) { } }; @@ -275,6 +275,7 @@ csRef<iTextureManager> txtmgr; csRef<iLoader> loader; csRef<iThreadedLoader> tloader; + csRef<iThreadManager> tman; csRef<iVFS> vfs; csRef<iShaderVarStringSet> svstrings; csRef<iStringSet> strings; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |