Subversion Repositories eduke32

Rev

Rev 3975 | Rev 4006 | Go to most recent revision | 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
 
10
#define GAMEFLAG_DUKE       0x00000001
11
#define GAMEFLAG_NAM        0x00000002
12
#define GAMEFLAG_NAPALM     0x00000004
13
#define GAMEFLAG_WW2GI      0x00000008
3654 terminx 14
#define GAMEFLAG_ADDON      0x00000010
3803 terminx 15
#define GAMEFLAG_SHAREWARE  0x00000020
16
#define GAMEFLAG_DUKEBETA   0x00000060 // includes 0x20 since it's a shareware beta
2726 hendricks2 17
 
18
extern int32_t g_gameType;
19
 
20
#define DUKE                (g_gameType & GAMEFLAG_DUKE)
21
#define NAM                 (g_gameType & GAMEFLAG_NAM)
22
#define NAPALM              (g_gameType & GAMEFLAG_NAPALM)
23
#define WW2GI               (g_gameType & GAMEFLAG_WW2GI)
3803 terminx 24
#define SHAREWARE           (g_gameType & GAMEFLAG_SHAREWARE)
3886 terminx 25
#define DUKEBETA            ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA)
2726 hendricks2 26
 
27
enum Games_t {
28
    GAME_DUKE = 0,
29
    GAME_NAM,
30
    GAME_NAPALM,
31
    GAME_WW2GI,
32
    GAMECOUNT
33
};
34
 
3637 terminx 35
enum instpath_t {
36
    INSTPATH_STEAM,
37
    INSTPATH_GOG,
38
    NUMINSTPATHS
39
};
40
 
2796 helixhorne 41
extern const char *defaultgamegrp[GAMECOUNT];
42
extern const char *defaultdeffilename[GAMECOUNT];
43
extern const char *defaultconfilename;
44
extern const char *defaultgameconfilename[GAMECOUNT];
2726 hendricks2 45
 
46
extern char *g_grpNamePtr;
47
extern char *g_scriptNamePtr;
48
 
2796 helixhorne 49
extern const char *G_DefaultGrpFile(void);
50
extern const char *G_GrpFile(void);
2726 hendricks2 51
 
2796 helixhorne 52
extern const char *G_DefaultConFile(void);
53
extern const char *G_ConFile(void);
2726 hendricks2 54
 
55
extern void clearGrpNamePtr(void);
56
extern void clearDefNamePtr(void);
57
extern void clearScriptNamePtr(void);
58
 
3220 hendricks2 59
//////////
60
 
3976 helixhorne 61
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
62
extern void G_SetupGlobalPsky(void);
3220 hendricks2 63
 
3976 helixhorne 64
// Get the multi-psky index corresponding to a base tile number of the sky (for
65
// the game: the *static* value!), or 0 as the catch-all.
66
// KEEPINSYNC G_InitMultiPsky().
67
static inline int32_t MultiPsky_TileToIdx(int32_t tilenum)
68
{
69
    switch (tilenum)
70
    {
71
    default:
72
        return 0;
73
    case 78: // CLOUDYOCEAN__STATIC
74
        return 1;
75
    case 80: // MOONSKY1__STATIC:
76
        return 2;
77
    case 84: // BIGORBIT1__STATIC:
78
        return 3;
79
    case 89: // LA__STATIC:
80
        return 4;
81
    }
82
}
83
 
3581 hendricks2 84
//////////
85
 
3582 hendricks2 86
extern void G_ExtPreInit(void);
87
 
3581 hendricks2 88
extern void G_AddSearchPaths(void);
3654 terminx 89
extern void G_CleanupSearchPaths(void);
3581 hendricks2 90
 
3637 terminx 91
extern const char * G_GetInstallPath(int32_t insttype);
92
 
2726 hendricks2 93
#endif