Subversion Repositories eduke32

Rev

Rev 5050 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2726 hendricks2 1
//
2
// Definitions of common game-only data structures/functions
3
// (and declarations of data appearing in both)
4
// for EDuke32 and Mapster32
5
//
6
 
7
#ifndef EDUKE32_COMMON_GAME_H_
8
#define EDUKE32_COMMON_GAME_H_
9
 
4766 hendricks2 10
#ifdef __cplusplus
11
extern "C" {
12
#endif
13
 
4557 hendricks2 14
extern int32_t usecwd;
15
 
2726 hendricks2 16
#define GAMEFLAG_DUKE       0x00000001
17
#define GAMEFLAG_NAM        0x00000002
18
#define GAMEFLAG_NAPALM     0x00000004
19
#define GAMEFLAG_WW2GI      0x00000008
3654 terminx 20
#define GAMEFLAG_ADDON      0x00000010
3803 terminx 21
#define GAMEFLAG_SHAREWARE  0x00000020
22
#define GAMEFLAG_DUKEBETA   0x00000060 // includes 0x20 since it's a shareware beta
5050 hendricks2 23
#define GAMEFLAGMASK        0x0000007F // flags allowed from grpinfo
4887 hendricks2 24
#define GAMEFLAG_NWINTER    0x00000080
2726 hendricks2 25
 
26
extern int32_t g_gameType;
27
 
4557 hendricks2 28
extern int32_t g_usingAddon;
29
extern int32_t g_dependencyCRC;
5062 hendricks2 30
extern void (*g_postprocessing)(void);
4557 hendricks2 31
 
2726 hendricks2 32
#define DUKE                (g_gameType & GAMEFLAG_DUKE)
33
#define NAM                 (g_gameType & GAMEFLAG_NAM)
34
#define NAPALM              (g_gameType & GAMEFLAG_NAPALM)
35
#define WW2GI               (g_gameType & GAMEFLAG_WW2GI)
3803 terminx 36
#define SHAREWARE           (g_gameType & GAMEFLAG_SHAREWARE)
3886 terminx 37
#define DUKEBETA            ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA)
4887 hendricks2 38
#define NWINTER             (g_gameType & GAMEFLAG_NWINTER)
2726 hendricks2 39
 
40
enum Games_t {
41
    GAME_DUKE = 0,
42
    GAME_NAM,
43
    GAME_NAPALM,
44
    GAME_WW2GI,
45
    GAMECOUNT
46
};
47
 
3637 terminx 48
enum instpath_t {
4790 hendricks2 49
    INSTPATH_STEAM_DUKE3D,
50
    INSTPATH_GOG_DUKE3D,
51
    INSTPATH_3DR_DUKE3D,
52
    INSTPATH_3DR_ANTH,
53
    INSTPATH_STEAM_NAM,
3637 terminx 54
    NUMINSTPATHS
55
};
56
 
4886 hendricks2 57
enum searchpathtypes_t {
58
    SEARCHPATH_REMOVE = 1<<0,
59
    SEARCHPATH_NAM    = 1<<1,
4887 hendricks2 60
 
61
    SEARCHPATH_NWINTER = 1<<2,
4886 hendricks2 62
};
63
 
4560 hendricks2 64
typedef enum basepal_ {
65
    BASEPAL = 0,
66
    WATERPAL,
67
    SLIMEPAL,
68
    DREALMSPAL,
69
    TITLEPAL,
70
    ENDINGPAL,  // 5
71
    ANIMPAL,
72
    BASEPALCOUNT
73
} basepal_t;
74
 
4557 hendricks2 75
extern const char *g_gameNamePtr;
76
 
2726 hendricks2 77
extern char *g_grpNamePtr;
78
extern char *g_scriptNamePtr;
79
 
2796 helixhorne 80
extern const char *G_DefaultGrpFile(void);
81
extern const char *G_GrpFile(void);
2726 hendricks2 82
 
2796 helixhorne 83
extern const char *G_DefaultConFile(void);
84
extern const char *G_ConFile(void);
2726 hendricks2 85
 
4128 hendricks2 86
extern char **g_scriptModules;
87
extern int32_t g_scriptModulesNum;
88
 
89
extern void G_AddCon(const char *buffer);
90
extern void G_AddConModule(const char *buffer);
91
 
2726 hendricks2 92
extern void clearGrpNamePtr(void);
93
extern void clearScriptNamePtr(void);
94
 
4557 hendricks2 95
extern int32_t loaddefinitions_game(const char *, int32_t);
96
extern int32_t g_groupFileHandle;
97
 
3220 hendricks2 98
//////////
99
 
3976 helixhorne 100
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
101
extern void G_SetupGlobalPsky(void);
3220 hendricks2 102
 
3581 hendricks2 103
//////////
104
 
4557 hendricks2 105
extern char g_modDir[BMAX_PATH];
4668 terminx 106
extern int32_t kopen4loadfrommod(const char *filename, char searchfirst);
3581 hendricks2 107
extern void G_AddSearchPaths(void);
3654 terminx 108
extern void G_CleanupSearchPaths(void);
3581 hendricks2 109
 
4557 hendricks2 110
extern void G_ExtPreInit(int32_t argc,const char **argv);
111
extern void G_ExtInit(void);
4997 terminx 112
extern void G_ScanGroups(void);
113
extern void G_LoadGroups(int32_t autoload);
4557 hendricks2 114
 
3637 terminx 115
extern const char * G_GetInstallPath(int32_t insttype);
116
 
4559 hendricks2 117
//////////
118
 
119
void G_LoadGroupsInDir(const char *dirname);
120
void G_DoAutoload(const char *dirname);
121
 
4564 hendricks2 122
//////////
123
 
124
extern uint8_t *basepaltable[BASEPALCOUNT];
125
 
126
extern int32_t G_LoadLookups(void);
127
 
4948 hendricks2 128
//////////
129
 
130
#if defined HAVE_FLAC || defined HAVE_VORBIS
131
int32_t S_UpgradeFormat(const char *fn, char searchfirst);
132
#endif
133
 
4766 hendricks2 134
#ifdef __cplusplus
135
}
2726 hendricks2 136
#endif
4766 hendricks2 137
 
138
#endif