comparison pwplib/pwplib-unix.c @ 56:5d819ba6891c

More cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 27 May 2010 22:48:37 +0300
parents 85671798fdb3
children
comparison
equal deleted inserted replaced
55:77f40a3c0095 56:5d819ba6891c
1 #define __PWPLIB_C 1 #define __PWPLIB_C
2
3 #undef FISI_HACK /* NOTICE! Enabling this is a hack for Final ISI only */
4 2
5 #include "config.h" 3 #include "config.h"
6 4
7 #include <stdio.h> 5 #include <stdio.h>
8 #include <stdlib.h> 6 #include <stdlib.h>
9
10 #ifdef DRIVE_SDL
11 #include <SDL.h>
12 #endif
13 #include <signal.h> 7 #include <signal.h>
14 #include <time.h> 8 #include <time.h>
15 #include <sys/time.h> 9 #include <sys/time.h>
16 10
11 #ifdef DRIVE_SDL
12 #include <SDL.h>
13 #endif
14
17 #include "pwplib.h" 15 #include "pwplib.h"
16 #include "sound.h"
17 #include "video.h"
18 #include "tty.h" 18 #include "tty.h"
19 19
20 20
21 /******************** random stuff *************************/ 21 /******************** random stuff *************************/
22 22
23 static int sdl_init = 0; 23 static int sdl_init = 0;
24 24
25 extern void pwplib_dummy(); 25 extern void pwplib_dummy();
26 #define pwp_dummy pwplib_dummy
27 26
28 void pwpwrite(const char *fmt, ...) 27 void pwpwrite(const char *fmt, ...)
29 { 28 {
30 if (!pwplib.setup[SETUP_SHUTUP]) { 29 if (!pwplib.setup[SETUP_SHUTUP]) {
31 va_list ap; 30 va_list ap;
98 /******************** initialization *********************/ 97 /******************** initialization *********************/
99 98
100 int pwplib_initcore() 99 int pwplib_initcore()
101 { 100 {
102 int sdl_flags = 0; 101 int sdl_flags = 0;
102
103 pwplib_init_common(); 103 pwplib_init_common();
104 104
105 /*** setup signals, etc ***/ 105 /*** setup signals, etc ***/
106
107 #ifdef DRIVE_SDL 106 #ifdef DRIVE_SDL
108 #ifdef DRIVE_VIDEO 107 #ifdef DRIVE_VIDEO
109 sdl_flags |= SDL_INIT_VIDEO; 108 sdl_flags |= SDL_INIT_VIDEO;
110 #endif 109 #endif
111 #ifdef DRIVE_AUDIO 110 #ifdef DRIVE_AUDIO
112 sdl_flags |= SDL_INIT_AUDIO; 111 sdl_flags |= SDL_INIT_AUDIO;
113 #endif 112 #endif
114 #ifdef FISI_HACK 113 #ifdef FISI_HACK
115 sdl_flags |= SDL_INIT_NOPARACHUTE; 114 sdl_flags |= SDL_INIT_NOPARACHUTE;
116 #endif 115 #endif
117
118 /* With SDL, we let it handle the signals */ 116 /* With SDL, we let it handle the signals */
119 if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_EVENTTHREAD | sdl_flags) != 0) { 117 if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_EVENTTHREAD | sdl_flags) != 0) {
120 pwpwrite("* SDL could not be initialized (%s).\n", SDL_GetError()); 118 pwpwrite("* SDL could not be initialized (%s).\n", SDL_GetError());
121 sdl_init = 0; 119 sdl_init = 0;
122 } else 120 } else