src/tunnelbridge_cmd.cpp
changeset 6699 d2f35126c1a6
parent 6691 f9adbb0be102
child 6708 257de56ddd2f
equal deleted inserted replaced
6698:611e079b7cd1 6699:d2f35126c1a6
   870 {
   870 {
   871 	static const SpriteID tram_offsets[2][6] = { { 107, 108, 109, 110, 111, 112 }, { 4, 5, 15, 16, 17, 18 } };
   871 	static const SpriteID tram_offsets[2][6] = { { 107, 108, 109, 110, 111, 112 }, { 4, 5, 15, 16, 17, 18 } };
   872 	static const SpriteID back_offsets[6]    =   {  95,  95,  99, 102, 100, 101 };
   872 	static const SpriteID back_offsets[6]    =   {  95,  95,  99, 102, 100, 101 };
   873 	static const SpriteID front_offsets[6]   =   {  97,  98, 103, 106, 104, 105 };
   873 	static const SpriteID front_offsets[6]   =   {  97,  98, 103, 106, 104, 105 };
   874 
   874 
   875 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, 16, 16, offset >= 2 ? 1 : 0, z);
   875 	static const uint size_x[6] = { 11, 16, 16, 16, 16, 16 };
       
   876 	static const uint size_y[6] = { 16, 11, 16, 16, 16, 16 };
       
   877 
       
   878 	AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], offset >= 2 ? 1 : 0, z);
   876 
   879 
   877 	SpriteID front = SPR_TRAMWAY_BASE + front_offsets[offset];
   880 	SpriteID front = SPR_TRAMWAY_BASE + front_offsets[offset];
   878 	SpriteID back  = SPR_TRAMWAY_BASE + back_offsets[offset];
   881 	SpriteID back  = SPR_TRAMWAY_BASE + back_offsets[offset];
   879 	SpriteID pal   = PAL_NONE;
   882 	SpriteID pal   = PAL_NONE;
   880 	if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
   883 	if (HASBIT(_transparent_opt, TO_BUILDINGS)) {
   881 		SETBIT(front, PALETTE_MODIFIER_TRANSPARENT);
   884 		SETBIT(front, PALETTE_MODIFIER_TRANSPARENT);
   882 		SETBIT(back,  PALETTE_MODIFIER_TRANSPARENT);
   885 		SETBIT(back,  PALETTE_MODIFIER_TRANSPARENT);
   883 		pal = PALETTE_TO_TRANSPARENT;
   886 		pal = PALETTE_TO_TRANSPARENT;
   884 	}
   887 	}
   885 
   888 
   886 	AddSortableSpriteToDraw(back,  pal, x, y, 16, 16, 0, z);
   889 	AddSortableSpriteToDraw(back,  pal, x, y, size_x[offset], size_y[offset], 0, z);
   887 	/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
   890 	/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
   888 	AddSortableSpriteToDraw(front, pal, x, y, 16, 16, offset >= 2 ? 0x30 : 0x10, z);
   891 	AddSortableSpriteToDraw(front, pal, x, y, size_x[offset], size_y[offset], offset >= 2 ? 0x30 : 0x10, z);
   889 }
   892 }
   890 
   893 
   891 /**
   894 /**
   892  * Draws a tunnel of bridge tile.
   895  * Draws a tunnel of bridge tile.
   893  * For tunnels, this is rather simple, as you only needa draw the entrance.
   896  * For tunnels, this is rather simple, as you only needa draw the entrance.