inline int PackCoords(int x, int y, int l) { return (x & 0x3FF) + ((y & 0x3FF) << 16) + ((l & 0xF) << 26); } inline void UnpackCoords(int coords, int& x, int& y, int& l) { x = coords & 0x3FF; y = (coords >> 16) & 0x3FF; l = (coords >> 26) & 0xF; }