Пример #1
0
void Room::add_decoration(Sprite *sprite, boolean give_priority, boolean subpicture) {
   // subpicture makes it so everything is clipped to the leader
   // but it also removes the pad from numbers and text
   if (sprite == NULL) return;
   if (wall_decoration == NULL) initialize_wall_decoration();
   wall_decoration->set_visible(TRUE);
   Picture *picture;
   if (sprite->kind_of() == PICTURE) {
      picture = (Picture *) sprite;
   } else {
      picture = make_indirect_picture(sprite,FALSE); // relies upon this really making sprite be the indirection 
		sprite->destroy(); // new on 240101 really decrement ref count increased by set_indirection called by make_indirect_picture
   };
   picture->set_subpicture(subpicture);
   if (give_priority) {
//		give_item_priority(sprite); // this might call update_priority which might set the priority to lly
		picture->set_priority(current_priority--); // was sprite->
	};
	boolean saved_show_all = picture->show_all();
   wall_decoration->add_follower(picture,TRUE,INSERT_BY_PRIORITY);
	picture->set_show_all(saved_show_all); // new on 230902 so see pads (unless changed prior to this)
   picture->set_held_status(NOT_HELD); // why??
   picture->recursively_activate_pictures(); // was activate();
   picture->set_containable_by_background(FALSE);
	picture->set_move_between_floor_and_room(FALSE);
   picture->set_priority_fixed(TRUE);
};