Code cleanup: don't use btempdir/bprogdir/bprogname globals anymore, but wrap

in BLI_ functions.
This commit is contained in:
2011-10-21 17:37:38 +00:00
parent 4d48dbe5fd
commit 00735ed9e4
17 changed files with 104 additions and 79 deletions

View File

@@ -76,9 +76,6 @@ extern "C"
int GHOST_HACK_getFirstFile(char buf[]);
extern char bprogname[]; /* holds a copy of argv[0], from creator.c */
extern char btempdir[]; /* use this to store a valid temp directory */
// For BLF
#include "BLF_api.h"
#include "BLF_translation.h"
@@ -116,9 +113,6 @@ extern char datatoc_bfont_ttf[];
const int kMinWindowWidth = 100;
const int kMinWindowHeight = 100;
char bprogname[FILE_MAX];
char bprogdir[FILE_MAX];
static void mem_error_cb(const char *errorStr)
{
fprintf(stderr, "%s", errorStr);
@@ -380,8 +374,8 @@ int main(int argc, char** argv)
signal (SIGFPE, SIG_IGN);
#endif /* __alpha__ */
#endif /* __linux__ */
BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]);
BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir));
BLI_init_program_path(argv[0]);
BLI_init_temporary_dir(NULL);
#ifdef __APPLE__
// Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh)
/*
@@ -786,7 +780,7 @@ int main(int argc, char** argv)
}
else
{
bfd = load_game_data(bprogname, filename[0]? filename: NULL);
bfd = load_game_data(BLI_program_path(), filename[0]? filename: NULL);
}
//::printf("game data loaded from %s\n", filename);