void RubiksCube::startCheck() { while(PosTestBusy()); // wait for the position test to finish while(GFX_BUSY); // wait for all the polygons from the last object to be drawn PosTest_Asynch(0,0,0); // start a position test at the current translated position polyCount = GFX_POLYGON_RAM_USAGE; // save the polygon count }
// run afer drawing an object while picking void endCheck(Clickable obj) { while(GFX_BUSY); // wait for all the polygons to get drawn while(PosTestBusy()); // wait for the position test to finish if(GFX_POLYGON_RAM_USAGE>polyCount) // if a polygon was drawn { if(PosTestWresult()<=closeW) { // this is currently the closest object under the cursor! closeW=PosTestWresult(); clicked=obj; } } }
void RubiksCube::endCheck(int side, int tileX, int tileY) { while(GFX_BUSY); // wait for all the polygons to get drawn while(PosTestBusy()); // wait for the position test to finish if(GFX_POLYGON_RAM_USAGE>polyCount) // if a polygon was drawn { if(PosTestWresult()<=closeW) { // this is currently the closest object under the cursor! closeW=PosTestWresult(); clicked[0]=side; clicked[1]=tileX; clicked[2]=tileY; } } }
bool MapDraw::endCheck() { while(GFX_BUSY); // wait for all the polygons to get drawn while(PosTestBusy()); // wait for the position test to finish if(GFX_POLYGON_RAM_USAGE>polyCount) // if a polygon was drawn { { // this is currently the closest object under the cursor! closeW=PosTestWresult(); return true; } } return false; }