2012-06-03 16:09:33 +00:00
|
|
|
//
|
|
|
|
// Definitions of common game-only data structures/functions
|
|
|
|
// (and declarations of data appearing in both)
|
|
|
|
// for EDuke32 and Mapster32
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef EDUKE32_COMMON_GAME_H_
|
|
|
|
#define EDUKE32_COMMON_GAME_H_
|
|
|
|
|
2015-03-27 12:30:35 +00:00
|
|
|
#include "grpscan.h"
|
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-07-28 06:42:28 +00:00
|
|
|
extern int32_t usecwd;
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
#define GAMEFLAG_DUKE 0x00000001
|
|
|
|
#define GAMEFLAG_NAM 0x00000002
|
|
|
|
#define GAMEFLAG_NAPALM 0x00000004
|
|
|
|
#define GAMEFLAG_WW2GI 0x00000008
|
2013-04-08 18:30:39 +00:00
|
|
|
#define GAMEFLAG_ADDON 0x00000010
|
2013-05-23 18:28:04 +00:00
|
|
|
#define GAMEFLAG_SHAREWARE 0x00000020
|
|
|
|
#define GAMEFLAG_DUKEBETA 0x00000060 // includes 0x20 since it's a shareware beta
|
2015-03-08 07:59:03 +00:00
|
|
|
#define GAMEFLAGMASK 0x0000007F // flags allowed from grpinfo
|
2012-06-03 16:09:33 +00:00
|
|
|
|
2015-03-27 12:30:35 +00:00
|
|
|
extern struct grpfile_t const *g_selectedGrp;
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
extern int32_t g_gameType;
|
|
|
|
|
2014-07-28 06:42:28 +00:00
|
|
|
extern int32_t g_usingAddon;
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
#define DUKE (g_gameType & GAMEFLAG_DUKE)
|
|
|
|
#define NAM (g_gameType & GAMEFLAG_NAM)
|
|
|
|
#define NAPALM (g_gameType & GAMEFLAG_NAPALM)
|
|
|
|
#define WW2GI (g_gameType & GAMEFLAG_WW2GI)
|
2015-11-25 12:08:24 +00:00
|
|
|
#define NAM_WW2GI (g_gameType & (GAMEFLAG_NAM|GAMEFLAG_WW2GI))
|
2013-05-23 18:28:04 +00:00
|
|
|
#define SHAREWARE (g_gameType & GAMEFLAG_SHAREWARE)
|
2013-06-14 21:29:14 +00:00
|
|
|
#define DUKEBETA ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA)
|
2012-06-03 16:09:33 +00:00
|
|
|
|
|
|
|
enum Games_t {
|
|
|
|
GAME_DUKE = 0,
|
|
|
|
GAME_NAM,
|
|
|
|
GAME_NAPALM,
|
|
|
|
GAME_WW2GI,
|
|
|
|
GAMECOUNT
|
|
|
|
};
|
|
|
|
|
2013-04-05 07:48:20 +00:00
|
|
|
enum instpath_t {
|
2015-05-13 08:57:11 +00:00
|
|
|
INSTPATH_STEAM_DUKE3D_MEGATON,
|
|
|
|
INSTPATH_STEAM_DUKE3D_3DR,
|
2014-12-02 06:16:02 +00:00
|
|
|
INSTPATH_GOG_DUKE3D,
|
|
|
|
INSTPATH_3DR_DUKE3D,
|
|
|
|
INSTPATH_3DR_ANTH,
|
|
|
|
INSTPATH_STEAM_NAM,
|
2015-11-25 12:08:37 +00:00
|
|
|
INSTPATH_STEAM_WW2GI,
|
2013-04-05 07:48:20 +00:00
|
|
|
NUMINSTPATHS
|
|
|
|
};
|
|
|
|
|
2015-01-08 15:14:47 +00:00
|
|
|
enum searchpathtypes_t {
|
|
|
|
SEARCHPATH_REMOVE = 1<<0,
|
|
|
|
SEARCHPATH_NAM = 1<<1,
|
2015-11-25 12:08:37 +00:00
|
|
|
SEARCHPATH_WW2GI = 1<<2,
|
2015-01-08 15:14:47 +00:00
|
|
|
};
|
|
|
|
|
2014-07-28 06:44:14 +00:00
|
|
|
typedef enum basepal_ {
|
|
|
|
BASEPAL = 0,
|
|
|
|
WATERPAL,
|
|
|
|
SLIMEPAL,
|
|
|
|
DREALMSPAL,
|
|
|
|
TITLEPAL,
|
|
|
|
ENDINGPAL, // 5
|
|
|
|
ANIMPAL,
|
|
|
|
BASEPALCOUNT
|
|
|
|
} basepal_t;
|
|
|
|
|
2014-07-28 06:42:28 +00:00
|
|
|
extern const char *g_gameNamePtr;
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
extern char *g_grpNamePtr;
|
|
|
|
extern char *g_scriptNamePtr;
|
|
|
|
|
2012-07-01 22:11:33 +00:00
|
|
|
extern const char *G_DefaultGrpFile(void);
|
|
|
|
extern const char *G_GrpFile(void);
|
2012-06-03 16:09:33 +00:00
|
|
|
|
2012-07-01 22:11:33 +00:00
|
|
|
extern const char *G_DefaultConFile(void);
|
|
|
|
extern const char *G_ConFile(void);
|
2012-06-03 16:09:33 +00:00
|
|
|
|
2013-11-03 04:02:23 +00:00
|
|
|
extern char **g_scriptModules;
|
|
|
|
extern int32_t g_scriptModulesNum;
|
|
|
|
|
|
|
|
extern void G_AddCon(const char *buffer);
|
|
|
|
extern void G_AddConModule(const char *buffer);
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
extern void clearGrpNamePtr(void);
|
|
|
|
extern void clearScriptNamePtr(void);
|
|
|
|
|
2016-08-27 01:40:56 +00:00
|
|
|
extern int loaddefinitions_game(const char *fileName, int32_t firstPass);
|
2014-07-28 06:42:28 +00:00
|
|
|
extern int32_t g_groupFileHandle;
|
|
|
|
|
2012-11-25 04:25:31 +00:00
|
|
|
//////////
|
|
|
|
|
Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
at map load time so as to keep the behavior of the legacy per-map psky:
the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.
This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.
git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
|
|
|
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
|
|
|
|
extern void G_SetupGlobalPsky(void);
|
|
|
|
|
2013-03-21 09:48:21 +00:00
|
|
|
//////////
|
|
|
|
|
2014-07-28 06:42:28 +00:00
|
|
|
extern char g_modDir[BMAX_PATH];
|
2014-10-25 03:32:42 +00:00
|
|
|
extern int32_t kopen4loadfrommod(const char *filename, char searchfirst);
|
2013-03-21 09:48:21 +00:00
|
|
|
extern void G_AddSearchPaths(void);
|
2013-04-08 18:30:39 +00:00
|
|
|
extern void G_CleanupSearchPaths(void);
|
2013-03-21 09:48:21 +00:00
|
|
|
|
2016-01-12 10:30:56 +00:00
|
|
|
extern void G_ExtPreInit(int32_t argc,char const * const * argv);
|
2014-07-28 06:42:28 +00:00
|
|
|
extern void G_ExtInit(void);
|
2015-02-11 05:22:48 +00:00
|
|
|
extern void G_ScanGroups(void);
|
|
|
|
extern void G_LoadGroups(int32_t autoload);
|
2014-07-28 06:42:28 +00:00
|
|
|
|
2013-04-05 07:48:20 +00:00
|
|
|
extern const char * G_GetInstallPath(int32_t insttype);
|
|
|
|
|
2014-07-28 06:43:46 +00:00
|
|
|
//////////
|
|
|
|
|
|
|
|
void G_LoadGroupsInDir(const char *dirname);
|
|
|
|
void G_DoAutoload(const char *dirname);
|
|
|
|
|
2014-07-28 06:45:53 +00:00
|
|
|
//////////
|
|
|
|
|
2015-09-23 17:54:55 +00:00
|
|
|
extern void G_LoadLookups(void);
|
2014-07-28 06:45:53 +00:00
|
|
|
|
2015-01-25 12:17:59 +00:00
|
|
|
//////////
|
|
|
|
|
2016-01-12 10:31:05 +00:00
|
|
|
#if defined HAVE_FLAC || defined HAVE_VORBIS
|
|
|
|
# define FORMAT_UPGRADE_ELIGIBLE
|
2015-11-25 12:08:10 +00:00
|
|
|
extern int32_t S_OpenAudio(const char *fn, char searchfirst, uint8_t ismusic);
|
2016-01-12 10:31:05 +00:00
|
|
|
#else
|
|
|
|
# define S_OpenAudio(fn, searchfirst, ismusic) kopen4loadfrommod(fn, searchfirst)
|
|
|
|
#endif
|
2015-01-25 12:17:59 +00:00
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-06-03 16:09:33 +00:00
|
|
|
#endif
|