本文整理汇总了C++中Coordinate::ViolatesBoundary方法的典型用法代码示例。如果您正苦于以下问题:C++ Coordinate::ViolatesBoundary方法的具体用法?C++ Coordinate::ViolatesBoundary怎么用?C++ Coordinate::ViolatesBoundary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coordinate
的用法示例。
在下文中一共展示了Coordinate::ViolatesBoundary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
/**\brief Draws the radar.
*/
void Radar::Draw( void ) {
short int radar_mid_x = RADAR_MIDDLE_X + Video::GetWidth() - 129;
short int radar_mid_y = RADAR_MIDDLE_Y + 5;
int radarSize;
list<Sprite*> *spriteList = SpriteManager::Instance()->GetSpritesNear(Camera::Instance()->GetFocusCoordinate(), (float)visibility);
for( list<Sprite*>::const_iterator iter = spriteList->begin(); iter != spriteList->end(); iter++)
{
Coordinate blip;
Sprite *sprite = *iter;
//if( sprite->GetDrawOrder() == DRAW_ORDER_PLAYER ) continue;
// Calculate the blip coordinate for this sprite
Coordinate wpos = sprite->GetWorldPosition();
WorldToBlip( wpos, blip );
if( blip.ViolatesBoundary( -(RADAR_HEIGHT / 2.0), (RADAR_WIDTH / 2.0), (RADAR_HEIGHT / 2.0), -(RADAR_WIDTH / 2.0) ) == false ) {
/* blip is on the radar */
/* Convert to screen coords */
blip.SetX( blip.GetX() + radar_mid_x );
blip.SetY( blip.GetY() + radar_mid_y );
radarSize = int((sprite->GetRadarSize() / float(visibility)) * (RADAR_HEIGHT/4.0));
if( radarSize >= 1 ) {
Video::DrawCircle( blip, radarSize, 1, sprite->GetRadarColor() );
} else {
Video::DrawPoint( blip, sprite->GetRadarColor() );
}
}
}
delete spriteList;
}