DEADSOFTWARE

cp866: move to common/
[flatwaifu.git] / src / sdl2 / main.c
index 8f89012d628db67e3712c1d4a3ebcfec4f851a1e..9533040a3454bf9ae127a4651619ece810a5f1a0 100644 (file)
@@ -26,9 +26,6 @@
 #include "system.h"
 #include "input.h"
 
-#include "cp866.h"
-
-#include "my.h" // fexists
 #include "player.h" // pl1 pl2
 #include "menu.h" // G_keyf
 #include "error.h" // logo
@@ -43,6 +40,8 @@
 #include "music.h" // S_initmusic S_updatemusic S_donemusic
 #include "render.h" // R_init R_draw R_done
 
+#include "common/cp866.h"
+
 #define TITLE_STR "Doom 2D (SDL2)"
 
 static Uint32 ticks;
@@ -126,7 +125,7 @@ void ERR_failinit (char *s, ...) {
   vprintf(s, ap);
   va_end(ap);
   puts("");
-  exit(1);
+  abort()
 }
 
 void ERR_fatal (char *s, ...) {
@@ -136,12 +135,12 @@ void ERR_fatal (char *s, ...) {
   S_done();
   M_shutdown();
   SDL_Quit();
-  puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
+  puts("\nCRITICAL ERROR:");
   va_start(ap, s);
   vprintf(s, ap);
   va_end(ap);
   puts("");
-  exit(1);
+  abort();
 }
 
 void ERR_quit (void) {
@@ -568,7 +567,6 @@ static void step (void) {
 }
 
 int main (int argc, char **argv) {
-  char *pw;
   CFG_args(argc, argv);
   logo("system: initialize SDL2\n");
   if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_EVENTS) == -1) {
@@ -598,16 +596,7 @@ int main (int argc, char **argv) {
   srand(SDL_GetTicks());
   F_startup();
   CFG_load();
-#ifndef WIN32
-  pw = "/usr/share/doom2d-rembo/doom2d.wad";
-#else
-  pw = "doom2d.wad";
-#endif
-  if (fexists(pw)) {
-    F_addwad(pw);
-  } else {
-    F_addwad("doom2d.wad");
-  }
+  F_addwad("doom2d.wad");
   F_initwads();
   M_startup();
   F_allocres();