share/solid.o \
share/binary.o \
share/base_config.o \
+ share/common.o \
share/mapc.o
BALL_OBJS := \
share/lang.o \
SDL_Joystick *joy = NULL;
int t1, t0, uniform;
+ config_exec_path = argv[0];
+
lang_init("neverball", CONFIG_LOCALE);
text_init();
int camera = 0;
SDL_Joystick *joy = NULL;
+ config_exec_path = argv[0];
+
srand((int) time(NULL));
lang_init("neverball", CONFIG_LOCALE);
#include "base_config.h"
#include "glext.h"
#include "vec3.h"
+#include "common.h"
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
+const char *config_exec_path;
+
/*
* Attempt to find the game data directory. Search the command line
* parameter, the environment, and the hard-coded default, in that
return 1;
}
- if (config_test(CONFIG_DATA, file))
+ dir = path_resolve(config_exec_path, CONFIG_DATA);
+
+ if (config_test(dir, file))
{
- strncpy(data_path, CONFIG_DATA, MAXSTR);
+ strncpy(data_path, dir, MAXSTR);
return 1;
}
const char *config_data(const char *);
const char *config_user(const char *);
+extern const char *config_exec_path;
+
int config_data_path(const char *, const char *);
int config_user_path(const char *);
#include <errno.h>
#include "lang.h"
+#include "common.h"
+#include "base_config.h"
/*---------------------------------------------------------------------------*/
#if ENABLE_NLS
char *dir = getenv("NEVERBALL_LOCALE");
+ if (!dir)
+ dir = path_resolve(config_exec_path, default_dir);
+
errno = 0;
if (!setlocale(LC_ALL, ""))
setlocale(LC_NUMERIC, "C");
- bindtextdomain(domain, dir ? dir : default_dir);
+ bindtextdomain(domain, dir);
bind_textdomain_codeset(domain, DEFAULT_CODESET);
textdomain(domain);
#else
struct s_file f;
FILE *fin;
+ config_exec_path = argv[0];
+
if (argc > 2)
{
if (argc > 3 && strcmp(argv[3], "--debug") == 0)