ent_status(ENTITY*, var mode);
A7.62 Returns status information about the entity.
Parameters:
ENTITY*  Entity pointer.
mode  Information to return:
0  number of unique xyz vertices of model or terrain meshes (this number is displayed in MED).
1  total number of mesh vertices, including duplicated vertices with the same xyz position, but different skins or uv positions.
2  number of terrain mesh squares in x direction.
This is one less than the number of vertices in x direction, and should be a multiple of terrain_chunk.
3  number of terrain mesh squares in y direction.
This is one less than the number of vertices in y direction, and should be a multiple of terrain_chunk.
4  number of triangles of the main mesh.
5  number of triangles of the 1st internal LOD mesh.
6  number of triangles of the 2nd internal LOD mesh.
7  number of triangles of the 3rd internal LOD mesh.
8  total number of model skins.
9  number of mesh subsets (parts of the mesh with different skins).
10  number of skins per subset (>1 when normal or height maps are used).
12  number of model or sprite animation frames.
14  number of bones.
16  number of terrain chunks or map entity blocks.
20  number of internal lod meshes.
22  size of a mesh vertex, in bytes. A7.82
Returns:
Status information dependent on mode.
Remarks:
 If the information is not available for the entity type (such as vertices in x/y direction for nonterrain models), 0 is returned.
 For entities consisting of several meshes, such as chunked terrain, the vertex and triangle numbers are a sum over all meshes.

For map entities, the number of skins, triangles, and vertices is undefined, thus only mode=16 delivers a result. The total number of vertices and triangles of a map entity can be calculated with the ent_buffers function.

The vertex size, returned by ent_status(ent,22), can be used for accessing a D3DVERTEX from the vertex buffer of the mesh. Calling ent_status for determining the vertex size, rather than sizeof(D3DVERTEX), is recommended because the
vertex struct may change between engine versions.
 This function replaces the ent_vertices, ent_skins, ent_bones, and ent_frames functions.
Speed:
FastExample:
x_vertices = ent_status(ent_terrain,2);
y_vertices = ent_status(ent_terrain,3);
See also:
ent_type, ent_getmesh
► latest
version online