waypoint.c
changeset 2187 a0e206ce9fbf
parent 2186 db48cf29b983
child 2254 99de94953104
equal deleted inserted replaced
2186:db48cf29b983 2187:a0e206ce9fbf
   376 	/* draw default waypoint graphics of ID 0 */
   376 	/* draw default waypoint graphics of ID 0 */
   377 	if (stat_id == 0) {
   377 	if (stat_id == 0) {
   378 		const DrawTrackSeqStruct *dtss = _track_depot_layout_table[4];
   378 		const DrawTrackSeqStruct *dtss = _track_depot_layout_table[4];
   379 
   379 
   380 		img = dtss++->image;
   380 		img = dtss++->image;
   381 		if (img & 0x8000) img = (img & 0x7FFF) + railtype*TRACKTYPE_SPRITE_PITCH;
   381 		if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK) + railtype*TRACKTYPE_SPRITE_PITCH;
   382 		DrawSprite(img, x, y);
   382 		DrawSprite(img, x, y);
   383 
   383 
   384 		for (; dtss->image != 0; dtss++) {
   384 		for (; dtss->image != 0; dtss++) {
   385 			Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0);
   385 			Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0);
   386 			img = dtss->image;
   386 			img = dtss->image;
   387 			if (img & 0x8000) img |= ormod;
   387 			if (img & PALETTE_MODIFIER_COLOR) img |= ormod;
   388 			DrawSprite(img, x + pt.x, y + pt.y);
   388 			DrawSprite(img, x + pt.x, y + pt.y);
   389 		}
   389 		}
   390 		return;
   390 		return;
   391 	}
   391 	}
   392 
   392 
   398 	cust = &stat->renderdata[2];
   398 	cust = &stat->renderdata[2];
   399 
   399 
   400 	img = cust->ground_sprite;
   400 	img = cust->ground_sprite;
   401 	img += railtype * ((img < _custom_sprites_base) ? TRACKTYPE_SPRITE_PITCH : 1);
   401 	img += railtype * ((img < _custom_sprites_base) ? TRACKTYPE_SPRITE_PITCH : 1);
   402 
   402 
   403 	if (img & 0x8000) img = (img & 0x7FFF);
   403 	if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK);
   404 	DrawSprite(img, x, y);
   404 	DrawSprite(img, x, y);
   405 
   405 
   406 	foreach_draw_tile_seq(seq, cust->seq) {
   406 	foreach_draw_tile_seq(seq, cust->seq) {
   407 		Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);
   407 		Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);
   408 		uint32 image = seq->image + relocation;
   408 		uint32 image = seq->image + relocation;
   409 
   409 
   410 		DrawSprite((image&0x3FFF) | ormod, x + pt.x, y + pt.y);
   410 		DrawSprite((image & SPRITE_MASK) | ormod, x + pt.x, y + pt.y);
   411 	}
   411 	}
   412 }
   412 }
   413 
   413 
   414 /* Fix savegames which stored waypoints in their old format */
   414 /* Fix savegames which stored waypoints in their old format */
   415 void FixOldWaypoints(void)
   415 void FixOldWaypoints(void)