added some sounds
[awish.git] / src / gameglobals.h
blob5913f7de2ba67e44fc0983275b82139850a46618
1 /*
2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #ifndef _GAMEGLOBALS_H_
16 #define _GAMEGLOBALS_H_
18 #include "stdarg.h"
19 #include "stdlib.h"
20 #include "stdio.h"
22 #include "resfile.h"
23 #include "vm.h"
25 #include "SDL.h"
28 extern ResFile resfile;
29 extern ResFile sndfile;
31 extern SDL_Surface *backs[8]; //0: title
34 typedef struct {
35 int count;
36 SDL_Surface *spr[256][2];
37 } SpriteBank;
39 extern SpriteBank banks[256];
43 extern void fatal (const char *fmt, ...) __attribute__((__noreturn__)) __attribute__((format(printf, 1, 2)));
45 extern void initLabels (void);
48 extern Uint32 getSeedH (void);
49 extern Uint32 getSeedL (void);
50 extern Uint32 getSeed (void);
52 extern void setSeedHL (Uint32 h, Uint32 l);
53 extern void setSeedH (Uint32 u);
54 extern void setSeedL (Uint32 u);
55 extern void setSeed (Uint32 u);
57 extern Uint32 randUInt32 (void);
60 extern int loadCodeFile (ResFile *resfile, int pc, int idx);
63 extern int loadSound (int idx); // !0: error
64 extern int unloadSound (int idx); // !0: error (not loaded)
65 extern int isSoundLoaded (int idx); // bool
66 extern int playSound (int idx, int chan); // returns channel or -1
67 extern int stopChannel (int chan); // -1: all
68 extern int isChannelPlaying (int chan); // bool (-1: how many channels are playing?)
70 extern void unloadAllSounds (void);
73 #include "vm_gamelabels.h"
76 #endif