From 84299f157ec55d0d2d1278b5d43bd747a18b008f Mon Sep 17 00:00:00 2001 From: SpaceViking Date: Sat, 28 Mar 2009 00:13:12 +0000 Subject: [PATCH] Add "USE_AGGRESSIVE_ASSERTIONS" define git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2636 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Standard Gaming Platform/DEBUG.H | 5 +++++ Strategic/Campaign Types.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Standard Gaming Platform/DEBUG.H b/Standard Gaming Platform/DEBUG.H index c41dd3cf..ed68490c 100644 --- a/Standard Gaming Platform/DEBUG.H +++ b/Standard Gaming Platform/DEBUG.H @@ -52,6 +52,11 @@ inline void _Null() { } #endif #endif +// +// Uncomment the follow to turn on more aggressive assertions +// +//#define USE_AGGRESSIVE_ASSERTIONS + #ifdef FORCE_ASSERTS_ON // If FORCE_ASSERTS_ON is defined, we need to initialize all the debug macros. Otherwise all the diff --git a/Strategic/Campaign Types.h b/Strategic/Campaign Types.h index c7a14f86..af142e7f 100644 --- a/Strategic/Campaign Types.h +++ b/Strategic/Campaign Types.h @@ -12,6 +12,7 @@ const int MAXIMUM_VALID_Z_COORDINATE = 3; const int MINIMUM_VALID_Z_COORDINATE = 0; //Macro to convert sector coordinates (1-16,1-16) to 0-255 +#ifdef USE_AGGRESSIVE_ASSERTIONS #define SECTOR(x,y) (UINT8)(AssertGE(x, MINIMUM_VALID_X_COORDINATE), \ AssertLE(x, MAXIMUM_VALID_X_COORDINATE), \ AssertGE(y, MINIMUM_VALID_Y_COORDINATE), \ @@ -21,6 +22,11 @@ const int MINIMUM_VALID_Z_COORDINATE = 0; ((SectorID % 16) + 1)) #define SECTORY(SectorID) (UINT8)(AssertLE(SectorID, MAXIMUM_VALID_X_COORDINATE*MAXIMUM_VALID_Y_COORDINATE), \ ((SectorID / 16) + 1)) +#else +#define SECTOR(x,y) (UINT8)(((y-1)*16+x-1)) +#define SECTORX(SectorID) (UINT8)(((SectorID % 16) + 1)) +#define SECTORY(SectorID) (UINT8)(((SectorID / 16) + 1)) +#endif //Sector enumerations //