Wrap game-specific types in game-specific preprocessor guards

These types are not used in common code, and in some cases would provoke
a -Wodr warning if they were used.
This commit is contained in:
Kp 2015-09-26 21:17:12 +00:00
parent 63dd2656ed
commit d971cf7702
5 changed files with 11 additions and 2 deletions

View file

@ -35,6 +35,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
struct d_event;
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
struct control_info {
template <typename T>
struct ramp_controls_t
@ -80,6 +81,9 @@ struct control_info {
array<fix, 3> mouse_axis, raw_mouse_axis;
};
extern control_info Controls;
#endif
#define CONTROL_USING_JOYSTICK 1
#define CONTROL_USING_MOUSE 2
#define MOUSEFS_DELTA_RANGE 512
@ -91,7 +95,6 @@ struct control_info {
#define MAX_CONTROLS 60 // there are actually 48, so this leaves room for more
#endif
extern control_info Controls;
extern void kconfig_read_controls(const d_event &event, int automap_flag);
extern void kconfig(int n, const char *title);

View file

@ -113,6 +113,7 @@ public:
std::string::const_iterator filename; // filename without extension
};
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
struct Mission : Mission_path
{
std::unique_ptr<ubyte[]> secret_level_table; // originating level no for each secret level
@ -161,6 +162,7 @@ extern Mission_ptr Current_mission; // current mission
#endif
#define PLAYING_BUILTIN_MISSION (Current_mission->builtin_hogsize != 0)
#define ANARCHY_ONLY_MISSION (1 == Current_mission->anarchy_only_flag)
#endif
//values for d1 built-in mission
#define BIMD1_LAST_LEVEL 27

View file

@ -608,6 +608,7 @@ extern char RefuseThisPlayer,WaitForRefuseAnswer,RefuseTeam,RefusePlayerName[12]
extern fix64 RefuseTimeLimit;
#define REFUSE_INTERVAL (F1_0*8)
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
struct bit_game_flags {
unsigned closed : 1;
unsigned : 1;
@ -666,6 +667,7 @@ static inline packed_game_flags pack_game_flags(const bit_game_flags *flags)
0;
return p;
}
#endif
#define NETGAME_NAME_LEN 15

View file

@ -25,6 +25,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#pragma once
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
#if defined(DXX_BUILD_DESCENT_I)
#include "pstypes.h"
#include "player.h"
@ -161,3 +162,4 @@ void read_netgame_profile(struct netgame_info *ng);
void write_netgame_profile(struct netgame_info *ng);
#endif
#endif

View file

@ -32,6 +32,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#ifdef __cplusplus
#include "fwdobject.h"
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
enum powerup_type_t : uint8_t
{
POW_EXTRA_LIFE = 0,
@ -94,7 +95,6 @@ enum powerup_type_t : uint8_t
#endif
};
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
#if defined(DXX_BUILD_DESCENT_I)
#define VULCAN_AMMO_MAX (392*2)
#define MAX_POWERUP_TYPES 29