00001
00002 #ifndef __MACROS_H__
00003 #define __MACROS_H__
00004
00005 #define ARRAY_LENGTH(arr) ((sizeof (arr)) / (sizeof ((arr)[0])))
00006
00007 #ifndef min
00008 #define min(a, b) (((a) <= (b)) ? (a) : (b))
00009 #endif
00010
00011 #ifndef max
00012 #define max(a, b) (((a) >= (b)) ? (a) : (b))
00013 #endif
00014
00015 #define STRINGIFY(x) _STRINGIFY(x)
00016 #define _STRINGIFY(x) #x
00017
00018 #define IRBox(a,b,c,d,e) {InBox((a),(b),(c),(d));RectFill((a)+1,(b)+1,(c)-1,(d)-1,(e));}
00019 #define ORBox(a,b,c,d,e) {OutBox((a),(b),(c),(d));RectFill((a)+1,(b)+1,(c)-1,(d)-1,(e));}
00020
00021
00022
00023 #define pButton(a,b,c,d,e,f,g) if ((x>=(a) && y>=(b) && x<=(c) && y<=(d) && mousebuttons==1) || ((f)==(g)))\
00024 { \
00025 InBox((a),(b),(c),(d)); \
00026 WaitForMouseUp(); \
00027 (e);\
00028 if((f)>0) delay(150); \
00029 OutBox((a),(b),(c),(d));\
00030 };
00031
00032
00033 #define pnButton(a,b,c,d,e,f,g) if ((x>=(a) && y>=(b) && x<=(c) && y<=(d) && mousebuttons==1) || ((f)!=(g)))\
00034 { \
00035 InBox((a),(b),(c),(d)); \
00036 WaitForMouseUp(); \
00037 (e); \
00038 if((f)>0) delay(150); \
00039 OutBox((a),(b),(c),(d)); \
00040 };
00041
00042 #define Button2(a,b,c,d,e,f,g) if ((x>=(a) && y>=(b) && x<=(c) && y<=(d) && mousebuttons==1) || ((f)==(g)))\
00043 { \
00044 WaitForMouseUp(); \
00045 (e); \
00046 };
00047
00048 #define poz(a) (((a)<0)?0:(a))
00049
00050
00051 #define PreChe(a,b) (Data->Prestige[(b)].Place==(a) || Data->Prestige[(b)].mPlace==(a))
00052
00053
00054 #endif
00055