[Bf-committers] how to build collada soc branch ? scons+msvc
Arystan Dyussenov
arystan.d at gmail.com
Thu Jun 25 19:03:13 CEST 2009
Patch didn't go through. Another try... this time with .txt extension
On Thu, Jun 25, 2009 at 10:41 PM, Arystan Dyussenov <arystan.d at gmail.com>wrote:
> Hi, can you apply the attached patch to your opencollada working copy?
>
> OpenCollada developers haven't committed to sf svn the latest changes/fixes
> we're using. This is why your build fails.
>
> Arystan
>
> On Thu, Jun 25, 2009 at 10:21 PM, Dalai Felinto <dfelinto at gmail.com>wrote:
>
>> Hello,
>> I checked out the branch [1], checked out opencollada [2], moved it to
>> /lib/windows/, patched scons' config file [3].
>> But I still get some errors [4].
>>
>> What else can I do to build this branch?
>>
>> [1] -
>> https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-chingachgook/
>> [2] - https://opencollada.svn.sourceforge.net/svnroot/opencollada/trunk
>> [3] - http://www.pasteall.org/6301/diff
>> [4] - http://www.pasteall.org/6302
>>
>> Thanks,
>> Dalai
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
>
>
-------------- next part --------------
Index: GeneratedSaxParser/include/GeneratedSaxParserRawUnknownElementHandler.h
===================================================================
--- GeneratedSaxParser/include/GeneratedSaxParserRawUnknownElementHandler.h (revision 568)
+++ GeneratedSaxParser/include/GeneratedSaxParserRawUnknownElementHandler.h (working copy)
@@ -64,7 +64,7 @@
/** Disable default assignment operator. */
const RawUnknownElementHandler& operator= ( const RawUnknownElementHandler& pre );
- void RawUnknownElementHandler::prepareToAddContents();
+ void prepareToAddContents();
};
} // namespace GENERATEDSAXPARSER
Index: GeneratedSaxParser/include/GeneratedSaxParserUtils.h
===================================================================
--- GeneratedSaxParser/include/GeneratedSaxParserUtils.h (revision 568)
+++ GeneratedSaxParser/include/GeneratedSaxParserUtils.h (working copy)
@@ -38,7 +38,7 @@
static StringHash calculateStringHash(const ParserChar* text);
- static StringHashPair Utils::calculateStringHashWithNamespace( const ParserChar* text );
+ static StringHashPair calculateStringHashWithNamespace( const ParserChar* text );
static StringHash calculateStringHash(const ParserChar* text, bool& failed);
Index: COLLADAStreamWriter/include/COLLADASWConstants.h
===================================================================
--- COLLADAStreamWriter/include/COLLADASWConstants.h (revision 568)
+++ COLLADAStreamWriter/include/COLLADASWConstants.h (working copy)
@@ -46,7 +46,8 @@
static const String CSW_ELEMENT_BLINN;
static const String CSW_ELEMENT_BIND;
static const String CSW_ELEMENT_BIND_MATERIAL;
- static const String CSW_ELEMENT_BIND_SHAPE_MATRIX;
+ static const String CSW_ELEMENT_BIND_SHAPE_MATRIX;
+ static const String CSW_ELEMENT_BIND_VERTEX_INPUT;
static const String CSW_ELEMENT_BORDER_COLOR;
static const String CSW_ELEMENT_CAMERA;
static const String CSW_ELEMENT_CAMERA_ORTHOGRAPHIC;
@@ -219,7 +220,9 @@
static const String CSW_ATTRIBUTE_END;
static const String CSW_ATTRIBUTE_FACE;
static const String CSW_ATTRIBUTE_ID;
- static const String CSW_ATTRIBUTE_INDEX;
+ static const String CSW_ATTRIBUTE_INDEX;
+ static const String CSW_ATTRIBUTE_INPUT_SEMANTIC;
+ static const String CSW_ATTRIBUTE_INPUT_SET;
static const String CSW_ATTRIBUTE_MATERIAL;
static const String CSW_ATTRIBUTE_METER;
static const String CSW_ATTRIBUTE_METHOD;
Index: COLLADAStreamWriter/include/COLLADASWInstanceMaterial.h
===================================================================
--- COLLADAStreamWriter/include/COLLADASWInstanceMaterial.h (revision 568)
+++ COLLADAStreamWriter/include/COLLADASWInstanceMaterial.h (working copy)
@@ -23,16 +23,21 @@
{
class InstanceMaterialList;
+ class BindVertexInput;
/** A class that holds informations of an @a \<instance_material\> element*/
class InstanceMaterial
{
private:
+
+ /** List of all the BindVertexInput*/
+ typedef std::list<BindVertexInput> BindVertexInputList;
+ BindVertexInputList mBindVertexInputList;
String mSymbol;
URI mTarget;
-
+
public:
/** Constructor
@@ -40,7 +45,7 @@
@param target The target
*/
InstanceMaterial ( const String& symbol, const URI& target )
- : mSymbol ( symbol ), mTarget ( target ) {}
+ : mSymbol ( symbol ), mTarget ( target ) {}
/** Returns the symbol*/
const String & getSymbol() const
@@ -53,6 +58,19 @@
{
return mTarget;
}
+
+ /** Adds @a input to list of inputs that should be added*/
+ void push_back ( const BindVertexInput& input )
+ {
+ mBindVertexInputList.push_back ( input );
+ }
+
+ private:
+ /** Set this class a friend, so it can call the add() method. */
+ friend class InstanceMaterialList;
+
+ /** Add all the instance materials, added using push_back(), to the stream*/
+ void add( StreamWriter* sw);
};
@@ -94,7 +112,52 @@
void add();
};
+
+ class BindVertexInput
+ {
+ private:
+
+ /** Which effect parameter to bind. Required.*/
+ String mSemantic;
+
+ /** Which input semantic to bind. Required.*/
+ String mInputSemantic;
+
+ /** Which input set to bind. Optional. -1 if not set.*/
+ int mInputSet;
+
+ public:
+
+ BindVertexInput (const COLLADASW::String& semantic, const COLLADASW::String& inputSemantic, int inputSet = -1) : mSemantic(semantic), mInputSemantic(inputSemantic), mInputSet(inputSet){}
+
+ /** Which effect parameter to bind. Required.*/
+ const COLLADASW::String& getSemantic() const { return mSemantic; }
+
+ /** Which effect parameter to bind. Required.*/
+ void setSemantic(const COLLADASW::String& semantic) { mSemantic = semantic; }
+ /** Which input semantic to bind. Required.*/
+ const COLLADASW::String& getInputSemantic() const { return mInputSemantic; }
+
+ /** Which input semantic to bind. Required.*/
+ void setInputSemantic(const COLLADASW::String& inputSemantic) { mInputSemantic = inputSemantic; }
+
+ /** Which input set to bind. Optional. -1 if not set.*/
+ int getInputSet() const { return mInputSet; }
+
+ /** Which input set to bind. Optional. -1 if not set.*/
+ void setInputSet(int inputSet) { mInputSet = inputSet; }
+
+ private:
+ /** Set this class a friend, so it can call the add() method. */
+ friend class InstanceMaterial;
+
+ /** Add all the instance materials, added using push_back(), to the stream*/
+ void add( StreamWriter* sw);
+
+ };
+
+
} //namespace COLLADASW
Index: COLLADAStreamWriter/src/COLLADASWConstants.cpp
===================================================================
--- COLLADAStreamWriter/src/COLLADASWConstants.cpp (revision 568)
+++ COLLADAStreamWriter/src/COLLADASWConstants.cpp (working copy)
@@ -38,7 +38,8 @@
const String CSWC::CSW_ELEMENT_BLINN = "blinn";
const String CSWC::CSW_ELEMENT_BIND = "bind";
const String CSWC::CSW_ELEMENT_BIND_MATERIAL = "bind_material";
- const String CSWC::CSW_ELEMENT_BIND_SHAPE_MATRIX = "bind_shape_matrix";
+ const String CSWC::CSW_ELEMENT_BIND_SHAPE_MATRIX = "bind_shape_matrix";
+ const String CSWC::CSW_ELEMENT_BIND_VERTEX_INPUT = "bind_vertex_input";
const String CSWC::CSW_ELEMENT_BORDER_COLOR = "border_color";
const String CSWC::CSW_ELEMENT_CAMERA = "camera";
const String CSWC::CSW_ELEMENT_CAMERA_ORTHOGRAPHIC = "orthographic";
@@ -209,7 +210,9 @@
const String CSWC::CSW_ATTRIBUTE_END = "end";
const String CSWC::CSW_ATTRIBUTE_FACE = "face";
const String CSWC::CSW_ATTRIBUTE_ID = "id";
- const String CSWC::CSW_ATTRIBUTE_INDEX = "index";
+ const String CSWC::CSW_ATTRIBUTE_INDEX = "index";
+ const String CSWC::CSW_ATTRIBUTE_INPUT_SEMANTIC = "input_semantic";
+ const String CSWC::CSW_ATTRIBUTE_INPUT_SET = "input_set";
const String CSWC::CSW_ATTRIBUTE_MATERIAL = "material";
const String CSWC::CSW_ATTRIBUTE_METER = "meter";
const String CSWC::CSW_ATTRIBUTE_METHOD = "method";
Index: COLLADAStreamWriter/src/COLLADASWInstanceMaterial.cpp
===================================================================
--- COLLADAStreamWriter/src/COLLADASWInstanceMaterial.cpp (revision 568)
+++ COLLADAStreamWriter/src/COLLADASWInstanceMaterial.cpp (working copy)
@@ -19,11 +19,32 @@
{
for ( List::iterator it = mList.begin(); it != mList.end(); ++it )
{
- mSW->openElement ( CSWC::CSW_ELEMENT_INSTANCE_MATERIAL );
- mSW->appendAttribute ( CSWC::CSW_ATTRIBUTE_SYMBOL, it->getSymbol() );
- mSW->appendURIAttribute ( CSWC::CSW_ATTRIBUTE_TARGET, it->getTarget() );
- mSW->closeElement();
+ it->add( mSW );
+
}
}
+
+ void InstanceMaterial::add( StreamWriter* sw )
+ {
+ sw->openElement ( CSWC::CSW_ELEMENT_INSTANCE_MATERIAL );
+ sw->appendAttribute ( CSWC::CSW_ATTRIBUTE_SYMBOL, getSymbol() );
+ sw->appendURIAttribute ( CSWC::CSW_ATTRIBUTE_TARGET, getTarget() );
+ for ( BindVertexInputList::iterator it = mBindVertexInputList.begin(); it != mBindVertexInputList.end(); ++it)
+ {
+ it->add( sw );
+ }
+
+ sw->closeElement();
+ }
+
+ //---------------------------------------------------------------
+ void BindVertexInput::add( StreamWriter* sw )
+ {
+ sw->openElement ( CSWC::CSW_ELEMENT_BIND_VERTEX_INPUT );
+ sw->appendAttribute ( CSWC::CSW_ATTRIBUTE_SEMANTIC, getSemantic() );
+ sw->appendAttribute ( CSWC::CSW_ATTRIBUTE_INPUT_SEMANTIC, getInputSemantic() );
+ sw->appendAttribute ( CSWC::CSW_ATTRIBUTE_INPUT_SET, getInputSet() );
+ sw->closeElement();
+ }
} //namespace COLLADASW
Index: COLLADABaseUtils/src/COLLADABUURI.cpp
===================================================================
--- COLLADABaseUtils/src/COLLADABUURI.cpp (revision 568)
+++ COLLADABaseUtils/src/COLLADABUURI.cpp (working copy)
@@ -26,8 +26,70 @@
const String URI::SCHEME_HTTP = "http";
const String URI::SCHEME_HTTPS = "https";
+ // compiled on runtime but only once
+ static pcre *re_matchURI = NULL;
+ static pcre *re_findDir = NULL;
+ static pcre *re_findExt = NULL;
+ enum RegexpType {
+ REGEXP_URI,
+ REGEXP_DIR,
+ REGEXP_EXT,
+ };
+ static void dumpCompiledRegexp(const char *filename, pcre *re)
+ {
+ int rc;
+ size_t length;
+ rc = pcre_fullinfo(re, /* result of pcre_compile() */
+ NULL, /* result of pcre_study(), or NULL */
+ PCRE_INFO_SIZE, /* what is required */
+ &length); /* where to put the data */
+ FILE *fout = fopen(filename, "wb");
+// for (int i = 0; i < length; i++) {
+// fprintf(fout, "%c,", ((char *)re)[i]);
+// }
+ fwrite((void*) re, length, 1, fout);
+ fclose(fout);
+ }
+
+ static void compileRegexps()
+ {
+ const char* error;
+ int erroffset;
+ re_matchURI = pcre_compile("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?",
+ 0, &error, &erroffset, NULL);
+ if (!re_matchURI)
+ fprintf(stderr, "Error compiling re_matchURI: %s\n", error);
+
+ dumpCompiledRegexp("/tmp/compiledRegexText.c", re_matchURI);
+
+ re_findDir = pcre_compile("(.*/)?(.*)?", 0, &error, &erroffset, NULL);
+ if (!re_findDir)
+ fprintf(stderr, "Error compiling re_findDir: %s\n", error);
+
+ re_findExt = pcre_compile("([^.]*)?(\\.(.*))?", 0, &error, &erroffset, NULL);
+ if (!re_findExt)
+ fprintf(stderr, "Error compiling re_findExt: %s\n", error);
+ }
+
+ static pcre* getCompiledRegexp(RegexpType type)
+ {
+ if (!re_matchURI)
+ compileRegexps();
+
+ switch(type) {
+ case REGEXP_URI:
+ return re_matchURI;
+ case REGEXP_DIR:
+ return re_findDir;
+ case REGEXP_EXT:
+ return re_findExt;
+ }
+
+ return NULL;
+ }
+
const char HEX2DEC[256] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
@@ -266,15 +328,13 @@
// /tmp/se.3/file
// regular expression: "(.*/)?(.*)?"
- static const char _findDir[71]={69,82,67,80,71,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,27,103,95,0,9,0,1,57,12,28,47,
- 85,0,9,103,95,0,7,0,2,57,12,85,0,7,85,0,27,0,};
- pcre* findDir = (pcre*) _findDir;
+ // static const char _findDir[71]={69,82,67,80,71,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,27,103,95,0,9,0,1,57,12,28,47,85,0,9,103,95,0,7,0,2,57,12,85,0,7,85,0,27,0,};
+ pcre* findDir = getCompiledRegexp(REGEXP_DIR);
// regular expression: "([^.]*)?(\.(.*))?"
- static const char _findExt[79]={69,82,67,80,79,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,35,103,95,0,7,0,1,44,46,85,0,7
- ,103,95,0,17,0,2,28,46,95,0,7,0,3,57,12,85,0,7,85,0,17,85,0,35,0,};
- pcre* findExt = (pcre*) _findExt;
+ // static const char _findExt[79]={69,82,67,80,79,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,35,103,95,0,7,0,1,44,46,85,0,7,103,95,0,17,0,2,28,46,95,0,7,0,3,57,12,85,0,7,85,0,17,85,0,35,0,};
+ pcre* findExt = getCompiledRegexp(REGEXP_EXT);
String tmpFile;
dir.clear();
@@ -473,7 +533,7 @@
namespace {
void normalize(String& path) {
URI::normalizeURIPath(const_cast<char*>(path.c_str()));
- path = path.substr(0, strlen(path.c_str()));
+ // path = path.substr(0, strlen(path.c_str()));
}
}
@@ -871,8 +931,8 @@
// This regular expression for parsing URI references comes from the URI spec:
// http://tools.ietf.org/html/rfc3986#appendix-B
// regular expression: "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"
- static const char _matchUri[240]={69,82,67,80,-16,0,0,0,16,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,-60,26,103,95,0,49,0,1,95, 0,39,0,2,79,-1,-1,-1,-1,-9,127,-1,123,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,72,85,0,39,28,58,85,0,49,103,95,0,51,0,3,28,47,28,47,95,0,39,0,4,79,-1,-1,-1,-1,-9,127,-1,127,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,70,85,0,39,85,0,51,95,0,39,0,5,79,-1,-1,-1,-1,-9,-1,-1,127,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,70,85,0,39,103,95,0,17,0,6,28,63,95,0,7,0,7,44,35,85,0,7,85,0,17,103,95,0,17,0,8,28,35,95,0,7,0,9,57,12,85,0,7,85,0,17,85,0,-60,0,};
- pcre* matchUri = (pcre*) _matchUri;
+ // static const char _matchUri[240]={69,82,67,80,-16,0,0,0,16,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,-60,26,103,95,0,49,0,1,95, 0,39,0,2,79,-1,-1,-1,-1,-9,127,-1,123,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,72,85,0,39,28,58,85,0,49,103,95,0,51,0,3,28,47,28,47,95,0,39,0,4,79,-1,-1,-1,-1,-9,127,-1,127,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,70,85,0,39,85,0,51,95,0,39,0,5,79,-1,-1,-1,-1,-9,-1,-1,127,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,70,85,0,39,103,95,0,17,0,6,28,63,95,0,7,0,7,44,35,85,0,7,85,0,17,103,95,0,17,0,8,28,35,95,0,7,0,9,57,12,85,0,7,85,0,17,85,0,-60,0,};
+ pcre* matchUri = getCompiledRegexp(REGEXP_URI);
int uriMatches[regExpMatchesVectorLength];
More information about the Bf-committers
mailing list