publicint X { get { m_x =(Id & 0x3FE00)>>9;// 9 higher bits if((m_x & 0x100)== 0x100)// 9th bit is the sign. 1 means it's minus { m_x =-(X & 0xFF);// just take the 8 first bits and take the opposite number } return m_x.Value; } }
publicint Y { get { m_y = Id & 0x01FF;// 9 lower bits if((m_y & 0x100)== 0x100)// 9th bit is the sign. 1 means it's minus { m_y =-(X & 0xFF);// just take the 8 first bits and take the opposite number } return m_y.Value; } }
Hey bon entre temps j'avais fini par trouver avant que vous me répondiez mais merci quand même par contre je bloque sur Y qui ne me renvoi pas la bonne valeur
Y devrait me renvoyer : -16
mais il me renvoi 6 why ?
est se que j'ai pus faire une erreur qqpart ?