* Decode the given encoded index. * * @param id The encoded index to decode. * @return The decoded index. */
| 63 | * @return The decoded index. |
| 64 | */ |
| 65 | uint16 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. |
no test coverage detected