From 946048c54bbbbfe4a193d34a5029dc225e315588 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 22 Aug 2015 20:43:04 +0000 Subject: [PATCH] Move valptridx subtypes to individual fwd headers --- common/include/editor/eswitch.h | 2 +- common/include/editor/meddraw.h | 2 +- common/include/editor/medmisc.h | 2 +- common/include/editor/medwall.h | 2 +- common/include/fwdvalptridx.h | 9 --------- common/main/ai.h | 2 +- common/main/collide.h | 3 ++- common/main/controls.h | 2 +- common/main/digi.h | 3 ++- common/main/escort.h | 7 ++----- common/main/fireball.h | 3 ++- common/main/fuelcen.h | 1 + common/main/fwd-weapon.h | 2 +- common/main/fwdobject.h | 3 +++ common/main/fwdsegment.h | 2 ++ common/main/fwdwall.h | 3 ++- common/main/game.h | 3 ++- common/main/gauges.h | 2 +- common/main/hostage.h | 3 +-- common/main/laser.h | 3 +-- common/main/lighting.h | 2 +- common/main/morph.h | 2 +- common/main/newdemo.h | 10 ++-------- common/main/powerup.h | 2 +- common/main/slew.h | 8 ++------ common/main/switch.h | 5 ++--- 26 files changed, 37 insertions(+), 51 deletions(-) diff --git a/common/include/editor/eswitch.h b/common/include/editor/eswitch.h index 5e031e4bb..197f58f33 100644 --- a/common/include/editor/eswitch.h +++ b/common/include/editor/eswitch.h @@ -26,7 +26,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #include "switch.h" -#include "fwdvalptridx.h" +#include "fwdsegment.h" #ifdef __cplusplus diff --git a/common/include/editor/meddraw.h b/common/include/editor/meddraw.h index 5dbde7b16..59bdc8554 100644 --- a/common/include/editor/meddraw.h +++ b/common/include/editor/meddraw.h @@ -26,7 +26,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdsegment.h" struct grs_canvas; struct editor_view; diff --git a/common/include/editor/medmisc.h b/common/include/editor/medmisc.h index f7f08038b..7e90f3814 100644 --- a/common/include/editor/medmisc.h +++ b/common/include/editor/medmisc.h @@ -26,7 +26,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdsegment.h" struct vms_matrix; diff --git a/common/include/editor/medwall.h b/common/include/editor/medwall.h index 2ee8123a7..4e3690619 100644 --- a/common/include/editor/medwall.h +++ b/common/include/editor/medwall.h @@ -26,7 +26,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #include -#include "fwdvalptridx.h" +#include "fwdsegment.h" #ifdef __cplusplus diff --git a/common/include/fwdvalptridx.h b/common/include/fwdvalptridx.h index 02bed55ad..4b90caa3a 100644 --- a/common/include/fwdvalptridx.h +++ b/common/include/fwdvalptridx.h @@ -118,12 +118,3 @@ public: using integral_type = derived_type_prefix##num_t; \ }; \ DXX_VALPTRIDX_SUBTYPE(DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEF, managed_type, derived_type_prefix) - -DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE(object, obj, Objects); -DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE(segment, seg, Segments); - -#undef DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE -#undef DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEF -#undef DXX_VALPTRIDX_SUBTYPE_VC -#undef DXX_VALPTRIDX_SUBTYPE_C -#undef DXX_VALPTRIDX_SUBTYPE diff --git a/common/main/ai.h b/common/main/ai.h index 84cd6641c..0c05b0e29 100644 --- a/common/main/ai.h +++ b/common/main/ai.h @@ -35,11 +35,11 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include "pstypes.h" #include "fwdobject.h" +#include "fwdsegment.h" #if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II) #include "countarray.h" #include "aistruct.h" #endif -#include "fwdvalptridx.h" struct point_seg; struct PHYSFS_File; diff --git a/common/main/collide.h b/common/main/collide.h index 94a48882f..4d9bf9081 100644 --- a/common/main/collide.h +++ b/common/main/collide.h @@ -29,7 +29,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" struct vms_vector; struct laser_parent; diff --git a/common/main/controls.h b/common/main/controls.h index 1f94137b7..949e42d7c 100644 --- a/common/main/controls.h +++ b/common/main/controls.h @@ -26,7 +26,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdobject.h" void read_flying_controls(vobjptr_t obj); diff --git a/common/main/digi.h b/common/main/digi.h index 9396269c6..da96d5439 100644 --- a/common/main/digi.h +++ b/common/main/digi.h @@ -31,7 +31,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include "dxxsconf.h" #include "segnum.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" #include "compiler-exchange.h" #include "compiler-type_traits.h" diff --git a/common/main/escort.h b/common/main/escort.h index 9f6b44781..9402f3b8e 100644 --- a/common/main/escort.h +++ b/common/main/escort.h @@ -10,13 +10,12 @@ * */ -#ifndef _ESCORT_H -#define _ESCORT_H +#pragma once #include "maths.h" #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdobject.h" #if defined(DXX_BUILD_DESCENT_I) static inline void invalidate_escort_goal(void) @@ -41,5 +40,3 @@ extern fix64 Buddy_sorry_time; #endif #endif - -#endif // _ESCORT_H diff --git a/common/main/fireball.h b/common/main/fireball.h index a70be73a6..bab0feb39 100644 --- a/common/main/fireball.h +++ b/common/main/fireball.h @@ -30,7 +30,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include "maths.h" #include "fwd-partial_range.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" #include "pack.h" struct vms_vector; diff --git a/common/main/fuelcen.h b/common/main/fuelcen.h index 8f949ec14..fae8ce9b6 100644 --- a/common/main/fuelcen.h +++ b/common/main/fuelcen.h @@ -27,6 +27,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include "pack.h" +#include "fwdobject.h" #include "fwdsegment.h" struct vms_vector; diff --git a/common/main/fwd-weapon.h b/common/main/fwd-weapon.h index d0289bd6e..c5c0aab5d 100644 --- a/common/main/fwd-weapon.h +++ b/common/main/fwd-weapon.h @@ -31,7 +31,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "dxxsconf.h" #include "compiler-array.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" enum powerup_type_t : uint8_t; diff --git a/common/main/fwdobject.h b/common/main/fwdobject.h index 2c518fecf..95fa0ba6d 100644 --- a/common/main/fwdobject.h +++ b/common/main/fwdobject.h @@ -14,11 +14,14 @@ #include "segnum.h" #include "fwdvalptridx.h" #include "maths.h" +#include "fwdsegment.h" struct bitmap_index; struct vms_vector; struct vms_matrix; +DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE(object, obj, Objects); + static constexpr valptridx::magic_constant<0xfffe> object_guidebot_cannot_reach{}; static constexpr valptridx::magic_constant<0xffff> object_none{}; static constexpr valptridx::magic_constant<0> object_first{}; diff --git a/common/main/fwdsegment.h b/common/main/fwdsegment.h index 48e88dc94..fe3618025 100644 --- a/common/main/fwdsegment.h +++ b/common/main/fwdsegment.h @@ -18,6 +18,8 @@ #include "dxxsconf.h" #include "compiler-array.h" +DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE(segment, seg, Segments); + static constexpr valptridx::magic_constant<0xfffe> segment_exit{}; static constexpr valptridx::magic_constant<0xffff> segment_none{}; static constexpr valptridx::magic_constant<0> segment_first{}; diff --git a/common/main/fwdwall.h b/common/main/fwdwall.h index 4bcf1c8e9..0469a6821 100644 --- a/common/main/fwdwall.h +++ b/common/main/fwdwall.h @@ -10,7 +10,8 @@ #include #include "maths.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" struct side; diff --git a/common/main/game.h b/common/main/game.h index ceb21fe03..c2d1aeba4 100644 --- a/common/main/game.h +++ b/common/main/game.h @@ -33,7 +33,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #include "pack.h" #include "segnum.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" #define DESIGNATED_GAME_FPS 30 // assuming the original intended Framerate was 30 #define DESIGNATED_GAME_FRAMETIME (F1_0/DESIGNATED_GAME_FPS) diff --git a/common/main/gauges.h b/common/main/gauges.h index 96b7bdc7a..b592d53ee 100644 --- a/common/main/gauges.h +++ b/common/main/gauges.h @@ -30,7 +30,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. struct bitmap_index; #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdobject.h" //from gauges.c diff --git a/common/main/hostage.h b/common/main/hostage.h index 42843272b..16cd29664 100644 --- a/common/main/hostage.h +++ b/common/main/hostage.h @@ -26,8 +26,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #ifdef __cplusplus -#include "dxxsconf.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" #include "compiler-array.h" #define HOSTAGE_SIZE i2f(5) // 3d size of a hostage diff --git a/common/main/laser.h b/common/main/laser.h index 10f87accb..064dbf339 100644 --- a/common/main/laser.h +++ b/common/main/laser.h @@ -29,9 +29,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "vecmat.h" #ifdef __cplusplus -#include "objnum.h" #include "segnum.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" enum weapon_type_t { diff --git a/common/main/lighting.h b/common/main/lighting.h index 3ebb26c7a..82fee8a5b 100644 --- a/common/main/lighting.h +++ b/common/main/lighting.h @@ -29,8 +29,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "vecmat.h" #ifdef __cplusplus +#include "fwdobject.h" #include "fwdsegment.h" -#include "fwdvalptridx.h" struct g3s_lrgb; diff --git a/common/main/morph.h b/common/main/morph.h index 2c3bb6897..65591f92d 100644 --- a/common/main/morph.h +++ b/common/main/morph.h @@ -32,7 +32,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "dxxsconf.h" #include "vecmat.h" #include "pack.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" #include "polyobj.h" #include "compiler-array.h" diff --git a/common/main/newdemo.h b/common/main/newdemo.h index 0b3ccde36..2d6ea6c91 100644 --- a/common/main/newdemo.h +++ b/common/main/newdemo.h @@ -23,15 +23,11 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ - -#ifndef _NEWDEMO_H -#define _NEWDEMO_H +#pragma once #ifdef __cplusplus #include "physfsx.h" -#include "segnum.h" -#include "objnum.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" class object_signature_t; @@ -150,5 +146,3 @@ int newdemo_count_demos(); void newdemo_strip_frames(char *, int); #endif - -#endif // _NEWDEMO_H diff --git a/common/main/powerup.h b/common/main/powerup.h index 3dac7571b..fdc882ef9 100644 --- a/common/main/powerup.h +++ b/common/main/powerup.h @@ -30,7 +30,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "fmtcheck.h" #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdobject.h" enum powerup_type_t : uint8_t { diff --git a/common/main/slew.h b/common/main/slew.h index f03c87bc7..7a3203857 100644 --- a/common/main/slew.h +++ b/common/main/slew.h @@ -23,12 +23,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. * */ - -#ifndef _SLEW_H -#define _SLEW_H +#pragma once #ifdef __cplusplus -#include "fwdvalptridx.h" +#include "fwdobject.h" //from slew.c @@ -49,5 +47,3 @@ int slew_frame(int dont_check_keys); // Does slew frame #endif #endif - -#endif /* _SLEW_H */ diff --git a/common/main/switch.h b/common/main/switch.h index 1298a61bf..f886e5c1a 100644 --- a/common/main/switch.h +++ b/common/main/switch.h @@ -30,9 +30,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __cplusplus #include "pack.h" -#include "segnum.h" -#include "objnum.h" -#include "fwdvalptridx.h" +#include "fwdobject.h" +#include "fwdsegment.h" #include "compiler-array.h" #define MAX_TRIGGERS 100