fixes to resource unpacker and resource builder
[awish.git] / src / gameglobals.h
blob3c225a5543c94196e5b1c777e7d653a4014e8a01
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;
30 extern SDL_Surface *backs[8]; //0: title
33 typedef struct {
34 int count;
35 SDL_Surface *spr[256][2];
36 } SpriteBank;
38 extern SpriteBank banks[256];
41 enum {
42 LB_GVAR,
43 LB_TVAR,
44 LB_SVAR,
45 LB_CODE,
46 LB_CONST
50 typedef struct LabelInfo {
51 struct LabelInfo *next;
52 char *name;
53 int type;
54 int value;
55 } LabelInfo;
57 //extern LabelInfo *labels;
59 extern void fatal (const char *fmt, ...) __attribute__((__noreturn__)) __attribute__((format(printf, 1, 2)));
61 extern int loadVMCode (ResFile *resfile);
63 extern void freeLabels (void);
64 extern LabelInfo *findLabel (const char *name);
66 extern int findPC (const char *name);
67 extern int findVarIndex (const char *name);
68 extern int findGVarIndex (const char *name);
69 extern int findTVarIndex (const char *name);
70 extern int findSVarIndex (const char *name);
71 extern int findConst (const char *name);
73 extern void initLabels (void);
76 #include "vm_gamelabels.h"
79 #endif