Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv24189/Source
Modified Files:
CSPSim.cpp Config.cpp EventMapIndex.cpp ScreenInfo.cpp
SimpleConfig.cpp
Log Message:
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** CSPSim.cpp 19 Jul 2003 14:14:37 -0000 1.33
--- CSPSim.cpp 23 Jul 2003 01:28:58 -0000 1.34
***************
*** 212,216 ****
// setup osg search path for external data files
- std::string data_path = getDataPath();
std::string image_path = getDataPath("ImagePath");
std::string model_path = getDataPath("ModelPath");
--- 212,215 ----
***************
*** 230,234 ****
// open the primary data archive
! std::string archive_file = simdata::ospath::join(data_path, "sim.dar");
try {
simdata::DataArchive *sim = new simdata::DataArchive(archive_file.c_str(), 1);
--- 229,234 ----
// open the primary data archive
! std::string cache_path = getCachePath();
! std::string archive_file = simdata::ospath::join(cache_path, "sim.dar");
try {
simdata::DataArchive *sim = new simdata::DataArchive(archive_file.c_str(), 1);
Index: Config.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Config.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Config.cpp 26 Jun 2003 09:25:23 -0000 1.6
--- Config.cpp 23 Jul 2003 01:28:58 -0000 1.7
***************
*** 46,49 ****
--- 46,66 ----
}
+ std::string getCachePath() {
+ return g_Config.getPath("Paths", "CachePath", ".", true);
+ }
+
+ std::string getConfigPath() {
+ std::string base = g_Config.getConfigurationDirectory();
+ return g_Config.getPath("Paths", "ConfigPath", base, true);
+ }
+
+ std::string getConfigPath(std::string const &pathname) {
+ std::string path = g_Config.getPath("Paths", pathname, ".", true);
+ if (!simdata::ospath::isabs(path)) {
+ path = simdata::ospath::join(getConfigPath(), path);
+ }
+ return path;
+ }
+
std::string getDataPath() {
return g_Config.getPath("Paths", "DataPath", ".", true);
Index: EventMapIndex.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/EventMapIndex.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** EventMapIndex.cpp 26 Jun 2003 09:25:23 -0000 1.6
--- EventMapIndex.cpp 23 Jul 2003 01:28:58 -0000 1.7
***************
*** 76,80 ****
osgDB::DirectoryContents dc;
osgDB::DirectoryContents::iterator file;
! path = getDataPath("InputMapPath");
CSP_LOG(APP, INFO, "Looking for human interface device mappings in '" << path << "'");
dc = osgDB::getDirectoryContents(path);
--- 76,80 ----
osgDB::DirectoryContents dc;
osgDB::DirectoryContents::iterator file;
! path = getConfigPath("InputMapPath");
CSP_LOG(APP, INFO, "Looking for human interface device mappings in '" << path << "'");
dc = osgDB::getDirectoryContents(path);
Index: ScreenInfo.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ScreenInfo.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ScreenInfo.cpp 19 Jul 2003 14:08:03 -0000 1.18
--- ScreenInfo.cpp 23 Jul 2003 01:28:58 -0000 1.19
***************
*** 68,76 ****
ScreenInfo::ScreenInfo(float pos_x, float pos_y, std::string const &name, std::string const &text):
! //m_TTFPath("screeninfo.ttf"),
! m_TTFPath("ltype.ttf"),
m_FontSize(20),
! //m_CharacterSize(14),
! m_CharacterSize(11),
m_Text(0) {
m_Text = makeText(pos_x,pos_y - m_CharacterSize, text);
--- 68,76 ----
ScreenInfo::ScreenInfo(float pos_x, float pos_y, std::string const &name, std::string const &text):
! m_TTFPath("screeninfo.ttf"),
! //m_TTFPath("ltype.ttf"),
m_FontSize(20),
! m_CharacterSize(14),
! //m_CharacterSize(11),
m_Text(0) {
m_Text = makeText(pos_x,pos_y - m_CharacterSize, text);
Index: SimpleConfig.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/SimpleConfig.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** SimpleConfig.cpp 22 Jul 2003 15:55:08 -0000 1.7
--- SimpleConfig.cpp 23 Jul 2003 01:28:58 -0000 1.8
***************
*** 406,409 ****
--- 406,417 ----
}
+ std::string SimpleConfig::getConfigurationPath() const {
+ return m_file;
+ }
+
+ std::string SimpleConfig::getConfigurationDirectory() const {
+ return simdata::ospath::dirname(m_file);
+ }
+
bool SimpleConfig::open(const std::string &fn) {
if (fn != "") {
|