use GfParmReadFileLocal

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8017 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 4bb00ae744c02b63d61e423c563b03adcc47a6d6
Former-commit-id: 2ddb2d97463f9d137b8d5b84959bddd232b2d9d2
This commit is contained in:
iobyte 2022-02-09 18:22:53 +00:00
parent e3f17eb886
commit 36af54601b

View file

@ -1448,14 +1448,12 @@ void SDHUD::ToggleHUDwidget(const std::string &widget)
hudWidgets[widget]->setNodeMask(1 - hudWidgets[widget]->getNodeMask());
//save the current status in the config file
std::string configFileUrl = GetLocalDir();
configFileUrl.append("config/osghudconfig.xml");
std::string path = "widgets/" + widget;
std::string attribute = "enabled";
int value = hudWidgets[widget]->getNodeMask();
//read the config file, update the value and write it back
void *paramHandle = GfParmReadFile(configFileUrl, GFPARM_RMODE_STD);
void *paramHandle = GfParmReadFileLocal("config/osghudconfig.xml", GFPARM_RMODE_STD);
GfParmSetNum(paramHandle, path.c_str(), attribute.c_str(), NULL, (int)value);
GfParmWriteFile(NULL, paramHandle, "osghudconfig");
}
@ -1502,13 +1500,8 @@ osg::ref_ptr <osg::Group> SDHUD::generateHudFromXmlFile(int scrH, int scrW)
std::string subSectionPath;
std::string subSectionName;
std::string configFileUrl= GetLocalDir();
configFileUrl.append("config/osghudconfig.xml");
// int paramValue = 0;
//open the file
void *paramHandle = GfParmReadFile(configFileUrl, GFPARM_RMODE_STD);
void *paramHandle = GfParmReadFileLocal("config/osghudconfig.xml", GFPARM_RMODE_STD);
//GfLogInfo("OSGHUD: Try to find all mains sections: %s \n", subSectionName.c_str());