当前位置: 首页>>代码示例>>C++>>正文


C++ circlefill函数代码示例

本文整理汇总了C++中circlefill函数的典型用法代码示例。如果您正苦于以下问题:C++ circlefill函数的具体用法?C++ circlefill怎么用?C++ circlefill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了circlefill函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: adjustPoint

void AllegroGUIRenderer::fillPartialRoundedRect(int x, int y, int width,
  int height, int radius,partialRoundedRect part, const GUIColor& color)
{
    adjustPoint(x, y);
    switch(part)
    {
    case prr_top:
        circlefill(target, x+radius, y+radius, radius, color);
        circlefill(target, x+width-radius-1, y+radius, radius, color);
        rectfill(target, x, y+radius, x+width-1, y+height-1, color);
        rectfill(target, x+radius, y, x+width-radius-1, y+radius-1, color);
        break;
    case prr_bottom:
        circlefill(target, x+radius, y+height-radius-1, radius, color);
        circlefill(target, x+width-radius-1, y+height-radius-1, radius, color);
        rectfill(target, x, y, x+width-1, y+height-radius-1, color);
        rectfill(target, x+radius, y+height-radius, x+width-radius-1, y+height-1, color);
        break;
        
    case prr_topRight:
        break;
        
    case prr_bottomRight:
        break;
    }
}
开发者ID:PyroXFire,项目名称:ZeldaClassic,代码行数:26,代码来源:renderer.cpp

示例2: highlight

// highlight: animate the placement of the stone
void highlight(int en, int side)
{
	int i;

	scare_mouse();
	if (side == 1)
	{
		for (i = 0; i < 20; ++i)
		{
			// go from blackground color to black
			circlefill(screen, 50*file(en), 45 + 50*rank(en), 15,
				makecol(0, 200 - i*10, 0));
			rest(10);
		}
	}
	else
	{
		for (i = 0; i < 20; ++i)
		{
			// go from background color to white
			circlefill(screen, 50*file(en), 45 + 50*rank(en), 15,
				makecol(i*10, 200 + 55*i/20, i*10));
			rest(10);
		}
	}
	unscare_mouse();
}
开发者ID:raxpersson,项目名称:reversi,代码行数:28,代码来源:reversi.c

示例3: PutGrid

void PutGrid(BITMAP * dc)
{
	double yr = TO_RAD(Form1->TrackBarTilt->Position);
	float sin_y = Sin(ANGLE_Y);
	float cos_y = Cos(ANGLE_Y);

	float ScaleV_Y = sin_y;
	float ScaleV_XZ = cos_y;
	float sin_x = Sin(ANGLE_X);
	float cos_x = Cos(ANGLE_X);
	int PenCol;
	SET_PEN(dc,128,0,0);
	LINE(dc,CENTER+XGRID*cos_x,CENTER-XGRID*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y,
			CENTER-XGRID*cos_x,CENTER+XGRID*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y,PenCol);
	LINE(dc,CENTER+XGRID*cos_x,CENTER-XGRID*sin_x*ScaleV_XZ,
			CENTER-XGRID*cos_x,CENTER+XGRID*sin_x*ScaleV_XZ,PenCol);
	LINE(dc,CENTER+XGRID*cos_x,CENTER-XGRID*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y,
			CENTER-XGRID*cos_x,CENTER+XGRID*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y,PenCol);

	LINE(dc	,CENTER+XGRID*cos_x,CENTER-XGRID*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER+XGRID*cos_x,CENTER-XGRID*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc	,CENTER+XGRID_2*cos_x,CENTER-XGRID_2*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER+XGRID_2*cos_x,CENTER-XGRID_2*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc	,CENTER-XGRID*cos_x,CENTER+XGRID*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER-XGRID*cos_x,CENTER+XGRID*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc	,CENTER-XGRID_2*cos_x,CENTER+XGRID_2*sin_x*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER-XGRID_2*cos_x,CENTER+XGRID_2*sin_x*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);

	float sin_z = cos_x;//Sin(ANGLE_Z);
	float cos_z = sin_x;//Cos(ANGLE_Z);

	SET_PEN(dc,0,96,96);//                SelectObject(dc,PenYellow);
	LINE(dc,CENTER-XGRID*cos_z, CENTER - XGRID*sin_z*ScaleV_XZ - XGRID_2*ScaleV_Y,
			CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ - XGRID_2*ScaleV_Y,PenCol);
	LINE(dc,CENTER-XGRID*cos_z, CENTER - XGRID*sin_z*ScaleV_XZ,//*ScaleV_Y    ,
			CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ /**ScaleV_Y*/    ,PenCol);
	LINE(dc,CENTER-XGRID*cos_z, CENTER - XGRID*sin_z*ScaleV_XZ +XGRID_2*ScaleV_Y,
			CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ +XGRID_2*ScaleV_Y,PenCol);

	LINE(dc,CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ-XGRID_2*ScaleV_Y
		   ,CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc	,CENTER-XGRID_2*cos_z,CENTER-XGRID_2*sin_z*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER-XGRID_2*cos_z,CENTER-XGRID_2*sin_z*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc,CENTER-XGRID*cos_z, CENTER - XGRID*sin_z*ScaleV_XZ-XGRID_2*ScaleV_Y
		   ,CENTER-XGRID*cos_z, CENTER - XGRID*sin_z*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);
	LINE(dc	,CENTER+XGRID_2*cos_z,CENTER+XGRID_2*sin_z*ScaleV_XZ-XGRID_2*ScaleV_Y
			,CENTER+XGRID_2*cos_z,CENTER+XGRID_2*sin_z*ScaleV_XZ+XGRID_2*ScaleV_Y			,PenCol);

	SET_PEN(dc,64,64,64);//                SelectObject(dc,PenYellow);
	LINE(dc,CENTER,CENTER-XGRID_2*ScaleV_Y,
			CENTER,CENTER+XGRID_2*ScaleV_Y,PenCol);
	circlefill(dc,
			CENTER+XGRID*cos_z, CENTER + XGRID*sin_z*ScaleV_XZ //*sin_y
			,3,makecol24(0,128,0));
	circlefill(dc,
			CENTER,CENTER-XGRID_2*ScaleV_Y
			,3,makecol24(128,128,0));
}
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:58,代码来源:DrawView3.cpp

