DEADSOFTWARE

Cleanup includes
[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 "keyb.h"
29 #include "sound.h"
30 #include "vga.h"
31 #include "memory.h"
32 #include "error.h"
33 #include "config.h"
35 void close_all(void) {
36 S_done();
37 S_donemusic();
38 K_done();
39 V_done();
40 M_shutdown();
41 }
43 void ERR_failinit(char *s,...) {
44 va_list ap;
46 close_all();
47 va_start(ap,s);
48 vprintf(s,ap);
49 va_end(ap);
50 puts("");
51 exit(1);
52 }
54 void ERR_fatal(char *s,...) {
55 va_list ap;
57 close_all();
58 puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
59 va_start(ap,s);
60 vprintf(s,ap);
61 va_end(ap);
62 puts("");
63 exit(2);
64 }
66 void ERR_quit(void) {
67 void *p;
68 //V_done();
69 //if(!(p=malloc(4000)))
70 puts("Спасибо за то, что вы играли в Операцию \"Смятка\"!");
71 //else {
72 // F_loadres(F_getresid("ENDOOM"),p,0,4000);
73 // memcpy((void*)0xB8000,p,4000);free(p);gotoxy(1,24);
74 //}
75 close_all();
76 CFG_save();
77 exit(0);
78 }