From bfd22dfe44a5ea119f455f6eb0a24ddd7b149225 Mon Sep 17 00:00:00 2001 From: iobyte Date: Sat, 5 Feb 2022 17:02:17 +0000 Subject: [PATCH] use new function to toggle widget git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8004 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8db3362e79795065531751ed8be831e90955b25f Former-commit-id: dd0466d2fd0d64569347bad1de1544e8467defc2 --- src/modules/graphic/osggraph/Viewer/OsgHUD.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/modules/graphic/osggraph/Viewer/OsgHUD.cpp b/src/modules/graphic/osggraph/Viewer/OsgHUD.cpp index 3d36efaf..46a077d1 100644 --- a/src/modules/graphic/osggraph/Viewer/OsgHUD.cpp +++ b/src/modules/graphic/osggraph/Viewer/OsgHUD.cpp @@ -1472,20 +1472,8 @@ void SDHUD::ToggleHUDwidgets(const std::string &widgets) void SDHUD::ToggleHUDdriverinput() { - hudWidgets["driverinputWidget"]->setNodeMask(1 - hudWidgets["driverinputWidget"]->getNodeMask()); + ToggleHUDwidget("driverinputWidget"); hudImgRotableElements["driverinput-wheel"]->setNodeMask(hudWidgets["driverinputWidget"]->getNodeMask()); - - //save the current status in the config file - std::string configFileUrl= GetLocalDir(); - configFileUrl.append("config/osghudconfig.xml"); - std::string path= "widgets/driverinputWidget"; - std::string attribute= "enabled"; - int value = hudWidgets["driverinputWidget"]->getNodeMask(); - - //read the config file, update the value and write it back - void *paramHandle = GfParmReadFile(configFileUrl.c_str(), GFPARM_RMODE_STD); - GfParmSetNum(paramHandle, path.c_str(), attribute.c_str(), NULL, (int)value); - GfParmWriteFile(NULL, paramHandle, "osghudconfig"); } osg::ref_ptr SDHUD::generateHudFromXmlFile(int scrH, int scrW)