diff --git a/common/include/interp.h b/common/include/interp.h index 396562aff..d8400da8a 100644 --- a/common/include/interp.h +++ b/common/include/interp.h @@ -16,12 +16,16 @@ #include "dxxsconf.h" #include "compiler-array.h" +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) static const size_t glow_array_size = 1; #elif defined(DXX_BUILD_DESCENT_II) static const size_t glow_array_size = 2; #endif struct glow_values_t : public array {}; +#else +struct glow_values_t; +#endif //Object functions: diff --git a/common/main/ai.h b/common/main/ai.h index 7d47bfc88..b23ccc319 100644 --- a/common/main/ai.h +++ b/common/main/ai.h @@ -33,6 +33,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus +struct point_seg; + #define PLAYER_AWARENESS_INITIAL_TIME (3*F1_0) #define MAX_PATH_LENGTH 30 // Maximum length of path in ai path following. #define MAX_DEPTH_TO_SEARCH_FOR_PLAYER 10 @@ -44,6 +46,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define ROBOT_FIRE_AGITATION 94 +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) extern int Boss_hit_this_frame; #elif defined(DXX_BUILD_DESCENT_II) @@ -69,6 +72,9 @@ extern int Believed_player_seg; extern int Ai_last_missile_camera; #endif +extern void create_awareness_event(object *objp, enum player_awareness_type_t type); // object *objp can create awareness of player, amount based on "type" +#endif + struct boss_special_segment_array_t : public count_array_t {}; struct boss_teleport_segment_array_t : public boss_special_segment_array_t {}; struct boss_gate_segment_array_t : public boss_special_segment_array_t {}; @@ -90,7 +96,6 @@ extern void ai_move_one(object *objp); extern void do_ai_frame(object *objp); extern void init_ai_object(int objnum, int initial_mode, int hide_segment); extern void update_player_awareness(object *objp, fix new_awareness); -extern void create_awareness_event(object *objp, enum player_awareness_type_t type); // object *objp can create awareness of player, amount based on "type" extern void do_ai_frame_all(void); extern void reset_ai_states(object *objp); extern int create_path_points(object *objp, int start_seg, int end_seg, point_seg *point_segs, short *num_points, int max_depth, int random_flag, int safety_flag, int avoid_seg); @@ -264,8 +269,10 @@ void buddy_message(const char * format, ... ) __attribute_format_printf(1, 2); extern void special_reactor_stuff(void); #endif +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) extern ai_local Ai_local_info[MAX_OBJECTS]; extern point_seg Point_segs[MAX_POINT_SEGS]; +#endif extern point_seg *Point_segs_free_ptr; extern int ai_save_state(PHYSFS_file * fp); diff --git a/common/main/aistruct.h b/common/main/aistruct.h index 11be14f52..8d6cc5142 100644 --- a/common/main/aistruct.h +++ b/common/main/aistruct.h @@ -306,10 +306,10 @@ typedef struct { } ai_cloak_info_rw; #endif -typedef struct { +struct point_seg { int segnum; vms_vector point; -} point_seg; +}; typedef struct { short start, end; diff --git a/common/main/bm.h b/common/main/bm.h index 60d989906..5bc700fa3 100644 --- a/common/main/bm.h +++ b/common/main/bm.h @@ -41,6 +41,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #define TMI_GOAL_HOARD 32 //this is used to remap the goals #endif +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) typedef struct { char filename[13]; @@ -127,6 +128,7 @@ extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS]; extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS]; extern int First_multi_bitmap_num; void compute_average_rgb(grs_bitmap *bm, fix *rgb); +#endif // Initializes all bitmaps from BITMAPS.TBL file. int gamedata_read_tbl(int pc_shareware); diff --git a/common/main/cntrlcen.h b/common/main/cntrlcen.h index 30dde682d..2f1f795f8 100644 --- a/common/main/cntrlcen.h +++ b/common/main/cntrlcen.h @@ -94,6 +94,8 @@ static inline reactor *get_reactor_definition(int id) return &Reactors[id]; #endif } +#else +struct reactor; #endif //@@extern int N_controlcen_guns; diff --git a/common/main/effects.h b/common/main/effects.h index 24340588b..824ffaf0c 100644 --- a/common/main/effects.h +++ b/common/main/effects.h @@ -59,8 +59,10 @@ typedef struct eclip { int segnum,sidenum; //what seg & side, for one-shot clips } __pack__ eclip; +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) extern int Num_effects; extern eclip Effects[MAX_EFFECTS]; +#endif // Set up special effects. extern void init_special_effects(); diff --git a/common/main/fuelcen.h b/common/main/fuelcen.h index 4d6cd099e..1c5cca139 100644 --- a/common/main/fuelcen.h +++ b/common/main/fuelcen.h @@ -87,8 +87,6 @@ fix repaircen_give_shields(segment *segp, fix MaxAmountCanTake ); #define MAX_NUM_FUELCENS 70 #endif -extern const char Special_names[MAX_CENTER_TYPES][11]; - //--repair-- //do the repair center for this frame //--repair-- void do_repair_sequence(object *obj); //--repair-- @@ -128,6 +126,7 @@ typedef struct { short fuelcen_num; // Index in fuelcen array. } __pack__ d1_matcen_info; +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) typedef d1_matcen_info matcen_info; #elif defined(DXX_BUILD_DESCENT_II) @@ -140,7 +139,11 @@ typedef struct matcen_info { } __pack__ matcen_info; #endif +extern const char Special_names[MAX_CENTER_TYPES][11]; + extern matcen_info RobotCenters[MAX_ROBOT_CENTERS]; +extern FuelCenter Station[MAX_NUM_FUELCENS]; +#endif //--repair-- extern object *RepairObj; // which object getting repaired, or NULL @@ -150,13 +153,13 @@ extern void trigger_matcen(int segnum); extern void disable_matcens(void); -extern FuelCenter Station[MAX_NUM_FUELCENS]; extern int Num_fuelcenters; extern void init_all_matcens(void); extern const fix EnergyToCreateOneRobot; +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) /* * reads a matcen_info structure from a PHYSFS_file @@ -182,6 +185,7 @@ void matcen_info_read(matcen_info *ps, PHYSFS_file *fp); void matcen_info_read_n_swap(matcen_info *mi, int n, int swap, PHYSFS_file *fp); void matcen_info_write(matcen_info *mi, short version, PHYSFS_file *fp); +#endif /* * reads n Station structs from a PHYSFS_file and swaps if specified diff --git a/common/main/gameseq.h b/common/main/gameseq.h index 4e84717e0..71b2e1aa5 100644 --- a/common/main/gameseq.h +++ b/common/main/gameseq.h @@ -27,6 +27,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus +struct player; + #define SUPER_MISSILE 0 #define SUPER_SEEKER 1 #define SUPER_SMARTBOMB 2 diff --git a/common/main/multi.h b/common/main/multi.h index 9daf30c5b..7d8a64a2e 100644 --- a/common/main/multi.h +++ b/common/main/multi.h @@ -251,7 +251,6 @@ enum multiplayer_command_t { VALUE(NETFLAG_DOHEADLIGHT, "Headlight") \ #endif -#endif #define define_netflag_bit_enum(NAME,STR) BIT_##NAME, #define define_netflag_bit_mask(NAME,STR) NAME = (1 << BIT_##NAME), @@ -261,6 +260,18 @@ enum { for_each_netflag_value(define_netflag_bit_enum) }; enum { for_each_netflag_value(define_netflag_bit_mask) }; enum { NETFLAG_DOPOWERUP = 0 for_each_netflag_value(define_netflag_powerup_mask) }; +extern const char multi_allow_powerup_text[MULTI_ALLOW_POWERUP_MAX][MULTI_ALLOW_POWERUP_TEXT_LENGTH]; +extern const char GMNames[MULTI_GAME_TYPE_COUNT][MULTI_GAME_NAME_LENGTH]; +extern const char GMNamesShrt[MULTI_GAME_TYPE_COUNT][8]; + +extern ubyte multibuf[MAX_MULTI_MESSAGE_LEN+4]; +extern int Net_create_objnums[MAX_NET_CREATE_OBJECTS]; +extern int Net_create_loc; + +extern char PowerupsInMine[MAX_POWERUP_TYPES], + MaxPowerupsAllowed[MAX_POWERUP_TYPES]; +#endif + enum msgsend_state_t { msgsend_none, msgsend_typing, @@ -272,10 +283,6 @@ enum deres_type_t { deres_drop, }; -extern const char multi_allow_powerup_text[MULTI_ALLOW_POWERUP_MAX][MULTI_ALLOW_POWERUP_TEXT_LENGTH]; -extern const char GMNames[MULTI_GAME_TYPE_COUNT][MULTI_GAME_NAME_LENGTH]; -extern const char GMNamesShrt[MULTI_GAME_TYPE_COUNT][8]; - // Exported functions extern int GetMyNetRanking(); @@ -379,13 +386,8 @@ extern int VerifyPlayerJoined; extern int Player_joining_extras; extern int Network_player_added; -extern ubyte multibuf[MAX_MULTI_MESSAGE_LEN+4]; - extern int who_killed_controlcen; -extern int Net_create_objnums[MAX_NET_CREATE_OBJECTS]; -extern int Net_create_loc; - extern short kill_matrix[MAX_PLAYERS][MAX_PLAYERS]; extern short team_kills[2]; @@ -421,8 +423,6 @@ extern int Bounty_target; extern bitmap_index multi_player_textures[MAX_PLAYERS][N_PLAYER_SHIP_TEXTURES]; extern const char RankStrings[10][14]; -extern char PowerupsInMine[MAX_POWERUP_TYPES], - MaxPowerupsAllowed[MAX_POWERUP_TYPES]; // Globals for protocol-bound Refuse-functions extern char RefuseThisPlayer,WaitForRefuseAnswer,RefuseTeam,RefusePlayerName[12]; diff --git a/common/main/multibot.h b/common/main/multibot.h index f5fd5811e..a6d3f80cf 100644 --- a/common/main/multibot.h +++ b/common/main/multibot.h @@ -28,6 +28,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. struct object; struct vms_vector; +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #if defined(DXX_BUILD_DESCENT_I) #define MAX_ROBOTS_CONTROLLED 3 #elif defined(DXX_BUILD_DESCENT_II) @@ -37,6 +38,7 @@ struct vms_vector; extern int robot_controlled[MAX_ROBOTS_CONTROLLED]; extern int robot_agitation[MAX_ROBOTS_CONTROLLED]; extern int robot_fired[MAX_ROBOTS_CONTROLLED]; +#endif int multi_can_move_robot(int objnum, int agitation); void multi_send_robot_position(int objnum, int fired); diff --git a/common/main/powerup.h b/common/main/powerup.h index 09789efd8..db7564052 100644 --- a/common/main/powerup.h +++ b/common/main/powerup.h @@ -95,6 +95,7 @@ enum powerup_type_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 @@ -119,6 +120,9 @@ typedef struct powerup_type_info { extern int N_powerup_types; extern powerup_type_info Powerup_info[MAX_POWERUP_TYPES]; +#else +struct powerup_type_info; +#endif void draw_powerup(object *obj); diff --git a/common/main/robot.h b/common/main/robot.h index a16afca05..8bd401269 100644 --- a/common/main/robot.h +++ b/common/main/robot.h @@ -175,10 +175,10 @@ static inline int robot_is_thief(const robot_info *robptr) #define ROBOT_NAME_LENGTH 16 #if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) extern char Robot_names[MAX_ROBOT_TYPES][ROBOT_NAME_LENGTH]; -#endif //the array of robots types extern robot_info Robot_info[MAX_ROBOT_TYPES]; // Robot info for AI system, loaded from bitmaps.tbl. +#endif //how many kinds of robots extern int N_robot_types; // Number of robot types. We used to assume this was the same as N_polygon_models. diff --git a/common/main/switch.h b/common/main/switch.h index ac5ed6464..f80671e2d 100644 --- a/common/main/switch.h +++ b/common/main/switch.h @@ -119,7 +119,6 @@ typedef struct trigger { short seg[MAX_WALLS_PER_LINK]; short side[MAX_WALLS_PER_LINK]; } __pack__ trigger; -#endif extern trigger Triggers[MAX_TRIGGERS]; @@ -175,3 +174,5 @@ extern void trigger_write(trigger *t, short version, PHYSFS_file *fp); #endif #endif + +#endif diff --git a/common/main/text.h b/common/main/text.h index b2285005b..7987de790 100644 --- a/common/main/text.h +++ b/common/main/text.h @@ -1275,6 +1275,7 @@ void decode_text(char *text, int len); // decryption for briefings, etc. void load_text(void); void free_text(); +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #ifndef USE_BUILTIN_ENGLISH_TEXT_STRINGS //Array of pointers to text extern const char *Text_string[N_TEXT_STRINGS]; @@ -1291,6 +1292,7 @@ static inline const char *dxx_gettext(unsigned expr, const char *fmt) return Text_string[expr]; #endif } +#endif #endif diff --git a/common/main/textures.h b/common/main/textures.h index e404a4792..5fcdd48e0 100644 --- a/common/main/textures.h +++ b/common/main/textures.h @@ -21,6 +21,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifndef _TEXTURES_H #define _TEXTURES_H +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #include "bm.h" #include "piggy.h" @@ -28,5 +29,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. extern int NumTextures; extern bitmap_index Textures[MAX_TEXTURES]; // Array of all texture tmaps. +#endif #endif /* _TEXTURES_H */ diff --git a/common/main/wall.h b/common/main/wall.h index f27147f3a..84570704b 100644 --- a/common/main/wall.h +++ b/common/main/wall.h @@ -191,6 +191,7 @@ typedef struct cloaking_wall { #define WCF_TMAP1 4 //this uses primary tmap, not tmap2 #define WCF_HIDDEN 8 //this uses primary tmap, not tmap2 +#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) typedef struct { fix play_time; short num_frames; @@ -222,6 +223,10 @@ extern wclip WallAnims[MAX_WALL_ANIMS]; extern int Num_wall_anims; extern int walls_bm_num[MAX_WALL_ANIMS]; +#else +struct wall; +struct wclip; +#endif // Initializes all walls (i.e. no special walls.) extern void wall_init();