From 7dea1a911cba5df88bcd075b9cfda2ea82586394 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Wed, 20 Sep 2006 03:48:58 +0000 Subject: [PATCH] filename fixes --- Demos/BspDemo/BspDemo.cpp | 7 +------ Demos/ColladaDemo/ColladaConverter.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Demos/BspDemo/BspDemo.cpp b/Demos/BspDemo/BspDemo.cpp index 462cdbf98..6e5ca8ac4 100644 --- a/Demos/BspDemo/BspDemo.cpp +++ b/Demos/BspDemo/BspDemo.cpp @@ -267,17 +267,12 @@ char* makeExeToBspFilename(const char* lpCmdLine) { in++; } - if(*(in+1) == ':') - { - // Second character is a :, assume we have a path with a drive letter and add a slash at the beginning - *(out++) = '/'; - } int i; for(i =0; i<512; i++) { //if we get '.' we stop as well, unless it's the first character. Then we add .bsp as extension // If we hit a null or a quote, stop copying. This will get just the first filename. - if(i && (*in == '.')) + if(i && (in[0] == '.') && (in[1] == 'e') && (in[2] == 'x') && (in[3] == 'e')) break; // If we hit a null or a quote, stop copying. This will get just the first filename. diff --git a/Demos/ColladaDemo/ColladaConverter.cpp b/Demos/ColladaDemo/ColladaConverter.cpp index e1b9a0a3e..4f48cc8f0 100644 --- a/Demos/ColladaDemo/ColladaConverter.cpp +++ b/Demos/ColladaDemo/ColladaConverter.cpp @@ -140,8 +140,19 @@ bool ColladaConverter::load(const char* orgfilename) if (res != DAE_OK) { - printf("DAE/Collada-m_dom: Couldn't load %s\n",filename); - } else + //some platforms might require different path, try two additional locations + char newname[256]; + sprintf(newname,"../../%s",orgfilename); + filename = fixFileName(newname); + res = m_collada->load(filename); + if (res != DAE_OK) + { + printf("DAE/Collada-m_dom: Couldn't load %s\n",filename); + return false; + } + } + + if (res == DAE_OK) { m_dom = m_collada->getDom(filename);