src/viewport.cpp
changeset 7829 88883899c9e6
parent 7817 f24498d934ac
child 7982 539e32cc37ce
equal deleted inserted replaced
7828:b78d1fab57da 7829:88883899c9e6
   476 		return;
   476 		return;
   477 
   477 
   478 	AddChildSpriteScreen(image, pal, pt.x - vd->parent_list[-1]->left, pt.y - vd->parent_list[-1]->top);
   478 	AddChildSpriteScreen(image, pal, pt.x - vd->parent_list[-1]->left, pt.y - vd->parent_list[-1]->top);
   479 }
   479 }
   480 
   480 
   481 
   481 /** Draw a (transparent) sprite at given coordinates
   482 void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, byte dz, byte z)
   482  * @param image the image to combine and draw,
       
   483  * @param pal the provided palette,
       
   484  * @param x position x of the sprite,
       
   485  * @param y position y of the sprite,
       
   486  * @param w width of the sprite,
       
   487  * @param h height of the sprite,
       
   488  * @param dz delta z, difference of elevation between sprite and parent sprite,
       
   489  * @param z elevation of the sprite,
       
   490  * @param transparent if true, switch the palette between the provided palette and the transparent palette
       
   491  */
       
   492 void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, byte dz, byte z, bool transparent)
   483 {
   493 {
   484 	ViewportDrawer *vd = _cur_vd;
   494 	ViewportDrawer *vd = _cur_vd;
   485 	ParentSpriteToDraw *ps;
   495 	ParentSpriteToDraw *ps;
   486 	const Sprite *spr;
   496 	const Sprite *spr;
   487 	Point pt;
   497 	Point pt;
   488 
   498 
   489 	assert((image & SPRITE_MASK) < MAX_SPRITES);
   499 	assert((image & SPRITE_MASK) < MAX_SPRITES);
       
   500 
       
   501 	/* make the sprites transparent with the right palette */
       
   502 	if (transparent) {
       
   503 		SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
       
   504 		pal = PALETTE_TO_TRANSPARENT;
       
   505 	}
   490 
   506 
   491 	if (vd->combine_sprites == 2) {
   507 	if (vd->combine_sprites == 2) {
   492 		AddCombinedSprite(image, pal, x, y, z);
   508 		AddCombinedSprite(image, pal, x, y, z);
   493 		return;
   509 		return;
   494 	}
   510 	}