ent_getskin(ENTITY*,var num): BMAP*
Returns or sets a skin of the given entity.
ENTITY* - Model, sprite, or terrain entity pointer.
BMAP* - New bitmap to replace the skin texture.
num - Number of the skin, starting with 1.
If the skin does not exist, it is automatically created and the entity skin number is increased.
BMAP* pointer to the skin with the given number.
- Setting a skin affects
all entities sharing that model file
unless ent_clone or ent_cloneskin was
Sprites have only one skin, containing the image with all sprite frames.
ent_setskin(ent_clone(ent_create(SHADOW_DDS,NULL,NULL)),bmap,1) can be used to create individual sprites from bitmaps. A8.06
New skins can be added by setting them to the total number of skins plus 1. The number can be determined with ent_status.
Skins can be replaced by calling ptr_remove for removing the skin returned by ent_getskin, and then setting the new skin with ent_setskin.
For inserting a new skin, or removing a skin from a certain number and sorting the rest of the skins, copy the higher skins upwards or downwards by repeatedly calling ent_getskin and ent_setskin with increasing or decreasing skin numbers.
- In the case of a sprite entity, the entity's scale factors are automatically adjusted to the size of the new skin, so that the entity size remains unchanged even when the skin size was changed.
If the skin is named, the link.name element of the returned BMAP* struct contains a char* pointer to the skin name.
ent_morphskin, ent_cloneskin, bmap_for_entity,