src/file.cpp

changeset 457
3327a32436f4
parent 455
c5d14d112034
child 458
cb360f4d8979
equal deleted inserted replaced
456:ae4fea87d6a1 457:3327a32436f4
32 #include "gldraw.h" 32 #include "gldraw.h"
33 #include "build/moc_file.cpp" 33 #include "build/moc_file.cpp"
34 34
35 cfg (str, io_ldpath, ""); 35 cfg (str, io_ldpath, "");
36 cfg (str, io_recentfiles, ""); 36 cfg (str, io_recentfiles, "");
37 cfg (bool, io_logostuds, false);
37 extern_cfg (str, net_downloadpath); 38 extern_cfg (str, net_downloadpath);
38 39
39 static bool g_loadingMainFile = false; 40 static bool g_loadingMainFile = false;
40 static const int g_MaxRecentFiles = 5; 41 static const int g_MaxRecentFiles = 5;
41 static bool g_aborted = false; 42 static bool g_aborted = false;
174 } 175 }
175 176
176 // ============================================================================= 177 // =============================================================================
177 // ----------------------------------------------------------------------------- 178 // -----------------------------------------------------------------------------
178 File* openLDrawFile (str relpath, bool subdirs) { 179 File* openLDrawFile (str relpath, bool subdirs) {
180 {
181 File* logofile;
182
183 // Special exception for logoed studs:
184 // stud.dat -> stud-logo.dat
185 // stud2.dat -> stud2-logo.dat
186 // NOTE: This is probably going to change in the very near future!
187 if (
188 relpath == "stud.dat" &&
189 (logofile = openLDrawFile ("stud-logo.dat", subdirs)) != null
190 )
191 return logofile;
192
193 if (
194 relpath == "stud2.dat" &&
195 (logofile = openLDrawFile ("stud2-logo.dat", subdirs)) != null
196 )
197 return logofile;
198 }
199
179 print ("%1: Try to open %2\n", __func__, relpath); 200 print ("%1: Try to open %2\n", __func__, relpath);
180 File* f = new File; 201 File* f = new File;
181 str fullPath; 202 str fullPath;
182 203
183 // LDraw models use Windows-style path separators. If we're not on Windows, 204 // LDraw models use Windows-style path separators. If we're not on Windows,

mercurial