Esempio n. 1
0
// 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;
		}
	}
}
Esempio n. 2
0
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;
		}
	}
}
Esempio n. 3
0
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;
}