tunnelbridge_cmd.c
changeset 1091 0f113f2ed794
parent 1082 a83d7ac6fecb
child 1095 b59632d9df1b
equal deleted inserted replaced
1090:5d378bd5fcbc 1091:0f113f2ed794
   308 			_error_message = STR_980E_SHIP_IN_THE_WAY;
   308 			_error_message = STR_980E_SHIP_IN_THE_WAY;
   309 			return CMD_ERROR;
   309 			return CMD_ERROR;
   310 		}
   310 		}
   311 
   311 
   312 		if (ti.type == MP_WATER) {
   312 		if (ti.type == MP_WATER) {
   313 			if (ti.map5 != 0) goto not_valid_below;
   313 			if (ti.map5 > 1) goto not_valid_below;
   314 			m5 = 0xC8;
   314 			m5 = 0xC8;
   315 		} else if (ti.type == MP_RAILWAY) {
   315 		} else if (ti.type == MP_RAILWAY) {
   316 			if (direction == 0) {
   316 			if (direction == 0) {
   317 				if (ti.map5 != 2) goto not_valid_below;
   317 				if (ti.map5 != 2) goto not_valid_below;
   318 			} else {
   318 			} else {
   778 				if (m5 & 0x20) {
   778 				if (m5 & 0x20) {
   779 					static const uint16 _new_data_table[] = {0x1002, 0x1001, 0x2005, 0x200A, 0, 0, 0, 0};
   779 					static const uint16 _new_data_table[] = {0x1002, 0x1001, 0x2005, 0x200A, 0, 0, 0, 0};
   780 					new_data = _new_data_table[((m5 & 0x18) >> 2) | (m5&1)];
   780 					new_data = _new_data_table[((m5 & 0x18) >> 2) | (m5&1)];
   781 				}	else {
   781 				}	else {
   782 					if (!(m5 & 0x18)) goto clear_it;
   782 					if (!(m5 & 0x18)) goto clear_it;
   783 					new_data = 0x6000;
   783 					new_data = (GetTileSlope(c, NULL) == 0) ? 0x6000 : 0x6001;
   784 				}
   784 				}
   785 
   785 
   786 				SetTileType(c, new_data >> 12);
   786 				SetTileType(c, new_data >> 12);
   787 				_map5[c] = (byte)new_data;
   787 				_map5[c] = (byte)new_data;
   788 				_map2[c] = 0;
   788 				_map2[c] = 0;
   935 extern const byte _track_sloped_sprites[14];
   935 extern const byte _track_sloped_sprites[14];
   936 extern const byte _road_sloped_sprites[14];
   936 extern const byte _road_sloped_sprites[14];
   937 
   937 
   938 #include "table/bridge_land.h"
   938 #include "table/bridge_land.h"
   939 #include "table/tunnel_land.h"
   939 #include "table/tunnel_land.h"
       
   940 #include "table/water_land.h"
   940 
   941 
   941 static void DrawBridgePillars(TileInfo *ti, int x, int y, int z)
   942 static void DrawBridgePillars(TileInfo *ti, int x, int y, int z)
   942 {
   943 {
   943 	const uint32 *b;
   944 	const uint32 *b;
   944 	uint32 image;
   945 	uint32 image;
  1073 			assert(image <= 1);
  1074 			assert(image <= 1);
  1074 
  1075 
  1075 			if (!(ti->map5 & 0x20)) {
  1076 			if (!(ti->map5 & 0x20)) {
  1076 				// draw land under bridge
  1077 				// draw land under bridge
  1077 				if (ice) image += 2;					// ice too?
  1078 				if (ice) image += 2;					// ice too?
  1078 				DrawGroundSprite(_bridge_land_below[image] + _tileh_to_sprite[ti->tileh]);
  1079 
       
  1080 				if (image != 1 || ti->tileh == 0)
       
  1081 					DrawGroundSprite(_bridge_land_below[image] + _tileh_to_sprite[ti->tileh]);
       
  1082 				else
       
  1083 					DrawGroundSprite(_water_shore_sprites[ti->tileh]);
  1079 
  1084 
  1080 				// draw canal water?
  1085 				// draw canal water?
  1081 				if (ti->map5 & 8 && ti->z != 0) DrawCanalWater(ti->tile);
  1086 				if (ti->map5 & 8 && ti->z != 0) DrawCanalWater(ti->tile);
  1082 			} else {
  1087 			} else {
  1083 				// draw transport route under bridge
  1088 				// draw transport route under bridge