Go to the documentation of this file.
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;
PyObject * globals
Global namespace to use in scripts.
static bool exec_file(string filename)
Executes a Python script.
static string info()
Returns information about the current screen settings, suitable for being displayed to the user.
National Language Support.
static void cleanup()
Cleanup the saved game array.
Declares the event_handler class.
bool read_adonthellrc()
Reads the configuration file.
Declares the screen class.
static void init(u_int16 rt_minutes)
Initialize the gametime class.
string game_name
Name of the game that is running at present.
static string user_data_dir()
Returns the absolute path to the user data directory (usually ~/.adonthell).
Defines the python class. This file is named this way so it doesn't conflicts with Python....
Declares the gamedata and data classes.
static bool init(string udir, string gdir, string gname, u_int8 qload)
Initialise the saved games array.
static void insert_path(char *name)
Adds a directory to Python's include path.
static void init()
Instanciate the actual event handlers.
static void init(config &myconfig)
Initialize national language support.
static void set_game_data_dir(string game_dir)
Specify an additional data directory containing game data.
Declares the win_manager class.
u_int8 audio_volume
The volume: a value betwen 0 and 100.
int main(int argc, char *argv[])
Game's main function.
static void cleanup()
Delete all themes and fonts currently loaded.
static void cleanup()
Cleanup Python.
static void init()
Initialize achievements by loading all available achievements and their permanent unlocked status.
This class contains the engine's configuration read either from the config file or from the command l...
void init_adonthell(void)
SWIG init prototype.
string gamedir
Path of the directory that contains the game running at present.
static PyObject * import_module(string filename)
Imports a Python module.
void parse_arguments(int argc, char *argv[])
See whether any options have been specified on the command line.
static void cleanup()
Delete the event handlers.
static void init(string game_dir)
Initialise the game framework.
u_int8 quick_load
Whether the quick-load feature is enabled (1) or not (0)
This is the heart of the Adonthell engine.
static void init()
Initialise Python and insert the Adonthell include paths.
static bool init(u_int16 nl, u_int16 nh, u_int8 depth, const config &myconfig)
Initializes the video subsystem and creates the required resources.
Declares the gametime class.
static string game_data_dir()
Returns the absolute path to the current game's directory (if any).
static void init(const string &font)
Empty for now.
Manages in-game achievements.
static string global_data_dir()
Returns the absolute path to the global data directory.