Skip to content

Commit

Permalink
Add documentation for warn_early_init_failure()
Browse files Browse the repository at this point in the history
Because the odds of someone altering the early init sequence in the
future and failing to realize the purpose of this code aren't low
enough. (I really should've included it in the main commit.)
  • Loading branch information
irydacea committed Jun 13, 2014
1 parent 170bd82 commit 8cb7d9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/game.cpp
Expand Up @@ -414,6 +414,15 @@ static void init_locale() {
textdomain (PACKAGE);
}

/**
* Print an alert and instructions to stderr about early initialization errors.
*
* This is provided as an aid for users dealing with potential data dir
* configuration issues. The first code to read core WML *has* the
* responsibility to call this function in the event of a problem, to inform
* the user of the most likely possible cause and suggest a course of action
* to solve the issue.
*/
static void warn_early_init_failure()
{
// NOTE: wrap output to 80 columns.
Expand Down Expand Up @@ -452,6 +461,7 @@ static int do_gameloop(int argc, char** argv)
res = font::load_font_config();
if(res == false) {
std::cerr << "could not initialize fonts\n";
// The most common symptom of a bogus data dir path -- warn the user.
warn_early_init_failure();
return 1;
}
Expand Down

0 comments on commit 8cb7d9b

Please sign in to comment.