smallmap_gui.c
changeset 856 918759cedca8
parent 758 423ae0bcba07
child 867 dffd33233237
equal deleted inserted replaced
855:77d7ff319a94 856:918759cedca8
   354 }
   354 }
   355 
   355 
   356 static void DrawSmallMapContours(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   356 static void DrawSmallMapContours(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   357 {
   357 {
   358 	do {
   358 	do {
   359 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   359 		if (xc < MapMaxX() && yc < MapMaxY())
   360 		    if (dst > _screen.dst_ptr && dst < (_screen.dst_ptr + _screen.width * _screen.height - _screen.width) )
   360 		    if (dst > _screen.dst_ptr && dst < (_screen.dst_ptr + _screen.width * _screen.height - _screen.width) )
   361 		        WRITE_PIXELS_OR( dst, GetSmallMapCountoursPixels(TILE_XY(xc,yc)) & mask );
   361 		        WRITE_PIXELS_OR( dst, GetSmallMapCountoursPixels(TILE_XY(xc,yc)) & mask );
   362 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   362 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   363 }
   363 }
   364 
   364 
   384 
   384 
   385 
   385 
   386 static void DrawSmallMapVehicles(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   386 static void DrawSmallMapVehicles(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   387 {
   387 {
   388 	do {
   388 	do {
   389 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   389 		if (xc < MapMaxX() && yc < MapMaxY())
   390 			WRITE_PIXELS_OR( dst, GetSmallMapVehiclesPixels(TILE_XY(xc,yc)) & mask );
   390 			WRITE_PIXELS_OR( dst, GetSmallMapVehiclesPixels(TILE_XY(xc,yc)) & mask );
   391 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   391 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   392 }
   392 }
   393 
   393 
   394 static const byte _industry_smallmap_colors[175] = {
   394 static const byte _industry_smallmap_colors[175] = {
   441 }
   441 }
   442 
   442 
   443 static void DrawSmallMapIndustries(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   443 static void DrawSmallMapIndustries(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   444 {
   444 {
   445 	do {
   445 	do {
   446 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   446 		if (xc < MapMaxX() && yc < MapMaxY())
   447 			WRITE_PIXELS_OR(dst, GetSmallMapIndustriesPixels(TILE_XY(xc,yc)) & mask);
   447 			WRITE_PIXELS_OR(dst, GetSmallMapIndustriesPixels(TILE_XY(xc,yc)) & mask);
   448 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   448 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   449 }
   449 }
   450 
   450 
   451 static inline uint32 GetSmallMapRoutesPixels(uint tile)
   451 static inline uint32 GetSmallMapRoutesPixels(uint tile)
   482 }
   482 }
   483 
   483 
   484 static void DrawSmallMapRoutes(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   484 static void DrawSmallMapRoutes(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   485 {
   485 {
   486 	do {
   486 	do {
   487 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   487 		if (xc < MapMaxX() && yc < MapMaxY())
   488 			WRITE_PIXELS_OR(dst, GetSmallMapRoutesPixels(TILE_XY(xc,yc)) & mask);
   488 			WRITE_PIXELS_OR(dst, GetSmallMapRoutesPixels(TILE_XY(xc,yc)) & mask);
   489 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   489 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   490 }
   490 }
   491 
   491 
   492 static const uint32 _vegetation_clear_bits[4 + 7] = {
   492 static const uint32 _vegetation_clear_bits[4 + 7] = {
   540 
   540 
   541 
   541 
   542 static void DrawSmallMapVegetation(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   542 static void DrawSmallMapVegetation(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   543 {
   543 {
   544 	do {
   544 	do {
   545 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   545 		if (xc < MapMaxX() && yc < MapMaxY())
   546 			WRITE_PIXELS_OR(dst, GetSmallMapVegetationPixels(TILE_XY(xc,yc)) & mask);
   546 			WRITE_PIXELS_OR(dst, GetSmallMapVegetationPixels(TILE_XY(xc,yc)) & mask);
   547 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   547 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   548 }
   548 }
   549 
   549 
   550 
   550 
   568 
   568 
   569 
   569 
   570 static void DrawSmallMapOwners(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   570 static void DrawSmallMapOwners(byte *dst, uint xc, uint yc, int pitch, int reps, uint32 mask)
   571 {
   571 {
   572 	do {
   572 	do {
   573 		if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
   573 		if (xc < MapMaxX() && yc < MapMaxY())
   574 			WRITE_PIXELS_OR(dst, GetSmallMapOwnerPixels(TILE_XY(xc,yc)) & mask);
   574 			WRITE_PIXELS_OR(dst, GetSmallMapOwnerPixels(TILE_XY(xc,yc)) & mask);
   575 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   575 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   576 }
   576 }
   577 
   577 
   578 
   578