示例4: moveBall

void moveBall(){

    ball_tempX = ball_x;
    ball_tempY = ball_y;

    if (dir == 1 && ball_x > 5 && ball_y > 5){
     
         if( ball_x == p1_x + 15 && ball_y >= p1_y && ball_y <= p1_y + 60){
                  dir = rand()% 2 + 3;
         }else{    
                 --ball_x;
                 --ball_y;
         }    
              
    } else if (dir == 2 && ball_x > 5 && ball_y < 475){

         if( ball_x == p1_x + 15 && ball_y >= p1_y && ball_y <= p1_y + 60){
                  dir = rand()% 2 + 3;
         }else{    
                 --ball_x;
                 ++ball_y;
         }

    } else if (dir == 3 && ball_x < 635 && ball_y > 5){

         if( ball_x + 5 == p2_x && ball_y >= p2_y && ball_y <= p2_y + 60){
                  dir = rand()% 2 + 1;
         }else{    
                 ++ball_x;
                 --ball_y;
         }

    } else if (dir == 4 && ball_x < 635 && ball_y < 475){

         if( ball_x + 5 == p2_x && ball_y >= p2_y && ball_y <= p2_y + 60){
                  dir = rand()% 2 + 1;
         }else{    
                 ++ball_x;
                 ++ball_y;
         }

    } else { 

        if (dir == 1 || dir == 3)    ++dir;
        else if (dir == 2 || dir == 4)    --dir;

    }    
    
    acquire_screen();
    circlefill ( buffer, ball_tempX, ball_tempY, 5, makecol( 0, 0, 0));
    circlefill ( buffer, ball_x, ball_y, 5, makecol( 128, 255, 0));
    draw_sprite( screen, buffer, 0, 0);
    release_screen();
    
    rest(5);

}    
开发者ID:mirgee,项目名称:exercises,代码行数:57,代码来源:pong.cpp

示例5: draw_road

