macros.h
changeset 703 3f64a428fcbc
parent 679 04ca2cd69420
child 900 27eb21ced433
equal deleted inserted replaced
702:5e80e4d69057 703:3f64a428fcbc
   163 
   163 
   164 #define CHANCE16(a,b) ((uint16)Random() <= (uint16)((65536 * a) / b))
   164 #define CHANCE16(a,b) ((uint16)Random() <= (uint16)((65536 * a) / b))
   165 #define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
   165 #define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
   166 #define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
   166 #define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
   167 
   167 
   168 #define FIND_CATCHMENT_RADIUS(st,rad)           \
       
   169 	{\
       
   170 	if (st->bus_tile || st->lorry_tile || (st->airport_tile && st->airport_type == AT_OILRIG)) rad = 3;             \
       
   171 	if (st->train_tile || (st->airport_tile && (st->airport_type == AT_HELIPORT || st->airport_type == AT_SMALL))) rad = 4;        \
       
   172 	if (st->dock_tile || (st->airport_tile && st->airport_type == AT_LARGE)) rad = 5;               \
       
   173 	if (st->airport_tile && st->airport_type == AT_METROPOLITAN) rad = 6;                           \
       
   174 	if (st->airport_tile && st->airport_type == AT_INTERNATIONAL) rad = 8;          }
       
   175 
       
   176 
       
   177 
       
   178 #define BEGIN_TILE_LOOP(var,w,h,tile)		\
   168 #define BEGIN_TILE_LOOP(var,w,h,tile)		\
   179 		{int h_cur = h;									\
   169 		{int h_cur = h;									\
   180 		uint var = tile;									\
   170 		uint var = tile;									\
   181 		do {														\
   171 		do {														\
   182 			int w_cur = w;								\
   172 			int w_cur = w;								\