Export the base directory of the open project

Project -baseDirectoryPath returns the absolute path to the directory from
which the .qpr file was loaded.
This commit is contained in:
Jeff Teunissen 2010-10-10 03:37:43 -04:00
parent 39da12282c
commit 34cf3f7570
3 changed files with 8 additions and 1 deletions

View file

@ -89,6 +89,7 @@ extern id project_i;
// //
// methods to query the project file // methods to query the project file
// //
- (NSString *) baseDirectoryPath;
- (NSString *) getMapDirectory; - (NSString *) getMapDirectory;
- (NSString *) getFinalMapDirectory; - (NSString *) getFinalMapDirectory;
- (NSString *) getProgDirectory; - (NSString *) getProgDirectory;

View file

@ -344,6 +344,11 @@ id project_i;
return nil; return nil;
} }
- (NSString *) baseDirectoryPath
{
return basepathinfo_i;
}
- (NSString *) getMapDirectory - (NSString *) getMapDirectory
{ {
return path_mapdirectory; return path_mapdirectory;

View file

@ -8,6 +8,7 @@
#include "TexturePalette.h" #include "TexturePalette.h"
#include "Preferences.h" #include "Preferences.h"
#include "Project.h"
#include "Map.h" #include "Map.h"
#include "Entity.h" #include "Entity.h"
#include "QuakeEd.h" #include "QuakeEd.h"
@ -191,7 +192,7 @@ TEX_InitFromWad (const char *path)
start = Sys_DoubleTime (); start = Sys_DoubleTime ();
newpath = [[preferences_i getProjectPath] cString]; newpath = [[project_i baseDirectoryPath] cString];
newpath = va ("%s%s%s", newpath, (newpath[0] ? "/" : ""), path); newpath = va ("%s%s%s", newpath, (newpath[0] ? "/" : ""), path);
// free any textures // free any textures