DEADSOFTWARE

headers describes that c-files implements
[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 "render.h"
31 #include "memory.h"
32 #include "error.h"
33 #include "config.h"
34 #include "music.h"
36 void logo (const char *s, ...) {
37 va_list ap;
38 int x, y;
39 va_start(ap, s);
40 vprintf(s, ap);
41 va_end(ap);
42 fflush(stdout);
43 }
45 void logo_gas (int cur, int all) {
46 // stub
47 }
49 static void close_all (void) {
50 S_done();
51 S_donemusic();
52 K_done();
53 R_done();
54 M_shutdown();
55 }
57 void ERR_failinit (char *s, ...) {
58 va_list ap;
59 close_all();
60 va_start(ap, s);
61 vprintf(s, ap);
62 va_end(ap);
63 puts("");
64 exit(1);
65 }
67 void ERR_fatal(char *s,...) {
68 va_list ap;
69 close_all();
70 puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
71 va_start(ap, s);
72 vprintf(s, ap);
73 va_end(ap);
74 puts("");
75 exit(2);
76 }
78 void ERR_quit (void) {
79 void *p;
80 //V_done();
81 //if(!(p=malloc(4000)))
82 puts("Спасибо за то, что вы играли в Операцию \"Смятка\"!");
83 //else {
84 // F_loadres(F_getresid("ENDOOM"),p,0,4000);
85 // memcpy((void*)0xB8000,p,4000);free(p);gotoxy(1,24);
86 //}
87 close_all();
88 CFG_save();
89 exit(0);
90 }