Skip to content

Commit

Permalink
Get rid of safemode, it's unusable anyway. Show MessageBox instead
Browse files Browse the repository at this point in the history
  • Loading branch information
isage committed Apr 27, 2017
1 parent 55980a6 commit e90a96d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 220 deletions.
165 changes: 0 additions & 165 deletions src/graphics/safemode.cpp

This file was deleted.

29 changes: 0 additions & 29 deletions src/graphics/safemode.h

This file was deleted.

30 changes: 4 additions & 26 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <io.h>
#include <direct.h>
#endif
#include "graphics/safemode.h"
//#include "main.h"
#include "game.h"
#include "map.h"
Expand Down Expand Up @@ -47,17 +46,7 @@ static void fatal(const char *str)
{
staterr("fatal: '%s'", str);

if (!safemode::init())
{
safemode::moveto(SM_UPPER_THIRD);
safemode::print("Fatal Error");

safemode::moveto(SM_CENTER);
safemode::print("%s", str);

safemode::run_until_key();
safemode::close();
}
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", str, NULL);
}

static bool check_data_exists()
Expand All @@ -67,18 +56,7 @@ char fname[MAXPATHLEN];
sprintf(fname, "%s/npc.tbl", data_dir);
if (file_exists(fname)) return 0;

if (!safemode::init())
{
safemode::moveto(SM_UPPER_THIRD);
safemode::print("Fatal Error");

safemode::moveto(SM_CENTER);
safemode::print("Missing \"%s\" directory.", data_dir);
safemode::print("Please copy it over from a Doukutsu installation.");

safemode::run_until_key();
safemode::close();
}
fatal("Missing \"data\" directory.\nPlease copy it over from a Doukutsu installation.");

return 1;
}
Expand Down Expand Up @@ -317,9 +295,9 @@ bool freshstart;
// so we know the initial screen resolution.
settings_load();

if (Graphics::init(settings->resolution)) { staterr("Failed to initialize graphics."); return 1; }
if (Graphics::init(settings->resolution)) { fatal("Failed to initialize graphics."); return 1; }
Graphics::SetFullscreen(settings->fullscreen);
if (font_init()) { staterr("Failed to load font."); return 1; }
if (font_init()) { fatal("Failed to load font."); return 1; }


if (check_data_exists())
Expand Down

0 comments on commit e90a96d

Please sign in to comment.