equal
deleted
inserted
replaced
167 |
167 |
168 void DeterminePaths(void) |
168 void DeterminePaths(void) |
169 { |
169 { |
170 char *s; |
170 char *s; |
171 |
171 |
172 MallocT(&_paths.game_data_dir, MAX_PATH); |
172 _paths.game_data_dir = MallocT<char>(MAX_PATH); |
173 ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH); |
173 ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH); |
174 #if defined SECOND_DATA_DIR |
174 #if defined SECOND_DATA_DIR |
175 MallocT(&_paths.second_data_dir, MAX_PATH); |
175 _paths.second_data_dir = MallocT<char>(MAX_PATH); |
176 ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH); |
176 ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH); |
177 #endif |
177 #endif |
178 |
178 |
179 #if defined(USE_HOMEDIR) |
179 #if defined(USE_HOMEDIR) |
180 { |
180 { |
188 _paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR); |
188 _paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR); |
189 } |
189 } |
190 |
190 |
191 #else /* not defined(USE_HOMEDIR) */ |
191 #else /* not defined(USE_HOMEDIR) */ |
192 |
192 |
193 MallocT(&_paths.personal_dir, MAX_PATH); |
193 _paths.personal_dir = MallocT<char>(MAX_PATH); |
194 ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH); |
194 ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH); |
195 |
195 |
196 // check if absolute or relative path |
196 // check if absolute or relative path |
197 s = strchr(_paths.personal_dir, '/'); |
197 s = strchr(_paths.personal_dir, '/'); |
198 |
198 |
224 _highscore_file = str_fmt("%shs.dat", _paths.personal_dir); |
224 _highscore_file = str_fmt("%shs.dat", _paths.personal_dir); |
225 _log_file = str_fmt("%sopenttd.log", _paths.personal_dir); |
225 _log_file = str_fmt("%sopenttd.log", _paths.personal_dir); |
226 |
226 |
227 #if defined CUSTOM_LANG_DIR |
227 #if defined CUSTOM_LANG_DIR |
228 // sets the search path for lng files to the custom one |
228 // sets the search path for lng files to the custom one |
229 MallocT(&_paths.lang_dir, MAX_PATH ); |
229 _paths.lang_dir = MallocT<char>(MAX_PATH); |
230 ttd_strlcpy( _paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH); |
230 ttd_strlcpy( _paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH); |
231 #else |
231 #else |
232 _paths.lang_dir = str_fmt("%slang/", _paths.game_data_dir); |
232 _paths.lang_dir = str_fmt("%slang/", _paths.game_data_dir); |
233 #endif |
233 #endif |
234 |
234 |