Subversion Repositories eduke32

Rev

Rev 4948 | Rev 5050 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4948 Rev 4997
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 GAMEFLAG_NWINTER    0x00000080
23
#define GAMEFLAG_NWINTER    0x00000080
24
24
25
extern int32_t g_gameType;
25
extern int32_t g_gameType;
26
26
27
extern int32_t g_usingAddon;
27
extern int32_t g_usingAddon;
28
extern int32_t g_dependencyCRC;
28
extern int32_t g_dependencyCRC;
29
29
30
#define DUKE                (g_gameType & GAMEFLAG_DUKE)
30
#define DUKE                (g_gameType & GAMEFLAG_DUKE)
31
#define NAM                 (g_gameType & GAMEFLAG_NAM)
31
#define NAM                 (g_gameType & GAMEFLAG_NAM)
32
#define NAPALM              (g_gameType & GAMEFLAG_NAPALM)
32
#define NAPALM              (g_gameType & GAMEFLAG_NAPALM)
33
#define WW2GI               (g_gameType & GAMEFLAG_WW2GI)
33
#define WW2GI               (g_gameType & GAMEFLAG_WW2GI)
34
#define SHAREWARE           (g_gameType & GAMEFLAG_SHAREWARE)
34
#define SHAREWARE           (g_gameType & GAMEFLAG_SHAREWARE)
35
#define DUKEBETA            ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA)
35
#define DUKEBETA            ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA)
36
#define NWINTER             (g_gameType & GAMEFLAG_NWINTER)
36
#define NWINTER             (g_gameType & GAMEFLAG_NWINTER)
37
37
38
enum Games_t {
38
enum Games_t {
39
    GAME_DUKE = 0,
39
    GAME_DUKE = 0,
40
    GAME_NAM,
40
    GAME_NAM,
41
    GAME_NAPALM,
41
    GAME_NAPALM,
42
    GAME_WW2GI,
42
    GAME_WW2GI,
43
    GAMECOUNT
43
    GAMECOUNT
44
};
44
};
45
45
46
enum instpath_t {
46
enum instpath_t {
47
    INSTPATH_STEAM_DUKE3D,
47
    INSTPATH_STEAM_DUKE3D,
48
    INSTPATH_GOG_DUKE3D,
48
    INSTPATH_GOG_DUKE3D,
49
    INSTPATH_3DR_DUKE3D,
49
    INSTPATH_3DR_DUKE3D,
50
    INSTPATH_3DR_ANTH,
50
    INSTPATH_3DR_ANTH,
51
    INSTPATH_STEAM_NAM,
51
    INSTPATH_STEAM_NAM,
52
    NUMINSTPATHS
52
    NUMINSTPATHS
53
};
53
};
54
54
55
enum searchpathtypes_t {
55
enum searchpathtypes_t {
56
    SEARCHPATH_REMOVE = 1<<0,
56
    SEARCHPATH_REMOVE = 1<<0,
57
    SEARCHPATH_NAM    = 1<<1,
57
    SEARCHPATH_NAM    = 1<<1,
58
58
59
    SEARCHPATH_NWINTER = 1<<2,
59
    SEARCHPATH_NWINTER = 1<<2,
60
};
60
};
61
61
62
typedef enum basepal_ {
62
typedef enum basepal_ {
63
    BASEPAL = 0,
63
    BASEPAL = 0,
64
    WATERPAL,
64
    WATERPAL,
65
    SLIMEPAL,
65
    SLIMEPAL,
66
    DREALMSPAL,
66
    DREALMSPAL,
67
    TITLEPAL,
67
    TITLEPAL,
68
    ENDINGPAL,  // 5
68
    ENDINGPAL,  // 5
69
    ANIMPAL,
69
    ANIMPAL,
70
    BASEPALCOUNT
70
    BASEPALCOUNT
71
} basepal_t;
71
} basepal_t;
72
72
73
extern const char *g_gameNamePtr;
73
extern const char *g_gameNamePtr;
74
74
75
extern char *g_grpNamePtr;
75
extern char *g_grpNamePtr;
76
extern char *g_scriptNamePtr;
76
extern char *g_scriptNamePtr;
77
77
78
extern const char *G_DefaultGrpFile(void);
78
extern const char *G_DefaultGrpFile(void);
79
extern const char *G_GrpFile(void);
79
extern const char *G_GrpFile(void);
80
80
81
extern const char *G_DefaultConFile(void);
81
extern const char *G_DefaultConFile(void);
82
extern const char *G_ConFile(void);
82
extern const char *G_ConFile(void);
83
83
84
extern char **g_scriptModules;
84
extern char **g_scriptModules;
85
extern int32_t g_scriptModulesNum;
85
extern int32_t g_scriptModulesNum;
86
86
87
extern void G_AddCon(const char *buffer);
87
extern void G_AddCon(const char *buffer);
88
extern void G_AddConModule(const char *buffer);
88
extern void G_AddConModule(const char *buffer);
89
89
90
extern void clearGrpNamePtr(void);
90
extern void clearGrpNamePtr(void);
91
extern void clearScriptNamePtr(void);
91
extern void clearScriptNamePtr(void);
92
92
93
extern int32_t loaddefinitions_game(const char *, int32_t);
93
extern int32_t loaddefinitions_game(const char *, int32_t);
94
extern int32_t g_groupFileHandle;
94
extern int32_t g_groupFileHandle;
95
95
96
//////////
96
//////////
97
97
98
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
98
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
99
extern void G_SetupGlobalPsky(void);
99
extern void G_SetupGlobalPsky(void);
100
100
101
//////////
101
//////////
102
102
103
extern char g_modDir[BMAX_PATH];
103
extern char g_modDir[BMAX_PATH];
104
extern int32_t kopen4loadfrommod(const char *filename, char searchfirst);
104
extern int32_t kopen4loadfrommod(const char *filename, char searchfirst);
105
extern void G_AddSearchPaths(void);
105
extern void G_AddSearchPaths(void);
106
extern void G_CleanupSearchPaths(void);
106
extern void G_CleanupSearchPaths(void);
107
107
108
extern void G_ExtPreInit(int32_t argc,const char **argv);
108
extern void G_ExtPreInit(int32_t argc,const char **argv);
109
extern void G_ExtInit(void);
109
extern void G_ExtInit(void);
110
extern void G_ExtPreStartupWindow(void);
110
extern void G_ScanGroups(void);
111
extern void G_ExtPostStartupWindow(int32_t autoload);
111
extern void G_LoadGroups(int32_t autoload);
112
112
113
extern const char * G_GetInstallPath(int32_t insttype);
113
extern const char * G_GetInstallPath(int32_t insttype);
114
114
115
//////////
115
//////////
116
116
117
void G_LoadGroupsInDir(const char *dirname);
117
void G_LoadGroupsInDir(const char *dirname);
118
void G_DoAutoload(const char *dirname);
118
void G_DoAutoload(const char *dirname);
119
119
120
//////////
120
//////////
121
121
122
extern uint8_t *basepaltable[BASEPALCOUNT];
122
extern uint8_t *basepaltable[BASEPALCOUNT];
123
123
124
extern int32_t G_LoadLookups(void);
124
extern int32_t G_LoadLookups(void);
125
125
126
//////////
126
//////////
127
127
128
#if defined HAVE_FLAC || defined HAVE_VORBIS
128
#if defined HAVE_FLAC || defined HAVE_VORBIS
129
int32_t S_UpgradeFormat(const char *fn, char searchfirst);
129
int32_t S_UpgradeFormat(const char *fn, char searchfirst);
130
#endif
130
#endif
131
131
132
#ifdef __cplusplus
132
#ifdef __cplusplus
133
}
133
}
134
#endif
134
#endif
135
135
136
#endif
136
#endif
137
 
137