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
This commit is contained in:
SpaceViking
2009-03-28 00:13:12 +00:00
parent a465bebf14
commit 84299f157e
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -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
+6
View File
@@ -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
//