57 #if PY_VERSION_HEX >= 0x03000000 58 PyObject* PyInit__adonthell (
void);
64 static bool init_python(
const char *application)
66 #if PY_VERSION_HEX >= 0x03000000 70 if (PyImport_AppendInittab (
"_adonthell", PyInit__adonthell) < 0)
74 #if PY_VERSION_HEX >= 0x03050000 75 wchar_t *program = Py_DecodeLocale(application, NULL);
78 Py_SetProgramName(program);
99 #if PY_VERSION_HEX < 0x03000000 104 if (!python::module)
return false;
124 int main(
int argc,
char * argv[])
135 #if !defined (SINGLE_DIR_INST) 142 do if (*str ==
'\\') *str =
'/';
145 str = strrchr (argv[0],
'/');
154 getcwd (buf,
sizeof (buf));
157 do if (*str ==
'\\') *str =
'/';
161 string data_dir(DATA_DIR);
162 while (data_dir.size() >= 3 && data_dir.compare(0, 3,
"../") == 0)
164 str = strrchr (buf,
'/');
169 data_dir = data_dir.substr(3);
206 audio::init (&myconfig);
212 if (!init_python(argv[0]))
214 std::cout <<
"Initializing Python module failed" << std::endl;
221 data::the_player = NULL;
255 if (data::the_player)
256 delete data::the_player;
bool read_adonthellrc()
Reads the configuration file.
Declares the event_handler class.
static bool exec_file(string filename)
Executes a Python script.
PyObject * globals
Global namespace to use in scripts.
static void cleanup()
Cleanup the saved game array.
static void init()
Instanciate the actual event handlers.
string gamedir
Path of the directory that contains the game running at present.
Declares the screen class.
static bool init(string udir, string gdir, string gname, u_int8 qload)
Initialise the saved games array.
Declares the gametime class.
static string info()
Returns information about the current screen settings, suitable for being displayed to the user...
National Language Support.
static bool init(u_int16 nl, u_int16 nh, u_int8 depth, const config &myconfig)
Initializes the video subsystem and creates the required resources.
static void init()
Initialize achievements by loading all available achievements and their permanent unlocked status...
void init_adonthell(void)
SWIG init prototype.
static void init(const string &font)
Empty for now.
static void init(config &myconfig)
Initialize national language support.
Manages in-game achievements.
static void init(string game_dir)
Initialise the game framework.
static string global_data_dir()
Returns the absolute path to the global data directory.
Declares the gamedata and data classes.
static PyObject * import_module(string filename)
Imports a Python module.
static string game_data_dir()
Returns the absolute path to the current game's directory (if any).
u_int8 quick_load
Whether the quick-load feature is enabled (1) or not (0)
static void cleanup()
Delete the event handlers.
int main(int argc, char *argv[])
Game's main function.
Defines the python class. This file is named this way so it doesn't conflicts with Python...
u_int8 audio_volume
The volume: a value betwen 0 and 100.
void parse_arguments(int argc, char *argv[])
See whether any options have been specified on the command line.
static void cleanup()
Delete all themes and fonts currently loaded.
static void insert_path(char *name)
Adds a directory to Python's include path.
string game_name
Name of the game that is running at present.
static void set_game_data_dir(string game_dir)
Specify an additional data directory containing game data.
Declares the win_manager class.
static void init(u_int16 rt_minutes)
Initialize the gametime class.
static string user_data_dir()
Returns the absolute path to the user data directory (usually ~/.adonthell).
This class contains the engine's configuration read either from the config file or from the command l...
This is the heart of the Adonthell engine.
static void cleanup()
Cleanup Python.
static void init()
Initialise Python and insert the Adonthell include paths.