src/tree_cmd.cpp
changeset 7333 e48228e44be8
parent 7317 e61af9d8a2b3
child 7335 141c6b86ec1f
equal deleted inserted replaced
7332:543ecb9e2caf 7333:e48228e44be8
   372 
   372 
   373 		/* put the trees to draw in a list */
   373 		/* put the trees to draw in a list */
   374 		i = GetTreeCount(ti->tile) + 1;
   374 		i = GetTreeCount(ti->tile) + 1;
   375 		do {
   375 		do {
   376 			SpriteID image = s[0].sprite + (--i == 0 ? GetTreeGrowth(ti->tile) : 3);
   376 			SpriteID image = s[0].sprite + (--i == 0 ? GetTreeGrowth(ti->tile) : 3);
   377 			SpriteID pal;
   377 			SpriteID pal = s[0].pal;
   378 			if (HASBIT(_transparent_opt, TO_TREES)) {
   378 
   379 				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
       
   380 				pal = PALETTE_TO_TRANSPARENT;
       
   381 			} else {
       
   382 				pal = s[0].pal;
       
   383 			}
       
   384 			te[i].image = image;
   379 			te[i].image = image;
   385 			te[i].pal   = pal;
   380 			te[i].pal   = pal;
   386 			te[i].x = d->x;
   381 			te[i].x = d->x;
   387 			te[i].y = d->y;
   382 			te[i].y = d->y;
   388 			s++;
   383 			s++;
   402 				}
   397 				}
   403 			} while (i);
   398 			} while (i);
   404 
   399 
   405 			if (tep == NULL) break;
   400 			if (tep == NULL) break;
   406 
   401 
   407 			AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z);
   402 			AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z, HASBIT(_transparent_opt, TO_TREES));
   408 			tep->image = 0;
   403 			tep->image = 0;
   409 		}
   404 		}
   410 	}
   405 	}
   411 
   406 
   412 	EndSpriteCombine();
   407 	EndSpriteCombine();