diff options
| author | Petr Mrázek | 2011-08-07 04:28:51 +0000 |
|---|---|---|
| committer | Petr Mrázek | 2011-08-07 04:28:51 +0000 |
| commit | 9c99824a023a959bb9ff908b2f434e02b8289351 (patch) | |
| tree | 609ee50e778bae6b2eb10f68bf36e8b96752f3e5 /Config.cpp | |
| parent | 4064cf25797462fc6ac61f578b7e4b6bd31bf6b6 (diff) | |
| download | stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.gz stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.bz2 stonesense-9c99824a023a959bb9ff908b2f434e02b8289351.tar.xz | |
Make stonesense use DF/stonesense for all resources.
Diffstat (limited to 'Config.cpp')
| -rw-r--r-- | Config.cpp | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -554,21 +554,26 @@ void parseConfigLine( string line ){ } -bool loadConfigFile(){ - string line; - ifstream myfile ("init.txt"); - if (myfile.is_open() == false) - { - cout << "Cannot find init file" << endl; - return false; - } +bool loadConfigFile() +{ + string line; + ALLEGRO_PATH * p =al_create_path("stonesense/init.txt"); + const char * path = al_path_cstr(p,ALLEGRO_NATIVE_PATH_SEP); + ifstream myfile (path); + if (myfile.is_open() == false) + { + cout << "Cannot find init file" << endl; + al_destroy_path(p); + return false; + } - while ( !myfile.eof() ) - { - getline (myfile,line); - cout << line << endl; - parseConfigLine( line ); - } - myfile.close(); - return true; + while ( !myfile.eof() ) + { + getline (myfile,line); + cout << line << endl; + parseConfigLine( line ); + } + myfile.close(); + al_destroy_path(p); + return true; } |
