Subversion Repositories eduke32

Rev

Rev 5050 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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