only use TORCS campatibility functions in robots
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8050 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: efe85a6c95c32b3738356012ee2d852bcf843acf Former-commit-id: dc88145c33e58e8a58667ea592b8a648ced74789
This commit is contained in:
parent
f87ef400b2
commit
ec2a02ae29
10 changed files with 29 additions and 29 deletions
|
@ -199,7 +199,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
|
||||
osgLoader loader;
|
||||
|
||||
std::string TmpPath = GetDataDir();
|
||||
std::string TmpPath = GfDataDir();
|
||||
std::string strTPath;
|
||||
|
||||
index = car->index; /* current car's index */
|
||||
|
@ -261,7 +261,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
car->_carName); /* default car 3D model file */
|
||||
snprintf(path, nMaxTexPathSize, "%s/%s/1", SECT_GROBJECTS, LST_RANGES);
|
||||
|
||||
std::string strPath = GetDataDir();
|
||||
std::string strPath = GfDataDir();
|
||||
|
||||
if(bMasterModel)
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/%s.acc", car->_masterModel, car->_masterModel);
|
||||
|
@ -313,7 +313,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
{
|
||||
_wing1 = true;
|
||||
|
||||
std::string tmp = GetDataDir();
|
||||
std::string tmp = GfDataDir();
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/", car->_carName);
|
||||
tmp = tmp+buf;
|
||||
|
||||
|
@ -391,7 +391,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
this->DRMSelector2 = new osg::Switch;
|
||||
this->RearWingSelector = new osg::Switch;
|
||||
this->RearWingSelector->setName("WINGREAR");
|
||||
std::string tmp = GetDataDir();
|
||||
std::string tmp = GfDataDir();
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/", car->_carName);
|
||||
tmp = tmp+buf;
|
||||
|
||||
|
@ -430,7 +430,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
if (param)
|
||||
{
|
||||
_cockpit = true;
|
||||
std::string tmp = GetDataDir();
|
||||
std::string tmp = GfDataDir();
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/", car->_carName);
|
||||
tmp = tmp+buf;
|
||||
|
||||
|
@ -455,7 +455,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
if (param)
|
||||
{
|
||||
_steer = true;
|
||||
std::string tmpPath = GetDataDir();
|
||||
std::string tmpPath = GfDataDir();
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/", car->_carName);
|
||||
tmpPath = tmpPath+buf;
|
||||
|
||||
|
@ -499,7 +499,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
|
||||
if (param)
|
||||
{
|
||||
tmpPath = GetDataDir();
|
||||
tmpPath = GfDataDir();
|
||||
snprintf(buf, nMaxTexPathSize, "cars/models/%s/", car->_carName);
|
||||
tmpPath = tmpPath+buf;
|
||||
|
||||
|
@ -552,7 +552,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
|||
this->DRMSelector = new osg::Switch;
|
||||
this->carTransform->addChild(DriverSelector.get());
|
||||
|
||||
std::string tmp = GetLocalDir();
|
||||
std::string tmp = GfLocalDir();
|
||||
std::string driver_path;
|
||||
|
||||
// add the drivers
|
||||
|
@ -690,7 +690,7 @@ osg::ref_ptr<osg::Node> SDCar::initOcclusionQuad(tCarElt *car)
|
|||
int i;
|
||||
|
||||
char buf[512];
|
||||
std::string TmpPath = GetDataDir();
|
||||
std::string TmpPath = GfDataDir();
|
||||
|
||||
// GfOut("\n################## LOADING SHADOW ###############################\n");
|
||||
std::string shadowTextureName = GfParmGetStr(car->_carHandle, SECT_GROBJECTS, PRM_SHADOW_TEXTURE, "");
|
||||
|
|
|
@ -82,7 +82,7 @@ osg::ref_ptr<osg::MatrixTransform> SDWheels::initWheel(int wheelIndex, const cha
|
|||
const bool bCustomSkin = strlen(this->car->_skinName) != 0;
|
||||
|
||||
std::string bSkinName;
|
||||
std::string TmpPath = GetDataDir();
|
||||
std::string TmpPath = GfDataDir();
|
||||
|
||||
if (bCustomSkin)
|
||||
{
|
||||
|
|
|
@ -160,7 +160,7 @@ void SDRender::Init(tTrack *track)
|
|||
{
|
||||
SDTrack = track;
|
||||
|
||||
std::string datapath = GetDataDir();
|
||||
std::string datapath = GfDataDir();
|
||||
//datapath +="/";
|
||||
thesky = new SDSky;
|
||||
GfLogDebug("SDSky class\n");
|
||||
|
@ -798,7 +798,7 @@ void SDRender::UpdateSky(double currentTime, double accelTime, double X, double
|
|||
|
||||
void SDRender::weather(void)
|
||||
{
|
||||
std::string datapath = GetDataDir();
|
||||
std::string datapath = GfDataDir();
|
||||
double domeSizeRatio = SDSkyDomeDistance / 80000.0;
|
||||
|
||||
// Cloud layers.
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
SDCarShader::SDCarShader(osg::Node *car, SDCar *c)
|
||||
{
|
||||
std::string TmpPath = GetDataDir();
|
||||
std::string TmpPath = GfDataDir();
|
||||
|
||||
program = new osg::Program;
|
||||
program->addShader(osgDB::readShaderFile(osg::Shader::VERTEX,
|
||||
|
|
|
@ -43,7 +43,7 @@ void SDBackground::build(int X, int Y, int Z, const std::string& TrackPath)
|
|||
{
|
||||
osgDB::Registry::instance()->clearObjectCache();
|
||||
|
||||
std::string LocalPath = GetDataDir();
|
||||
std::string LocalPath = GfDataDir();
|
||||
|
||||
osgDB::FilePathList pathList = osgDB::Registry::instance()->getDataFilePathList();
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ void SDScenery::LoadScene(tTrack *track)
|
|||
GfLogError("No specified track 3D model file\n");
|
||||
}
|
||||
|
||||
std::string PathTmp = GetDataDir();
|
||||
std::string PathTmp = GfDataDir();
|
||||
|
||||
_bgsky = strcmp(GfParmGetStr(grHandle, GR_SCT_GRAPHIC, GR_ATT_BGSKY, GR_ATT_BGSKY_DISABLED), GR_ATT_BGSKY_ENABLED) == 0;
|
||||
if (_bgsky)
|
||||
|
@ -134,7 +134,7 @@ void SDScenery::LoadScene(tTrack *track)
|
|||
GfLogDebug("Background loaded\n");
|
||||
}
|
||||
|
||||
std::string strPath = GetDataDir();
|
||||
std::string strPath = GfDataDir();
|
||||
snprintf(buf, 256, "tracks/%s/%s/", SDTrack->category, SDTrack->internalname);
|
||||
|
||||
std::string ext = osgDB::getFileExtension(acname);
|
||||
|
@ -152,7 +152,7 @@ void SDScenery::LoadScene(tTrack *track)
|
|||
{
|
||||
strPath+=buf;
|
||||
|
||||
std::string strTPath = GetDataDir();
|
||||
std::string strTPath = GfDataDir();
|
||||
osgDB::FilePathList pathList = osgDB::Registry::instance()->getDataFilePathList();
|
||||
pathList.push_back(strPath);
|
||||
GfLogDebug("Track Path : %s\n", pathList.back().c_str());
|
||||
|
@ -233,7 +233,7 @@ bool SDScenery::LoadTrack(std::string& strTrack)
|
|||
GfLogDebug("Texture Path : %s\n", _strTexturePath.c_str());
|
||||
loader.AddSearchPath(_strTexturePath);
|
||||
|
||||
std::string strTPath = GetDataDir();
|
||||
std::string strTPath = GfDataDir();
|
||||
strTPath += "data/textures/";
|
||||
GfLogDebug("Texture Path : %s\n", strTPath.c_str());
|
||||
loader.AddSearchPath(strTPath);
|
||||
|
@ -245,7 +245,7 @@ bool SDScenery::LoadTrack(std::string& strTrack)
|
|||
pTrack->getOrCreateStateSet()->setRenderBinDetails(TRACKBIN,"RenderBin");
|
||||
_scenery->addChild(pTrack);
|
||||
#if 0
|
||||
std::string Tpath = GetLocalDir();
|
||||
std::string Tpath = GfLocalDir();
|
||||
Tpath = Tpath+"/track.osg";
|
||||
osgDB::writeNodeFile( *pTrack, Tpath);
|
||||
#endif
|
||||
|
|
|
@ -141,7 +141,7 @@ OSGPLOT::OSGPLOT(
|
|||
osgTitle->setColor(color);
|
||||
|
||||
std::string fontFileUrl = "/vera/Vera.ttf";
|
||||
std::string fontsMainDirectory = GetDataDir();
|
||||
std::string fontsMainDirectory = GfDataDir();
|
||||
fontsMainDirectory = fontsMainDirectory+"data/fonts";
|
||||
fontFileUrl = fontsMainDirectory+fontFileUrl;
|
||||
osgTitle->setFont(fontFileUrl);
|
||||
|
@ -1635,7 +1635,7 @@ osg::ref_ptr <osg::Group> SDHUD::generateHudFromXmlFile(int scrH, int scrW)
|
|||
|
||||
//set the font
|
||||
{
|
||||
std::string fontsMainDirectory = GetDataDir();
|
||||
std::string fontsMainDirectory = GfDataDir();
|
||||
fontsMainDirectory = fontsMainDirectory+"data/fonts";
|
||||
fontFileUrl = fontsMainDirectory+fontFileUrl;
|
||||
text->setFont(fontFileUrl);
|
||||
|
@ -1718,7 +1718,7 @@ osg::ref_ptr <osg::Group> SDHUD::generateHudFromXmlFile(int scrH, int scrW)
|
|||
GfLogDebug("OSGHUD: Generate image object: %s \n", elementId.c_str());
|
||||
|
||||
//start preparing the image
|
||||
std::string filename = GetDataDir();
|
||||
std::string filename = GfDataDir();
|
||||
filename = filename+url;
|
||||
|
||||
//get the bounding box
|
||||
|
|
|
@ -929,12 +929,12 @@ const char* SetupGlobalFileName(char* buf, int size, tgenData* Data, const char*
|
|||
if (Data->WeatherCode == 0)
|
||||
{
|
||||
snprintf(buf,size,"%sdrivers/%s/%s/%s%s",
|
||||
GetLocalDir(),Data->RobotName,Data->CarType,Data->TrackName,Ext);
|
||||
GfLocalDir(),Data->RobotName,Data->CarType,Data->TrackName,Ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buf,size,"%sdrivers/%s/%s/%s-%d%s",
|
||||
GetLocalDir(),Data->RobotName,Data->CarType,Data->TrackName,Data->WeatherCode,Ext);
|
||||
GfLocalDir(),Data->RobotName,Data->CarType,Data->TrackName,Data->WeatherCode,Ext);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -942,12 +942,12 @@ const char* SetupGlobalFileName(char* buf, int size, tgenData* Data, const char*
|
|||
if (Data->WeatherCode == 0)
|
||||
{
|
||||
snprintf(buf,size,"%sdrivers/%s/%s/default%s",
|
||||
GetLocalDir(),Data->RobotName,Data->CarType,Ext);
|
||||
GfLocalDir(),Data->RobotName,Data->CarType,Ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buf,size,"%sdrivers/%s/%s/default-%d%s",
|
||||
GetLocalDir(),Data->RobotName,Data->CarType,Data->WeatherCode,Ext);
|
||||
GfLocalDir(),Data->RobotName,Data->CarType,Data->WeatherCode,Ext);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -530,7 +530,7 @@ reTrackInitRealWeather(void)
|
|||
else
|
||||
{
|
||||
char buffer[1024];
|
||||
snprintf(buffer, sizeof(buffer), "%sconfig/weather.txt", GetLocalDir());
|
||||
snprintf(buffer, sizeof(buffer), "%sconfig/weather.txt", GfLocalDir());
|
||||
|
||||
std::string data = buffer;
|
||||
GfLogDebug("Path weather.txt : %s\n", data.c_str());
|
||||
|
@ -739,7 +739,7 @@ reTrackInitSimuWeather(void)
|
|||
#endif
|
||||
|
||||
std::ostringstream weatherfile;
|
||||
weatherfile << GetDataDir() << "data/weather/" << trackLocal->station << "/"
|
||||
weatherfile << GfDataDir() << "data/weather/" << trackLocal->station << "/"
|
||||
<< std::setw(2) << std::setfill('0') << std::right << now.tm_mday << "-"
|
||||
<< std::setw(2) << std::setfill('0') << std::right << (now.tm_mon + 1) << ".txt";
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ bool ReWebMetar::ReWebMetarFtp(const string& m)
|
|||
CURLcode res;
|
||||
|
||||
char buffer[1024];
|
||||
snprintf(buffer, sizeof(buffer), "%sconfig/weather.txt", GetLocalDir());
|
||||
snprintf(buffer, sizeof(buffer), "%sconfig/weather.txt", GfLocalDir());
|
||||
GfLogDebug("Save Weather file in = %s\n", buffer);
|
||||
GfLogDebug("URL WebMetar = %s\n", m.c_str());
|
||||
|
||||
|
|
Loading…
Reference in a new issue