DEADSOFTWARE

system: game itself do not depends on sdl
[flatwaifu.git] / src / error.c
1 /*
2 Copyright (C) Prikol Software 1996-1997
3 Copyright (C) Aleksey Volynskov 1996-1997
4 Copyright (C) <ARembo@gmail.com> 2011
6 This file is part of the Doom2D:Rembo project.
8 Doom2D:Rembo is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License version 2 as
10 published by the Free Software Foundation.
12 Doom2D:Rembo is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <http://www.gnu.org/licenses/> or
19 write to the Free Software Foundation, Inc.,
20 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
23 #include "glob.h"
24 #include <stdio.h>
25 #include <string.h>
26 #include <stdarg.h>
27 #include <stdlib.h>
28 #include "sound.h"
29 #include "render.h"
30 #include "memory.h"
31 #include "error.h"
32 #include "config.h"
33 #include "music.h"
35 void logo (const char *s, ...) {
36 va_list ap;
37 va_start(ap, s);
38 vprintf(s, ap);
39 va_end(ap);
40 fflush(stdout);
41 }
43 void logo_gas (int cur, int all) {
44 // stub
45 }
47 static void close_all (void) {
48 S_done();
49 S_donemusic();
50 M_shutdown();
51 R_done();
52 }
54 void ERR_failinit (char *s, ...) {
55 va_list ap;
56 //close_all();
57 va_start(ap, s);
58 vprintf(s, ap);
59 va_end(ap);
60 puts("");
61 exit(1);
62 }
64 void ERR_fatal (char *s,...) {
65 va_list ap;
66 close_all();
67 puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
68 va_start(ap, s);
69 vprintf(s, ap);
70 va_end(ap);
71 puts("");
72 exit(2);
73 }
75 void ERR_quit (void) {
76 puts("Спасибо за то, что вы играли в Операцию \"Смятка\"!");
77 //F_loadres(F_getresid("ENDOOM"),p,0,4000);
78 close_all();
79 CFG_save();
80 exit(0);
81 }