DEADSOFTWARE

files: cleanup
[flatwaifu.git] / src / sdl / main.c
index 057c82ec2123842550a3ab41bf69df1e14b86aed..2243ce07cdf74ecc3f545e29e7d4e22fda73c6e0 100644 (file)
@@ -1,24 +1,17 @@
-/*
-   Copyright (C) Prikol Software 1996-1997
-   Copyright (C) Aleksey Volynskov 1996-1997
-   Copyright (C) <ARembo@gmail.com> 2011
-
-   This file is part of the Doom2D:Rembo project.
-
-   Doom2D:Rembo is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation.
-
-   Doom2D:Rembo is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/> or
-   write to the Free Software Foundation, Inc.,
-   51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-*/
+/* Copyright (C) 2020 SovietPony
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License ONLY.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 #ifdef __EMSCRIPTEN__
 #  include <emscripten.h>
@@ -32,7 +25,6 @@
 #include "system.h"
 #include "input.h"
 
-#include "my.h" // fexists
 #include "player.h" // pl1 pl2
 #include "menu.h" // G_keyf
 #include "error.h" // logo
@@ -132,7 +124,7 @@ void ERR_failinit (char *s, ...) {
   vprintf(s, ap);
   va_end(ap);
   puts("");
-  exit(1);
+  abort();
 }
 
 void ERR_fatal (char *s, ...) {
@@ -140,14 +132,13 @@ void ERR_fatal (char *s, ...) {
   R_done();
   MUS_done();
   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) {
@@ -489,7 +480,6 @@ static void step (void) {
 }
 
 int main (int argc, char *argv[]) {
-  char *pw;
   logo("main: initialize SDL\n");
   if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1) {
     logo("main: failed to init SDL: %s\n", SDL_GetError());
@@ -517,22 +507,10 @@ int main (int argc, char *argv[]) {
   pl2.kwr = KEY_2;
   pl2.kp = KEY_E;
   srand(SDL_GetTicks());
-  F_startup();
-#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");
   CFG_args(argc, argv);
   CFG_load();
   F_initwads();
-  M_startup();
-  F_allocres();
   S_init();
   MUS_init();
   R_init();
@@ -549,7 +527,6 @@ int main (int argc, char *argv[]) {
   R_done();
   MUS_done();
   S_done();
-  M_shutdown();
   SDL_Quit();
   return 0;
 }