summaryrefslogtreecommitdiff
path: root/Config.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-08-07 04:28:51 +0000
committerPetr Mrázek2011-08-07 04:28:51 +0000
commit9c99824a023a959bb9ff908b2f434e02b8289351 (patch)
tree609ee50e778bae6b2eb10f68bf36e8b96752f3e5 /Config.cpp
parent4064cf25797462fc6ac61f578b7e4b6bd31bf6b6 (diff)
downloadstonesense-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.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/Config.cpp b/Config.cpp
index 398abc9..3143be3 100644
--- a/Config.cpp
+++ b/Config.cpp
@@ -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;
}