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
//
- (NSString *) baseDirectoryPath;
- (NSString *) getMapDirectory;
- (NSString *) getFinalMapDirectory;
- (NSString *) getProgDirectory;

View File

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

View File

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