void draw_road( BITMAP *targ, BITMAP *blankMap, int x1, int y1, int x2, int y2 ) 
{
	int x[4], y[4];
	float c[4];

	float xx = (x2-x1);
	float yy = (y2-y1);

	// bezier control points
	x[0] = x1; y[0] = y1;
	x[1] = x1 + xx*0.25; y[1] = y1 + yy*0.25;
	x[2] = x1 + xx*0.75; y[2] = y1 + yy*0.75;
	x[3] = x2; y[3] = y2;

	// jitter the middle points
	int jitterAmt = 50;
	x[1] += random( -jitterAmt, jitterAmt ); y[1] += random( -jitterAmt, jitterAmt );
	x[2] += random( -jitterAmt, jitterAmt ); y[2] += random( -jitterAmt, jitterAmt );

	//circlefill( targ, x[1], y[1], 5, makecol( 0, 255, 255 ) );
	//circlefill( targ, x[2], y[2], 5, makecol( 0, 255, 255 ) );



	// draw the curve
	// c(t) = p0 * (1-t)^3  + p1*3*t*(1-t)^2 + p2*3*t^2*(1-t) + p3*t^3
	float steps = sqrt( xx*xx + yy*yy ) / 2.0;
	int lastx = x1, lasty = y1;
	float xt, yt;
	for (int pass=0; pass <2; pass++) {
		for (float t=0.0; t < 1.0; t += (1.0/steps) ) {
			c[0] = pow( (1.0-t), 3.0 );
			c[1] = 3.0*t*pow( (1.0-t), 2.0 );
			c[2] = 3.0*pow(t, 2.0)*(1.0-t);
			c[3] = pow( t, 3.0 );

			xt = x[0]*c[0] + x[1]*c[1] + x[2]*c[2] + x[3]*c[3];
			yt = y[0]*c[0] + y[1]*c[1] + y[2]*c[2] + y[3]*c[3];

			//line( targ, lastx, lasty, (int)xt, (int)yt, makecol( 0, 255, 255 ) );

			if (pass==0) {
				circlefill( targ, (int)xt, int(yt), 4+random(2), makecol( 115, 41, 2 ) );		
			} else {
				circlefill( targ, (int)xt, int(yt), 2+random(2), 
					getpixel( blankMap, (int)xt, (int)yt ) );
			}

			lastx = (int)xt; lasty = (int)yt;
		}
	}



}
开发者ID:bradparks,项目名称:ld48jovoc_food_fight_3d_luxe,代码行数:55,代码来源:map.cpp

示例6: rectfill

void Editor::draw()
{
  // Background
  rectfill(buffer, 0, 0, SCREEN_W, SCREEN_H, makecol(255,255,255));

  if( saving){
    //Create gui
    textprintf_centre_ex(buffer,font,640,310, makecol(0,0,0),-1,"Save Map Name");

    //Input rectangle
    rectfill(buffer, 400, 408, 892, 452, makecol(0,0,0));
    rectfill(buffer, 402, 410, 890, 450, makecol(255,255,255));

    // Output the string to the screen
    textout_ex(buffer, font, edittext.c_str(), 410, 410, makecol(0,0,0), -1);

    // Draw the caret
    vline(buffer, text_length(font, edittext.c_str()) + 410 - text_length(font, ".txt") , 412, 448, makecol(0,0,0));
  }
  else if( opening){
    //Create gui
    textprintf_centre_ex(buffer,font,640,310, makecol(0,0,0),-1,"Open Map Name");

    //Input rectangle
    rectfill(buffer, 400, 408, 892, 452, makecol(0,0,0));
    rectfill(buffer, 402, 410, 890, 450, makecol(255,255,255));

    // Output the string to the screen
    textout_ex(buffer, font, edittext.c_str(), 410, 410, makecol(0,0,0), -1);

    // Draw the caret
    vline(buffer, text_length(font, edittext.c_str()) + 410 - text_length(font, ".txt") , 412, 448, makecol(0,0,0));
  }
  else{
    // Draw tiles
    tile_map -> draw_map( buffer);
    exampleTile -> draw_tile( buffer, 0, 0, 0);

    // Map info
    textprintf_ex(buffer,font,0,80,makecol(255,255,255),makecol(0,0,0),"height-%i width-%i", tile_map -> height, tile_map -> width);

    if(layer == 1){
      textprintf_ex(buffer,font,0,130,makecol(255,255,255),makecol(0,0,0),"Editing Mode: Foreground");
    }
    else if(layer == 0){
      textprintf_ex(buffer,font,0,130,makecol(255,255,255),makecol(0,0,0),"Editing Mode: Background");
    }

    // Cursor
    circlefill(buffer, mouse_x , mouse_y , 10, makecol(0,0,0));
    circlefill(buffer, mouse_x , mouse_y, 8, makecol(255,255,255));
  }
  // Draw buffer
  stretch_sprite( screen, buffer, 0, 0, SCREEN_W, SCREEN_H);
}
开发者ID:alegemaate,项目名称:TileEngine,代码行数:55,代码来源:Editor.cpp

示例7: explosion2

