MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Tools_Index_Decode

Function Tools_Index_Decode

src/tools.c:65–69  ·  view source on GitHub ↗

* Decode the given encoded index. * * @param id The encoded index to decode. * @return The decoded index. */

Source from the content-addressed store, hash-verified

63 * @return The decoded index.
64 */
65uint16 Tools_Index_Decode(uint16 encoded)
66{
67 if (Tools_Index_GetType(encoded) == IT_TILE) return Tile_PackXY((encoded >> 1) & 0x3F, (encoded >> 8) & 0x3F);
68 return encoded & 0x3FFF;
69}
70
71/**
72 * Encode the given index.

Callers 10

Unit_SetDestinationFunction · 0.85
Unit_SetTargetFunction · 0.85
Tools_Index_IsValidFunction · 0.85
Tools_Index_GetTileFunction · 0.85
Tools_Index_GetUnitFunction · 0.85
Tools_Index_GetStructureFunction · 0.85
Tools_Index_GetObjectFunction · 0.85

Calls 1

Tools_Index_GetTypeFunction · 0.85

Tested by

no test coverage detected