25 #define SDL_MAIN_HANDLED 77 int main(
int argc,
char **argv) {
81 std::vector<Common::UString> args;
101 if (
ConfigMan.getBool(
"listdebug",
false)) {
106 error(
"Neither an existing target, nor a path specified");
109 bool useExisting =
false;
110 if (target.
empty()) {
112 if (!target.
empty()) {
113 warning(
"No target specified, but found a target with a matching path");
118 target =
ConfigMan.createGame(path, target);
120 error(
"Failed creating a new config target for the game");
123 warning(
"Creating a new target for this game");
127 error(
"No target \"%s\" in the config file", target.
c_str());
136 logFile =
ConfigMan.getString(
"logfile",
"");
137 if (
ConfigMan.getBool(
"nologfile",
false))
140 if (!logFile.
empty())
142 warning(
"Failed to open log file \"%s\" for writing", logFile.
c_str());
150 error(
"Target \"%s\" is missing a path", target.
c_str());
156 error(
"Invalid path \"%s\"", dirArg.c_str());
160 error(
"No such file or directory \"%s\"", baseDir.
c_str());
162 std::list<const Engines::EngineProbe *> probes;
167 DebugMan.setVerbosityLevelsFromConfig();
176 gameThread->
init(baseDir, probes);
178 if (
ConfigMan.getBool(
"listdebug",
false)) {
205 DebugMan.setConfigToVerbosityLevels();
231 bool newConfig =
false;
269 std::vector<Common::UString> names, descriptions;
270 DebugMan.getDebugChannels(names, descriptions);
272 assert(names.size() == descriptions.size());
274 size_t maxNameLength = 0;
275 for (std::vector<Common::UString>::const_iterator n = names.begin(); n != names.end(); n++)
276 maxNameLength =
MAX(maxNameLength, n->size());
278 assert(maxNameLength < INT_MAX);
280 for (
size_t i = 0; i < names.size(); i++)
281 std::printf(
"%-*s - %s\n", (
int) maxNameLength, names[i].c_str(), descriptions[i].c_str());
293 status(
"Graphics subsystem initialized");
295 status(
"Sound subsystem initialized");
297 status(
"Event subsystem initialized");
Inter-thread request events.
The thread the game logic runs in.
bool parseCommandline(const std::vector< Common::UString > &argv, Common::UString &target, int &code)
The global graphics manager.
void init(const Common::UString &baseDir, const std::list< const EngineProbe *> &probes)
A class holding an UTF-8 string.
The global config manager.
int main(int argc, char **argv)
The Aurora texture manager.
static bool isDirectory(const UString &p)
Does specified path exist and is it a directory?
Utility functions to handle files used in BioWare's Aurora engine.
Command line arguments parser.
static bool configFileIsBroken
Basic exceptions to throw.
Threading system helpers.
const char * c_str() const
Return the (utf8 encoded) string data.
The debug manager, managing debug channels.
#define ConfigMan
Shortcut for accessing the config manager.
static bool isRegularFile(const UString &p)
Does specified path exist and is it a regular file?
Utility templates and functions.
void initThreads()
Initialize the global threading system.
The global events manager.
Types and functions related to language.
static UString canonicalize(const UString &p, bool resolveSymLinks=true)
Return the canonical, absolutized and normalized path.
XML parsing helpers, using libxml2.
The global sound manager, handling all sound output.
bool empty() const
Is the string empty?
#define SoundMan
Shortcut for accessing the sound manager.
The graphics queue manager.
void warning(const char *s,...)
#define DebugMan
Shortcut for accessing the debug manager.
#define EventMan
Shortcut for accessing the events manager.
The game thread, running all game logic.
The Aurora cursor manager.
bool initedThreads()
Was the global threading system initialized?
void exceptionDispatcherError(const char *s,...)
Exception dispatcher that prints the exception as an error, and adds another reason on top...
void deinitXML()
Deinitialize the XML subsystem.
Application or game defaults.
The global talk manager for Aurora strings.
void createEngineProbes(std::list< const ::Engines::EngineProbe *> &probes)
The global timer manager.
void status(const char *s,...)
void initXML()
Initialize the XML subsystem.
The global engine manager, omniscient about all engines.
static void initPlatform()
void destroyEngineProbes(std::list< const Engines::EngineProbe *> &probes)
Destroy all the probes again.
void NORETURN_PRE error(const char *s,...)
void clear()
Clear the string's contents.
#define GfxMan
Shortcut for accessing the graphics manager.
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
Utility functions to handle the engines.