Ejemplo n.º 1
0
void drawNumberGraph(int number ,int x, int y, int size_x, int size_y , int order ,void* DBuf) 
{
	int i, n;
	int draw_x;
	int id[10] = {	AG_CG_SCORE_NUMBER_0, 
					AG_CG_SCORE_NUMBER_1, 
					AG_CG_SCORE_NUMBER_2,
					AG_CG_SCORE_NUMBER_3,
					AG_CG_SCORE_NUMBER_4,
					AG_CG_SCORE_NUMBER_5,
					AG_CG_SCORE_NUMBER_6,
					AG_CG_SCORE_NUMBER_7,
					AG_CG_SCORE_NUMBER_8,
					AG_CG_SCORE_NUMBER_9 };
					
	draw_x = x + (order-1)*size_x;

	for(i=0;i<order;i++) {
		n = number%10;
		agDrawSETFCOLOR( (AGDrawBuffer *)DBuf, ARGB( 255, 255, 0, 0 ) );
		ageTransferAAC( (AGDrawBuffer *)DBuf, id[n], 0, NULL, NULL );
		agDrawSETDBMODE( (AGDrawBuffer *)DBuf, 0xff, 0, 2, 1 );
		agDrawSPRITE( (AGDrawBuffer *)DBuf, 1, draw_x, y, draw_x+size_x, y+size_y );
		number /= 10;
		draw_x -= size_x;
	}
}
Ejemplo n.º 2
0
static s32 DrawCrow( struct TaskData* pTask , AGDrawBuffer* pDBuf ) {
	const float offsetRatioX = 0.3f;
	const float offsetRatioY = 0.2f;
	int bw, bh, lw, lh, wofx, wofy;
	int a = 255;
	agPictureSetBlendMode( pDBuf , 0 , a , 0 , 0 , 2 , 1 );
	if( pTask->Data.crow.mode == 0 ) {
		//体
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_BODY1, 0, &bw, &bh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - bw/2)<<2 , (pTask->y-g_OffsetY - bh/2)<<2 , (pTask->x - g_OffsetX + bw/2)<<2, (pTask->y-g_OffsetY+bh/2)<<2 );
		//左翼
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_L1, 0, &lw, &lh );
		wofx = (int)(bw*offsetRatioX);
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX + wofx)<<2 , (pTask->y-g_OffsetY - lh)<<2 , (pTask->x - g_OffsetX + wofx + lw)<<2, (pTask->y-g_OffsetY)<<2 );
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_R1, 0, &lw, &lh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - wofx - lw)<<2 , (pTask->y-g_OffsetY - lh)<<2 , (pTask->x - g_OffsetX - wofx)<<2, (pTask->y-g_OffsetY)<<2 );
	}
	else if( pTask->Data.crow.mode == 1 ) {
		//体
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_BODY2, 0, &bw, &bh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - bw/2)<<2 , (pTask->y-g_OffsetY - bh/2)<<2 , (pTask->x - g_OffsetX + bw/2)<<2, (pTask->y-g_OffsetY+bh/2)<<2 );
		//左翼
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_L2, 0, &lw, &lh );
		wofx = (int)(bw*offsetRatioX);
		wofy = (int)(bh*offsetRatioY);
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX + wofx)<<2 , (pTask->y-g_OffsetY +wofy -lh/2)<<2 , (pTask->x - g_OffsetX + wofx + lw)<<2, (pTask->y-g_OffsetY + wofy +lh/2)<<2 );
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_R2, 0, &lw, &lh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - wofx - lw)<<2 , (pTask->y-g_OffsetY +wofy -lh/2)<<2 , (pTask->x - g_OffsetX - wofx)<<2, (pTask->y-g_OffsetY + wofy +lh/2)<<2 );
	}
	else {
		//体
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_BODY3, 0, &bw, &bh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - bw/2)<<2 , (pTask->y-g_OffsetY - bh/2)<<2 , (pTask->x - g_OffsetX + bw/2)<<2, (pTask->y-g_OffsetY+bh/2)<<2 );
		//左翼
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_L3, 0, &lw, &lh );
		wofx = (int)(bw*offsetRatioX);
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX + wofx)<<2 , (pTask->y-g_OffsetY-lh/2)<<2 , (pTask->x - g_OffsetX + wofx + lw)<<2, (pTask->y-g_OffsetY+lh/2)<<2 );
		ageTransferAAC( pDBuf, AG_CG_OBJ_CROW_WING_R3, 0, &lw, &lh );
		agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - wofx - lw)<<2 , (pTask->y-g_OffsetY-lh/2)<<2 , (pTask->x - g_OffsetX - wofx)<<2, (pTask->y-g_OffsetY+lh/2)<<2 );
	};

}
Ejemplo n.º 3
0
static s32 DrawCannon( struct TaskData* pTask , AGDrawBuffer* pDBuf ) {
  int w,h;
  u8 flip = 0;

  if( pTask->Data.frog.direction == 1 ) {
    flip = 1;
  };

  if( (pTask->x + 100) > g_OffsetX && (pTask->x - 100) < (g_OffsetX + 1024) ) {
    agPictureSetBlendMode( pDBuf , 0 , 0xff , 0 , 0 , 2 , 1 );
    ageTransferAAC( pDBuf, AG_CG_OBJ_CANNON, 0, &w, &h );

    if( flip == 0 ) {
      agDrawSPRITE( pDBuf, 1, (pTask->x - g_OffsetX - w/2)<<2 , (pTask->y-g_OffsetY - h)<<2 , (pTask->x - g_OffsetX + w/2)<<2, (pTask->y-g_OffsetY)<<2 );
    }
    else {
      agDrawSPRITE_UV( pDBuf, (pTask->x - g_OffsetX - w/2)<<2 , (pTask->y-g_OffsetY - h)<<2 , 0x1000 , 0 , (pTask->x - g_OffsetX + w/2)<<2, (pTask->y-g_OffsetY)<<2 , 0 , 0x1000 );
    };
  };
}