|
From: Charles L. <cn...@us...> - 2005-12-17 22:54:45
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15878 Modified Files: MercuryTheme.cpp MercuryTheme.h Log Message: Add stuff for Getting files & models by name. Index: MercuryTheme.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTheme.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MercuryTheme.h 12 Oct 2005 00:57:51 -0000 1.4 --- MercuryTheme.h 17 Dec 2005 22:54:36 -0000 1.5 *************** *** 50,55 **** --- 50,61 ---- /** Get path to a file, in any theme. This will check to see if any of the themes have the file in order. If the file exists, it will put the path to the file (including the file) in Path and return true, else it will return false. */ bool GetPathToFile( const CString & File, CString & Path ); + + /** Get path to file in the File/ folder */ + CString GetPathToFile( const CString &Name ); /** Get the path to a specific graphic, check all themes for the graphic, and if none is found, return the path to the default missing image. */ CString GetPathToGraphic( const CString &Name ); + /** Get the path to a specific model, check all themes for the graphic, and if none is found, return the path to the default missing model. */ + CString GetPathToModel( const CString &Name ); + private: std::vector < MercuryTheme > *m_vThemes; *************** *** 60,63 **** --- 66,71 ---- /** Get the path to a theme according to what metrics wants */ #define GET_GRAPHIC_BY_NAME( x ) THEME.GetPathToGraphic( THEME.GetMetricS( GetName(), x ) ) + #define GET_MODEL_BY_NAME( x ) THEME.GetPathToModel( THEME.GetMetricS( GetName(), x ) ) + #define GET_FILE_BY_NAME( x ) THEME.GetPathToFile( THEME.GetMetricS( GetName(), x ) ) #endif Index: MercuryTheme.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTheme.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MercuryTheme.cpp 11 Oct 2005 21:03:44 -0000 1.3 --- MercuryTheme.cpp 17 Dec 2005 22:54:36 -0000 1.4 *************** *** 113,116 **** --- 113,125 ---- } + CString MercuryThemeManager::GetPathToFile( const CString & Name ) + { + CString Ret; + CString In = "Files/" + Name; + if ( !GetPathToFile( In, Ret ) ) + Ret = ""; + return Ret; + } + CString MercuryThemeManager::GetPathToGraphic( const CString & Name ) { *************** *** 122,125 **** --- 131,143 ---- } + CString MercuryThemeManager::GetPathToModel( const CString &Name ) + { + CString Ret; + CString In = "Models/" + Name; + if ( !GetPathToFile( In, Ret ) ) + Ret = "Themes/_missing.txt"; + return Ret; + } + /* * (c) 2005 Charles Lohr |