void explosion2(BITMAP *bmp, int x,int y,int finalcolor)
{
     int color,size;
     for (n=0; n<20; n++)
     {
                color = makecol(rand()%255,rand()%255,rand()%255);
                size = 20+rand()%20;
                circlefill(bmp, x, y, 350, color);
                rest(2);
     }
     circlefill(bmp, x, y, 350, finalcolor);
}
开发者ID:sanchit234,项目名称:GamePack,代码行数:12,代码来源:savecity.c

示例8: bubbles

void bubbles()
{
     int r, c, b;
     int size;
     int centerx, centery;
     int outradius, inradius, midradius;
     int bubblesx, bubblesy; /* number of bubbles in a row or column */
     int numbubbles;

     clear_invert_map();

     /*
     * outer is the main bubble
     * inner is the black dot in the bubble
     * what's the middle??
     */

     size = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height);
     outradius = rand_num(size/3, size);
     inradius  = rand_num(outradius/1.5, outradius*(7.0/8.0));
     midradius = (outradius + inradius) / 2;

     midradius = (midradius == 0 ? 1 : midradius);


     bubblesx = map.sec_width  / midradius;
     bubblesy = map.sec_height / midradius;
     numbubbles = (bubblesx * bubblesy);

     numbubbles = (numbubbles == 0 ? 1 : numbubbles);


     for( r = 0; r < map.num_row; r++ )
     {
          for( c = 0; c < map.num_col; c++ )
          {
               for( b = 0; b < numbubbles; b++ )
               {
                    rand_point_section_offset(&centerx, &centery, r, c, 0);

                    /*
                    *centerx *= (centerx / bubblesx);
                    *centery *= (centery / bubblesy);
                    */

                    circlefill(map.map, centerx, centery, outradius, 255);
                    circlefill(map.map, centerx, centery, inradius, 0);
               }
          } /* for(c..) */
     } /* for(r..) */

return;
}
开发者ID:david-redick,项目名称:lwmapgen,代码行数:53,代码来源:bubbles.c

示例9: getx

void Explosion::draw(const GraphicsContext &gc)
{
	int x = getx() - parent->getViewPort()->getx();
	int y = gety() - parent->getViewPort()->gety();

	drawing_mode (DRAW_MODE_TRANS, NULL, 0, 0);
	set_trans_blender (0, 0, 0, 128);

	circlefill (gc.buffer, x, y, size, RED);
	circlefill (gc.buffer, x, y, size * 2 / 3, YELLOW);

	drawing_mode (DRAW_MODE_SOLID, NULL, 0, 0);
}
开发者ID:GassaFM,项目名称:TINS-is-not-speedhack-2012,代码行数:13,代码来源:player.cpp

示例10: drawingThings

void drawingThings() {
    makeScreenBlack();

    // draw the bricks
    for(int i=0;i<BRICKS_VERTICALLY;i++) {
      for(int ii=0;ii<BRICKS_HORIZONTALLY;ii++) {
        if(bricks[i][ii] != 0) {
          rectfill(screenBuffer, 
            ii*BRICK_WIDTH, i*BRICK_HEIGHT, 
            (ii+1)*BRICK_WIDTH-BRICK_GAP, (i+1)*BRICK_HEIGHT-BRICK_GAP, 
            makecol(255, 0, 0));
        }
      }
    }

    // draw the player
    circlefill(screenBuffer, 
          ball.x, ball.y, 
          8, makecol(255, 255, 0));

    // draw the player
    rectfill(screenBuffer, 
          playerPaddleEdgeX, PADDLE_POSITION_Y, 
          playerPaddleEdgeX+PADDLE_WIDTH, 
          PADDLE_POSITION_Y+PADDLE_HEIGHT, makecol(255, 255, 255));
          
    textprintf_ex(screenBuffer, font, 10, 10, makecol(255, 255, 0),
                    -1, "Player Position (playerPaddleEdgeX is %i)", playerPaddleEdgeX);
    textprintf_ex(screenBuffer, font, 10, 20, makecol(255, 255, 255),
                    -1, "ball (x,y) position is (%i, %i)", ball.x, ball.y);

}
开发者ID:chasemc67,项目名称:Asteroids,代码行数:32,代码来源:main.cpp

示例11: getD

void Bola::desenhaBola(BITMAP *buffer){//, Ponto p){
	int r, g, b;
	int d = getD();
	Ponto p = getP();
	Cor_bola c = getCor();
	switch(c){
		case AMARELO:
			r = 255;
			g = 255;
			b = 0;
			break;
		case VERDE:
			r = 0;
			g = 255;
			b = 0;
			break;
		case AZUL:
			r = 0;
			g = 0;
			b = 255;
			break;
		default: // VERMELHO:
			r = 255;
			g = 0;
			b = 0;
			break;
	}
	circlefill(buffer, p.x, p.y, d/2, makecol(r, g, b));

}
开发者ID:amandapriscilla,项目名称:portfolio,代码行数:30,代码来源:Bola.cpp

