Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-21 06:13:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-21 06:13:36 +0400
commitef218c75edf975b2f3946bd16194cc9679dd2d31 (patch)
treeebe5b13ae6b11fb126c4143fecf3ed46ce5ad827 /source/gameengine
parent9ec0ea91f02b312ecce8c7b6754db54ce9ba8a1a (diff)
- add convenience functions BLI_split_dir_part / BLI_split_file_part, which just call BLI_split_dirfile().
- add a fixed value for bprogdir (the dir of bprogname), since it was being used for resource lookups.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index ea17b9adcfd..78ea2aac8ce 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -117,6 +117,7 @@ const int kMinWindowWidth = 100;
const int kMinWindowHeight = 100;
char bprogname[FILE_MAX];
+char bprogdir[FILE_MAX];
static void mem_error_cb(const char *errorStr)
{
@@ -380,6 +381,7 @@ int main(int argc, char** argv)
#endif /* __alpha__ */
#endif /* __linux__ */
BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]);
+ BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir));
#ifdef __APPLE__
// Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh)
/*
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index e86831b9323..c7da650f988 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -502,7 +502,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
BLI_path_abs(cpath, gp_GamePythonPath);
} else {
/* Get the dir only */
- BLI_split_dirfile(gp_GamePythonPath, cpath, NULL, sizeof(cpath), 0);
+ BLI_split_dir_part(gp_GamePythonPath, cpath, sizeof(cpath));
}
if((dp = opendir(cpath)) == NULL) {
@@ -1732,7 +1732,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename)
PyObject *item;
char expanded[FILE_MAXDIR + FILE_MAXFILE];
- BLI_split_dirfile(filename, expanded, NULL, sizeof(expanded), 0); /* get the dir part of filename only */
+ BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* get the dir part of filename only */
BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */
item= PyUnicode_DecodeFSDefault(expanded);