- try for fix bug on OsgGraph
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5982 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 3b25a17852be3db1aa79d95376b09add821daa50 Former-commit-id: 8fa5e651d07b76f82562bc6b5ce0c02e403bdcca
This commit is contained in:
parent
c91fb90dcb
commit
e27fb12622
5 changed files with 13 additions and 12 deletions
|
@ -71,7 +71,7 @@ SDCar::~SDCar(void)
|
|||
osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *car, bool tracktype, bool subcat, unsigned carshader)
|
||||
{
|
||||
this->car = car;
|
||||
static const int nMaxTexPathSize = 1024;
|
||||
static const int nMaxTexPathSize = 512;
|
||||
char buf[nMaxTexPathSize];
|
||||
int index;
|
||||
void *handle;
|
||||
|
|
|
@ -79,20 +79,21 @@ osg::ref_ptr<osg::MatrixTransform> SDWheels::initWheel(int wheelIndex, const cha
|
|||
#if 1
|
||||
osgLoader loader;
|
||||
char wheel_file_name[32];
|
||||
char buf[4096];
|
||||
int MaxPathSize = 512;
|
||||
char buf[MaxPathSize];
|
||||
|
||||
std::string TmpPath = GetDataDir();
|
||||
std::string strTPath;
|
||||
snprintf(buf, 4096, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
||||
snprintf(buf, MaxPathSize, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
||||
strTPath = TmpPath+buf;
|
||||
loader.AddSearchPath(strTPath);
|
||||
|
||||
snprintf(buf, 4096, "cars/models/%s/", car->_carName);
|
||||
snprintf(buf, MaxPathSize, "cars/models/%s/", car->_carName);
|
||||
strTPath = TmpPath+buf;
|
||||
loader.AddSearchPath(strTPath);
|
||||
GfOut("Chemin Textures : %s\n", strTPath.c_str());
|
||||
|
||||
snprintf(buf, 4096, "data/textures/");
|
||||
snprintf(buf, MaxPathSize, "data/textures/");
|
||||
strTPath = TmpPath+buf;
|
||||
loader.AddSearchPath(strTPath);
|
||||
|
||||
|
@ -116,7 +117,7 @@ osg::ref_ptr<osg::MatrixTransform> SDWheels::initWheel(int wheelIndex, const cha
|
|||
}
|
||||
#else
|
||||
char wheel_file_name[32];
|
||||
char buf[4096];
|
||||
char buf[MaxPathSize];
|
||||
|
||||
std::string LocalPath = GetDataDir();
|
||||
|
||||
|
@ -124,10 +125,10 @@ osg::ref_ptr<osg::MatrixTransform> SDWheels::initWheel(int wheelIndex, const cha
|
|||
options->CACHE_NONE;
|
||||
//options = new osgDB::ReaderWriter::Options;
|
||||
|
||||
snprintf(buf, 4096, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
||||
snprintf(buf, MaxPathSize, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
||||
options->getDatabasePathList().push_back(LocalPath+buf);
|
||||
|
||||
snprintf(buf, 4096, "cars/models/%s/", car->_carName);
|
||||
snprintf(buf, MaxPathSize, "cars/models/%s/", car->_carName);
|
||||
options->getDatabasePathList().push_back(LocalPath+buf);
|
||||
|
||||
options->getDatabasePathList().push_back(LocalPath+"data/textures/");
|
||||
|
|
|
@ -93,7 +93,7 @@ Geodelist _geodelist;
|
|||
|
||||
ReaderWriterACC::ReaderWriterACC()
|
||||
{
|
||||
osgDB::ReaderWriter::supportsExtension("acc","SPEED DREAMS Database format");
|
||||
osgDB::ReaderWriter::supportsExtension("acc", "SPEED DREAMS Database format");
|
||||
m_bCar = false;
|
||||
m_transparentGroup = NULL;
|
||||
m_opaqueGroup = NULL;
|
||||
|
|
|
@ -271,7 +271,7 @@ int initCars(tSituation *s)
|
|||
|
||||
if (!grHandle)
|
||||
{
|
||||
sprintf(buf, "%s%s", GfLocalDir(), GR_PARAM_FILE);
|
||||
snprintf(buf, 256, "%s%s", GfLocalDir(), GR_PARAM_FILE);
|
||||
grHandle = GfParmReadFile(buf, GFPARM_RMODE_STD | GFPARM_RMODE_CREAT);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ SDCarShader::SDCarShader(osg::Node *car, SDCar *c)
|
|||
std::string TmpPath = GetDataDir();
|
||||
osg::ref_ptr<osg::Shader> vertShader = new osg::Shader( osg::Shader::VERTEX);
|
||||
osg::ref_ptr<osg::Shader> fragShader = new osg::Shader( osg::Shader::FRAGMENT);
|
||||
vertShader->loadShaderSourceFromFile(TmpPath+"/data/shaders/car.vert");
|
||||
fragShader->loadShaderSourceFromFile(TmpPath+"/data/shaders/car.frag");
|
||||
vertShader->loadShaderSourceFromFile(TmpPath+"data/shaders/car.vert");
|
||||
fragShader->loadShaderSourceFromFile(TmpPath+"data/shaders/car.frag");
|
||||
program = new osg::Program;
|
||||
program->addShader( vertShader.get() );
|
||||
program->addShader( fragShader.get() );
|
||||
|
|
Loading…
Reference in a new issue