示例#1
0
void drawTrace(Position oldPosition, Position position, SDL_Surface* ecran)
{
	/*	AFFICHAGE NOUVEAU POINT	*/
	
	//# SDL_Surface *mouseTrace = SDL_CreateRGBSurface(SDL_HWSURFACE, 10, 10, 32, 0, 255, 0, 0);
	Uint32 color = SDL_MapRGB(ecran->format, 180, 0, 0);
    // Hide real cursor



	drawDot(ecran, position.x, position.y, color);
    // Blit onto main surface
    //# SDL_BlitSurface(mouseTrace, NULL, ecran, &dst);

	
	
	/*	AFFICHAGE MOITIE (completion)	*/
	
	if (!seCroisent(position, oldPosition)){
	// calc milieu
	// afficher milieu
	// draw gauche
	// draw droite
		Position milieu;
		milieu.x = (position.x + oldPosition.x)/2;
		milieu.y = (position.y + oldPosition.y)/2;
		
		drawDot(ecran, milieu.x, milieu.y, color);
		
		
		drawTrace(position, milieu, ecran);
		drawTrace(milieu, oldPosition, ecran);
	}
	
}
示例#2
0
void content ()
{
	glClear (GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
	
	if (raycast) 
	{
		DoRayTrace ();
		DisplayImage ();
	} 
	else 
	{
		draw3Dscene();
		
		glPushAttrib(GL_ENABLE_BIT);
		drawLight();
		
		if( track )
			drawTrace();

		hint();
		glPopAttrib();
	}

	//
	// FPS calculation and output
	///////////////////////////////////////////////////////////
	FPScomputation += 1;
	glutSwapBuffers();
}
void
PlayerPainter::drawAll( QPainter & painter,
                        const rcss::rcg::PlayerT & player,
                        const rcss::rcg::BallT & ball ) const
{
    const Param param( player,
                       ball,
                       M_main_data.serverParam(),
                       M_main_data.playerType( player.type_ ) );

    drawBody( painter, param );
    drawDir( painter, param );

    if ( player.hasNeck()
         && player.hasView()
         && Options::instance().showViewArea() )
    {
        drawViewArea( painter, param );
    }

    if ( player.isGoalie()
         && Options::instance().showCatchArea() )
    {
        drawCatchArea( painter, param );
    }

    if ( Options::instance().showTackleArea() )
    {
        drawTackleArea( painter, param );
    }

    if ( Options::instance().showKickAccelArea()
         && Options::instance().selectedPlayer( player.side(),
                                                player.unum_ ) )
    {
        drawKickAccelArea( painter, param );
    }

    if ( player.isPointing()
         && Options::instance().showPointto() )
    {
        drawPointto( painter, param );
    }

    if ( Options::instance().showPlayerTrace()
         && Options::instance().selectedPlayer( param.player_.side(),
                                                param.player_.unum_ ) )
    {
        drawTrace( painter, param );
    }

    drawText( painter, param );
}