From afd995aa22050a697a6e39c98c780448f7717a6b Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 27 Sep 2014 15:42:45 +0000 Subject: [PATCH] Centralize N_D2_* constants in bm.h --- common/main/bm.h | 10 ++++++++++ d2x-rebirth/main/bmread.cpp | 8 -------- similar/main/bm.cpp | 8 -------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/common/main/bm.h b/common/main/bm.h index 55f26b536..ba57f6de5 100644 --- a/common/main/bm.h +++ b/common/main/bm.h @@ -147,6 +147,16 @@ int ds_load(int skip, const char * filename ); int compute_average_pixel(grs_bitmap *n); void bm_write_all(PHYSFS_file *fp); +#if defined(DXX_BUILD_DESCENT_II) +//these values are the number of each item in the release of d2 +//extra items added after the release get written in an additional hamfile +static const unsigned N_D2_ROBOT_TYPES = 66; +static const unsigned N_D2_ROBOT_JOINTS = 1145; +static const unsigned N_D2_OBJBITMAPS = 422; +static const unsigned N_D2_OBJBITMAPPTRS = 502; +static const unsigned N_D2_WEAPON_TYPES = 62; +#endif + #endif #endif /* _BM_H */ diff --git a/d2x-rebirth/main/bmread.cpp b/d2x-rebirth/main/bmread.cpp index 746a95896..2b43b8d28 100644 --- a/d2x-rebirth/main/bmread.cpp +++ b/d2x-rebirth/main/bmread.cpp @@ -2081,14 +2081,6 @@ void bm_read_hostage() } } -//these values are the number of each item in the release of d2 -//extra items added after the release get written in an additional hamfile -#define N_D2_ROBOT_TYPES 66 -#define N_D2_ROBOT_JOINTS 1145 -#define N_D2_OBJBITMAPS 422 -#define N_D2_OBJBITMAPPTRS 502 -#define N_D2_WEAPON_TYPES 62 - DEFINE_SERIAL_UDT_TO_MESSAGE(tmap_info, t, (t.flags, serial::pad<3>(), t.lighting, t.damage, t.eclip_num, t.destroyed, t.slide_u, t.slide_v)); ASSERT_SERIAL_UDT_MESSAGE_SIZE(tmap_info, 20); diff --git a/similar/main/bm.cpp b/similar/main/bm.cpp index c5958f1ba..dddb4fdbb 100644 --- a/similar/main/bm.cpp +++ b/similar/main/bm.cpp @@ -375,14 +375,6 @@ void bm_read_all(PHYSFS_file * fp) exit_modelnum = destroyed_exit_modelnum = N_polygon_models; } -//these values are the number of each item in the release of d2 -//extra items added after the release get written in an additional hamfile -#define N_D2_ROBOT_TYPES 66 -#define N_D2_ROBOT_JOINTS 1145 -#define N_D2_OBJBITMAPS 422 -#define N_D2_OBJBITMAPPTRS 502 -#define N_D2_WEAPON_TYPES 62 - int extra_bitmap_num = 0; static void bm_free_extra_objbitmaps()