diff --git a/src/sdl2/main.c b/src/sdl2/main.c
index 8f89012d628db67e3712c1d4a3ebcfec4f851a1e..98fb2cf84ef2506bf1cb839b31c1e0f46c275ce5 100644 (file)
--- a/src/sdl2/main.c
+++ b/src/sdl2/main.c
#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
#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;
vprintf(s, ap);
va_end(ap);
puts("");
- exit(1);
+ abort();
}
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) {
}
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) {
pl2.kwr = KEY_2;
pl2.kp = KEY_E;
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();
S_init();
MUS_init();
R_init();
R_done();
MUS_done();
S_done();
- M_shutdown();
SDL_Quit();
return 0;
}