示例12: switch

void Canhao::desenhaCanhao(BITMAP *buffer, bool podeRecarregar){
	if(!podeRecarregar) return;
	Cor_bola c = proxBola->getCor();
	int r, g, b;

	switch(c){
		case AMARELO:
			r = 255;
			g = 255;
			b = 0;
			break;
		case VERDE:
			r = 0;
			g = 255;
			b = 0;
			break;
		case AZUL:
			r = 0;
			g = 0;
			b = 255;
			break;
		case VERMELHO:
			r = 255;
			g = 0;
			b = 0;
			break;
		default:
			r = 0;
			g = 0;
			b = 0;
	}

	circlefill(buffer, proxBola->getP().x, proxBola->getP().y, proxBola->getD()/2, makecol(r, g, b));

}
开发者ID:amandapriscilla,项目名称:portfolio,代码行数:35,代码来源:Canhao.cpp

示例13: draw_bloodpools

void draw_bloodpools(void)
{
	int i;
	float j;
	float dec;
	float alpha;
	float temp;

	for(i=0;i<BLOODPOOL_NUM;i++)
		if(bloodpool[i].used)
			if(object_is_in_player_los(bloodpool[i].x-bloodpool[i].size, bloodpool[i].y-bloodpool[i].size, bloodpool[i].size*2,bloodpool[i].size*2,0,0))
			{
				temp = bloodpool[i].size*0.5;
				
				circlefill(virt, bloodpool[i].x-map_x, bloodpool[i].y-map_y, temp*2, bloodpool[i].color );

				dec = (255)/(bloodpool[i].size*0.5);
				alpha = 255;

			 
				drawing_mode(DRAW_MODE_TRANS,NULL,0,0);
				for(j=temp;j<bloodpool[i].size;j+=1)
				{
					set_trans_blender(0,0,0,(int)alpha);
					circle(virt, bloodpool[i].x-map_x, bloodpool[i].y-map_y, temp+j, bloodpool[i].color);
					alpha-=dec;
					if(alpha<0)alpha=0;
				}
				drawing_mode(DRAW_MODE_SOLID,NULL,0,0);
			}
}
开发者ID:arvidfm,项目名称:fiend,代码行数:31,代码来源:misc.c

示例14: main

int main(void)
{
    BITMAP *tmp;

    allegro_init();
    install_keyboard();

    set_color_depth(32);
    set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);

    /* set up a temp bitmap to so we can fade back later */
    if (!(tmp = create_bitmap(SCREEN_W, SCREEN_H))) exit(1);
    
    /* create a test screen */
    rectfill(screen, 0,0, SCREEN_W,SCREEN_H, makecol(255,255,255));
    circlefill(screen, 75,75, 25, makecol(255,0,0));

    /* save this test screen so we can fade_in to it later */
    blit(screen, tmp, 0,0, 0,0, SCREEN_W, SCREEN_H);
    readkey();
    
    highcolor_fade_out(16);
    readkey();

    highcolor_fade_in(tmp, 16);
    readkey();

    destroy_bitmap(tmp);
    return 0;
}
开发者ID:ftuyama,项目名称:RPG-Game,代码行数:30,代码来源:Fade_effect.c

示例15: main

int main(){
    
    declarevalues();
 
 
    allegro_init();
    install_keyboard();
    install_mouse();
    set_color_depth(32);
    set_gfx_mode(GFX_AUTODETECT_WINDOWED, Screen.getwidth(), Screen.getheight(), 0, 0);
    
    buffer = create_bitmap(Screen.getwidth(), Screen.getheight());


Loadproperties();


while (!key[KEY_ESC]) // Here is the game loop.
{

    declarearray();
    create_world();
     
     
     circlefill(buffer, mouse_x, mouse_y, 5, makecol(255, 0, 0));
    
    
        textprintf_ex(buffer, font, 10, 10, makecol(255, 100, 200), -1, "%s", testchar.testname.c_str() );
        
               
    blit(buffer, screen, 0, 0, 0, 0, Screen.getwidth(), Screen.getheight());
    clear_bitmap(buffer);
}   
    return 0;   
}   
开发者ID:itgsod-erik-rosto,项目名称:rpg_game,代码行数:35,代码来源:main.cpp


注:本文中的circlefill函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。