Beispiel #1
0
void draw_map()
{    
	blit(level_bg, backbuffer, (int)(mapx*0.6f)%level_bg->w/2,(int)(mapy*0.6f)%level_bg->h/2, 0,0, SCREEN_W,SCREEN_H);

	// Draw some nice dropshadows on the level :)
	masked_blit(level_shadow, backbuffer, mapx-shadow_dist,mapy-shadow_dist, 0,0, SCREEN_W,SCREEN_H);

	masked_blit(level, backbuffer, mapx,mapy, 0,0, SCREEN_W,SCREEN_H);


	/*
	int tile_size=24;
	for(int y=0; y < level->h/tile_size; y++)
	{
		for(int x=0; x < level->w/tile_size; x++)
		{
			int c1 = getpixel(level,x*tile_size+(tile_size/2),y*tile_size+(tile_size/2)) == makecol(255,0,255);
			int c2 = getpixel(level,x*tile_size,y*tile_size) == makecol(255,0,255);
			int c3 = getpixel(level,x*tile_size+(tile_size),y*tile_size) == makecol(255,0,255);
			int c4 = getpixel(level,x*tile_size+(tile_size),y*tile_size+(tile_size)) == makecol(255,0,255);
			int c5 = getpixel(level,x*tile_size,y*tile_size+(tile_size)) == makecol(255,0,255);
			int sum = c1+c2+c3+c4+c5;
			if(sum >= 3)
			{
//				rect(backbuffer, x*tile_size-mapx,y*tile_size-mapy, x*tile_size+tile_size-mapx,y*tile_size+tile_size-mapy, makecol(0,255,0));
			}
			else
			{
				rect(backbuffer, x*tile_size-mapx,y*tile_size-mapy, x*tile_size+tile_size-mapx,y*tile_size+tile_size-mapy, makecol(0,255,0));
//				rectfill(backbuffer, x*tile_size-mapx,y*tile_size-mapy, x*tile_size+tile_size-mapx,y*tile_size+tile_size-mapy, makecol(0,255,0));
			}
		}
	}
	*/
}
void Baklava::Draw( BITMAP * baklSpr, BITMAP * buffer )
{

	switch( id )
	{

		case 0:
			masked_blit( baklSpr, buffer, 58, 40, x, y, 20, 16 );
			break;
		case 1:
			masked_blit( baklSpr, buffer, 106, 32, x, y, 29, 24 );
			break;
		case 2:
			masked_blit( baklSpr, buffer, 106, 0, x, y, 40, 32 );
			break;
		case 3:
			masked_blit( baklSpr, buffer, 58, 0, x, y, 47, 40 );
			break;
		case 4:
			masked_blit( baklSpr, buffer, 0, 0, x, y, 56, 48 );
			break;
		default:
			break;

	}

}
void renderDMXCombo(int combo, int time, int centerX, int color)
{
	int numDigits = 1, frame = 0, flash = 0;

	if ( combo < 5 ) // DMX starts at 5
	{
		return;
	}
	if ( combo > 9999 )
	{
		combo = 9999;
	}

	// this is for the white flash animation
	flash = time >= 100 ? 5 : time/25;
	//color = (combo/100) % 5;
	frame = flash < 5 ? 4 + flash : color; // frames 5-8 are for the white combo flash, fromes 0-4 are the colored combos

	// how many digits to render? Note: the official game renders combos starting at 004
	if ( combo >= 1000 )
	{
		numDigits = 4;
	}
	else if ( combo >= 100 )
	{
		numDigits = 3;
	}
	else if ( combo >= 10 )
	{
		numDigits = 2;
	}

	// center the word "combo" above the number
	if ( time >= JUDGEMENT_DISPLAY_TIME )
	{
		masked_blit(m_comboDMX, rm.m_backbuf, 0, 0, centerX-48, DMX_COMBO_Y-26, 96, 24);
	}

	// combo "FEVER" displays every 2 seconds is when combo >= 1000
	if ( combo >= 1000 && (totalGameTime / 2000) % 2 == 0 )
	{
		masked_blit(m_dmxFevers[frame], rm.m_backbuf, 0, 0, centerX-92, DMX_COMBO_Y, 184, 54);
	}
	else
	{
		int x = centerX + (64*numDigits)/2 - 64;
		for ( int i = 0, tens = 1; i < numDigits; i++, tens *= 10 )
		{
			int num = (combo/tens) % 10;
			ASSERT(num < 10);
			int sourcex = (num / 2) * 64;
			int sourcey = (num % 2) * 64;
			ASSERT(sourcex < 320 && sourcey < 128);
			masked_blit(m_dmxCombos[frame], rm.m_backbuf, sourcex, sourcey, x - (i*64), DMX_COMBO_Y, 64, 64);
		}
	}
}
void renderOverFrameDMX()
{
	if ( !gs.isVersus )
	{
		masked_blit(m_rightLifeGaugeCover, rm.m_backbuf, 0, 0, 404, 14, 176, 32);
	}
	masked_blit(m_dmxHeader, rm.m_backbuf, 0, 0, 0, 0, 640, 64);
	masked_blit(m_dmxFooter, rm.m_backbuf, 0, 0, 0, 416, 640, 64);
}							 
Beispiel #5
0
void MatrixIcons::subanimate()
{
	STACKTRACE;

	int i, j;
	int ix, iy;

	for (iy = scroll.y; iy < scroll.y + Nyshow && iy < Ny; ++iy ) {

		for (ix = scroll.x; ix < scroll.x + Nxshow && ix < Nx; ++ix ) {

			int xoverlay, yoverlay;
			int xicon, yicon, k;

			k = iy*Nx + ix;

			if (k >= maxitems)	 // if you've run out of bitmaps that you can plot...
				break;

			xoverlay = (ix - scroll.x) * Wicon;
			yoverlay = (iy - scroll.y) * Hicon;

			int w0, h0;
			w0 = iround(listIcon[k]->w * mainwindow->scale * extrascale);
			h0 = iround(listIcon[k]->h * mainwindow->scale * extrascale);

			// create a intermediate icon
			xicon =  (Wicon - w0) / 2;
			yicon =  (Hicon - h0) / 2;

			clear_to_color(tmp, makecol(255,0,255));

			if (listIcon[k] && (itemproperty[k] & ENABLE) ) {

				masked_stretch_blit(listIcon[k], tmp,
					0, 0, listIcon[k]->w, listIcon[k]->h,
					xicon, yicon, w0, h0 );
			}

			masked_blit(overlay, tmp, 0, 0, 0, 0, overlay->w, overlay->h );

			// blit the combined image onto the panel area
			masked_blit(tmp, drawarea, 0, 0, xoverlay, yoverlay, overlay->w, overlay->h );
		}
	}

	// one of them is highlighted ... the one which the mouse is pointed at: draw
	// a box around it ?
								 //mx / Wicon;
	i = scroll.xselect - scroll.x;
								 //my / Hicon;
	j = scroll.yselect - scroll.y;
	double a;
	//a = 0.5 + 0.5 * sin(areareserve->menu_time * 1E-3 * 2*PI / 10);
	a = 0.5;
	rect(drawarea, i*Wicon, j*Hicon, (i+1)*Wicon-1, (j+1)*Hicon-1, makecol(20*a,100*a,200*a));
}
Beispiel #6
0
void ScrollBar::subanimate()
{
	STACKTRACE;
	AreaTablet::subanimate();

	if (direction == ver)
		masked_blit(button, drawarea, 0, 0, iround(size.x/2 - bwhalf), iround(pbutton-bhhalf), iround(button->w), iround(button->h));
	else
		masked_blit(button, drawarea, 0, 0, iround(pbutton-bwhalf), iround(size.y/2 - bhhalf), button->w, button->h);
}
Beispiel #7
0
void draw_crusher(BITMAP *bmp)
{
  static fixed angle = 0;
  int x, y, x1, y1, x2, y2;

  x = crusher.x+crusher.w/2-get_bitmap(BMP_CRUSHER)->w/2;
  y = crusher.y+crusher.h/2-get_bitmap(BMP_CRUSHER)->h/2+8;

  /* crusher body */
  draw_sprite(bmp, get_bitmap(BMP_CRUSHER), x, y);

  /* crusher motor */
  draw_sprite(bmp, get_bitmap(BMP_CRUSHER_MOTOR),
    x1 = x-get_bitmap(BMP_CRUSHER_MOTOR)->w+1+rand()%3-1,
    y1 = y+rand()%3-1);

  /* crusher pulley */
  rotate_sprite(bmp, get_bitmap(BMP_CRUSHER_PULLEY),
    x2 = x+17-get_bitmap(BMP_CRUSHER_PULLEY)->w/2+rand()%3-1,
    y2 = y+13-get_bitmap(BMP_CRUSHER_PULLEY)->h/2+rand()%3-1,
    angle);

  /* strap */
  do_line(bmp, x1+12, y1+8,
    x2+get_bitmap(BMP_CRUSHER_PULLEY)->w/2-1, y2,
    makecol(0, 0, 0), strap_proc);

  do_line(bmp, x1+12, y1+18,
    x2+get_bitmap(BMP_CRUSHER_PULLEY)->w/2-1,
    y2+get_bitmap(BMP_CRUSHER_PULLEY)->h-1,
    makecol(0, 0, 0), strap_proc);

  angle = fadd(angle, itofix(16));
  if (angle > itofix(256))
    angle = fsub(angle, itofix(256));

  /* scorer */
  draw_sprite(bmp, get_bitmap(BMP_SCORER),
    x+get_bitmap(BMP_CRUSHER)->w,
    y+get_bitmap(BMP_CRUSHER)->h-get_bitmap(BMP_SCORER)->h);

  /* alarm */
  if (alarm_time_blue >= 0) {
    masked_blit(get_bitmap(BMP_SCORER_ALARM), bmp, 0, 0,
      x+get_bitmap(BMP_CRUSHER)->w+63,
      y+get_bitmap(BMP_CRUSHER)->h-get_bitmap(BMP_SCORER)->h+27, 8, 9);
  }

  if (alarm_time_red >= 0) {
    masked_blit(get_bitmap(BMP_SCORER_ALARM), bmp,
      get_bitmap(BMP_SCORER_ALARM)->w-8, 0,
      x+get_bitmap(BMP_CRUSHER)->w+75,
      y+get_bitmap(BMP_CRUSHER)->h-get_bitmap(BMP_SCORER)->h+27, 8, 9);
  }
}
void Basic_char::Draw( DATAFILE * sprites, BITMAP * buffer  )
{

    if ( alive )
    {
    circlefill( buffer, x, y, 32+bubbles_collected*10, circle_color ); // DRAW THE FILLED CIRCLE
	masked_blit( (BITMAP*)sprites[1].dat, buffer, 0, 0, x - 24, 700 - 8, 48, 16); // DRAW SHADOW
    circle( buffer, x, y, 32+bubbles_collected*10, makecol( 64, 186, 217 ) ); // DRAW THE OUTLINE
    masked_blit( (BITMAP*)sprites[0].dat, buffer, (int)anim_frame*64, is_breathing*64, x-32, y-32, 64, 64 ); // DRAW THE FACE
    }
}
Beispiel #9
0
void draw_bg(BITMAP *bmp, BITMAP *bg, int x, int y)
{
  if (x < 0) {
    do {
      x += bg->w;
    } while (x < 0);
    x -= bg->w;
  }
  masked_blit(bg, bmp, 0, 0, x, y, bg->w, bg->h);

  x += bg->w;
  masked_blit(bg, bmp, 0, 0, x, y, bg->w, bg->h);
}
void renderUnderFrameDMX()
{
	if ( !gs.isVersus )
	{
		int blink = gs.player[0].stepZoneBlinkTimer > 0 ? 0 : 1;
		int lv = blink ? gs.player[0].stagesLevels[gs.currentStage] % DOUBLE_MILD : 3;
		masked_blit(m_leftSideHalo[lv][0], rm.m_backbuf, 0, 0, 0, 12, 320, 64); // for singles and doubles, join the two halves of the halo together
		masked_blit(m_rightSideHalo[lv][0], rm.m_backbuf, 0, 0, 320, 12, 320, 64);

		masked_blit(m_leftSideHalo[lv][1], rm.m_backbuf, 0, 0, 0, 402, 320, 48); // the bottom halo
		masked_blit(m_rightSideHalo[lv][1], rm.m_backbuf, 0, 0, 320, 402, 320, 48);
	}
	else
	{
		int blink = gs.player[0].stepZoneBlinkTimer > 0 ? 0 : 1;
		int lvl = blink ? gs.player[0].stagesLevels[gs.currentStage] % DOUBLE_MILD : 3;
		blink = gs.player[1].stepZoneBlinkTimer > 0 ? 0 : 1; // probably useless
		int lvr = blink ? gs.player[1].stagesLevels[gs.currentStage] % DOUBLE_MILD : 3;
		masked_blit(m_leftSideHalo[lvl][0], rm.m_backbuf, 0, 0, 0, 12, 320, 64); // 1P is the left half, 2P colors the right half
		masked_blit(m_rightSideHalo[lvr][0], rm.m_backbuf, 0, 0, 320, 12, 320, 64);

		masked_blit(m_leftSideHalo[lvl][1], rm.m_backbuf, 0, 0, 0, 402, 320, 48);
		masked_blit(m_rightSideHalo[lvr][1], rm.m_backbuf, 0, 0, 320, 402, 320, 48);
	}
}
/*
Nom : storm
Entrées :
Sorties :
Date de dernière modification : 27/04
Nature de la dernière modification :réimplantation
Version : 2.0
*/
int storm(BITMAP* img[BMP_NB],t_hero tab[MAX_HERO],t_game* level, int x, int y, int i, int nb,SAMPLE* son[SON_NB])
{
	int jaune = makecol(255,255,0); //souffle
	int distx = tab[i].p4x - x;
	int disty = tab[i].p4y - y;
	distx = abs(distx);
	disty = abs(disty);

	int spacefor9 = distx / 9;

	int anim_here = 26;
	int anim_max_here = 4;
    int max_here = 38;
	//anim strom
	if (anim_here + nb < anim_here + anim_max_here)
	{
	    sound(son,level,4);
		if (x > tab[i].x) masked_blit(img[anim_here+nb], img[7], 0,0, tab[i].x, tab[i].y, img[anim_here+nb]->w, img[anim_here+nb]->h);
		else draw_sprite_h_flip(img[7], img[anim_here+nb], tab[i].x, tab[i].y);
		tab[i].save = tab[i].x;
	}
	//for anim souffle
	if (anim_here + nb >= anim_here + anim_max_here)
	{
        if (x > tab[i].save) masked_blit(img[29], img[7], 0,0, tab[i].save, tab[i].y, img[29]->w, img[29]->h);
		else draw_sprite_h_flip(img[7], img[29], tab[i].save, tab[i].y);

		if ( x > tab[i].x )
		{
			masked_blit(img[anim_here+nb], img[7],0,0, tab[i].next_pouv_x, tab[i].y, img[anim_here+nb]->w, img[anim_here+nb]->h);
			tab[i].next_pouv_x = tab[i].next_pouv_x + spacefor9;
		}
		else
		{
			draw_sprite_h_flip(img[7], img[anim_here+nb], tab[i].next_pouv_x, tab[i].y);
			tab[i].next_pouv_x = tab[i].next_pouv_x - spacefor9;
		}
	}
	//mettage du fond jaune de souffle et de la bitmap indiquant le souffle
	//masked_stretch_blit(img[30],img[7], tab[i].x + TX, tab[i].y, img[30]->w, img[30]->h, x, y + TY, distx, img[i]->h ); //ATTENTION NE PREND EN COMPTE QUE LE CAS HORIZONTAL
	if (anim_here + nb == max_here)
		{
			pivot_scaled_sprite(img[7], img[39], tab[i].x + TX, tab[i].y, 35, 22, itofix( (tab[i].direction == 'D' ?  0 : 128) + (int)(atan2(tab[i].y - y,tab[i].x - x)*256)/(2*M_PI)), ftofix(sqrt( pow(x - tab[i].x, 2) +  pow(y - tab[i].y, 2) ) / img[46]->w));
            pivot_scaled_sprite(level->fore, img[39], tab[i].x + TX, tab[i].y, 35, 22, itofix( (tab[i].direction == 'D' ?  0 : 128) + (int)(atan2(tab[i].y - y,tab[i].x - x)*256)/(2*M_PI)), ftofix(sqrt( pow(x - tab[i].x, 2) +  pow(y - tab[i].y, 2) ) / img[46]->w));
			tab[i].transformation = 2;
			rectfill(level->collision, tab[i].x + TX, tab[i].y, x, y + TY, jaune );
			return 0;
		}
    return 1;
}
Beispiel #12
0
//draw normally
void sprite::drawframe(BITMAP *dest)  {
    if (!this->image) return;

    int fx = this->animstartx + (this->curframe % this->animcolumns) * this->width;
    int fy = this->animstarty + (this->curframe / this->animcolumns) * this->height;
    masked_blit(this->image, dest, fx, fy, (int)this->x, (int)this->y, this->width, this->height);
}
Beispiel #13
0
void GLOBALDATA::replace_canvas ()
{

	for (int32_t i = 0; i < lastUpdatesCount; ++i) {
		if ((lastUpdates[i].y + lastUpdates[i].h) > MENUHEIGHT) {
			blit (env.sky, canvas, lastUpdates[i].x, lastUpdates[i].y - MENUHEIGHT,
			                       lastUpdates[i].x, lastUpdates[i].y,
			                       lastUpdates[i].w, lastUpdates[i].h);
			masked_blit (terrain, canvas, lastUpdates[i].x, lastUpdates[i].y,
			                              lastUpdates[i].x, lastUpdates[i].y,
			                              lastUpdates[i].w, lastUpdates[i].h);
		} // End of having an update below the top bar
	}

	int32_t l = 0;
	int32_t r = env.screenWidth - 1;
	int32_t t = MENUHEIGHT;
	int32_t b = env.screenHeight - 1;

	vline(canvas, l,     t, b, env.wallColour); // Left edge
	vline(canvas, l + 1, t, b, env.wallColour); // Left edge
	vline(canvas, r,     t, b, env.wallColour); // right edge
	vline(canvas, r - 1, t, b, env.wallColour); // right edge
	hline(canvas, l,     b, r, env.wallColour); // bottom edge
	if (env.isBoxed)
		hline(canvas, l, t, r, env.wallColour); // top edge

	lastUpdatesCount = 0;
}
Beispiel #14
0
void DrawBlock(int x, int y, Block* block, bool falling)
{
	if (block->type < 0)
		return;

	const int y_cutoff = PANEL_START_Y+(PANEL_HEIGHT*BLOCK_SIZE);

	int draw_height	= y_cutoff - y;
	if (draw_height > BLOCK_SIZE)
		draw_height = BLOCK_SIZE;

	if (draw_height <= 0)
		return;

	int color;

	BITMAP* bmp;

	if (falling)
		bmp = falling_block_bitmaps[block->type][falling_block_frame];
	else if (block->popping && (((unsigned)currentTimeMillis() % (POP_FLASH_TIME*2)) < POP_FLASH_TIME)) {
		bmp = popping_block_bitmaps[block->type];
	}
	else
		bmp = block_bitmaps[block->type];

	masked_blit(bmp, buffer, 0, 0, x, y, BLOCK_SIZE, draw_height);
}
void renderDDRArrow(int player, int column, int color, int judgement, int x, int y)
{
	static int columnSource[10] = { 0, 2, 3, 5, 0, 2, 3, 5, 1, 4 };
	BITMAP* source = m_arrowSource[0][0][0];

	if ( (judgement >= MARVELLOUS && judgement <= GREAT) || judgement == IGNORED )
	{
		return; // these arrows disappear once they reach the top or are hit
	}

	// freeze arrows (color 5, or melted = 8) are a little different than other arrows
	int frame = 0;
	if ( color == 5 || color == 8 )
	{
		frame = 0;
		source = m_arrowSource[columnSource[column]][frame][color];
	}
	// shock arrows (color 7) are mostly like other arrows
	else if ( color == 7 )
	{
		frame = (gs.player[player].stepZoneBeatTimer / 100) % 4;
		source = m_arrowSource[columnSource[column]][frame][7];
	}
	else
	{
		// calculate the length of a quarter beat, then set frame to a number 0-3
		frame = (gs.player[player].stepZoneBeatTimer / 100) % 4;
		source = m_arrowSource[columnSource[column]][frame][(color + gs.player[player].colorCycle)%4];
	}
	masked_blit(source, rm.m_backbuf, 0, 0, x, y, 64, 64);
}
Beispiel #16
0
void ft_form_draw_polygon(s_form *form, s_drawing *drawing)
{
    int i;
    s_vector *p1 = NULL, *p2 = NULL;
    int colorWanted = makecol(form->color.r, form->color.g, form->color.b);
    int colorAlpha = makecol(255, 0, 255);

    clear_to_color(drawing->g_page_tmp, colorWanted);

    for (i = 0; i < form->nb_point-1; ++i)
    {
        p1 = &form->point[i];
        p2 = &form->point[i+1];

        ft_allegro_line(drawing->g_page_tmp, drawing, p1->x, p1->y, p2->x, p2->y, colorAlpha, FLAG_SCALE_COORD);
    }

    /* closing line */
    p1 = &form->point[0];
    p2 = &form->point[form->nb_point-1];

    ft_allegro_line(drawing->g_page_tmp, drawing, p1->x, p1->y, p2->x, p2->y, colorAlpha, FLAG_SCALE_COORD);

    /* TODO : upgrade this dirty hack */
    floodfill(drawing->g_page_tmp, 0, 0, colorAlpha);
    floodfill(drawing->g_page_tmp, 0, SCREEN_HEIGHT-1, colorAlpha);
    floodfill(drawing->g_page_tmp, SCREEN_WIDTH-1, 0, colorAlpha);
    floodfill(drawing->g_page_tmp, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, colorAlpha);

    masked_blit(drawing->g_page_tmp, drawing->g_page, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}
Beispiel #17
0
void menu3_update()
{
  blit(court,screen_buffer,0,0,0,0,320,200);
  masked_blit(logo,screen_buffer,0,0,160 - logo->w / 2,10,logo->w,logo->h);

  put_text(screen_buffer,font,60,90,32,"PLAYER 1");
  put_text(screen_buffer,font,60,100,58,"HUMAN");
  put_text(screen_buffer,font,60,110,58,"COMPUTER");

  put_text_right(screen_buffer,font,260,90,32,"PLAYER 2");
  put_text_right(screen_buffer,font,260,100,58,"HUMAN");
  put_text_right(screen_buffer,font,260,110,58,"COMPUTER");

  switch(menu3_menu1_index)
  {
    case 0: put_text(screen_buffer,font,60,100,160,"HUMAN"); break;
    case 1: put_text(screen_buffer,font,60,110,160,"COMPUTER"); break;
  }

  switch(menu3_menu2_index)
  {
    case 0: put_text_right(screen_buffer,font,260,100,160,"HUMAN"); break;
    case 1: put_text_right(screen_buffer,font,260,110,160,"COMPUTER"); break;
  }

  draw_screen_buffer(screen_buffer);
}
Beispiel #18
0
void GuiMain::drawInterface(BITMAP *bmp) {

    // Simple draw method
    frame.drawFrames(bmp);

    short stat_x = TILESIZE*(editor.current_tile/TILESIZE);
    short stat_y = TILESIZE*(editor.current_tile%TILESIZE);

    rect (bmp, SCREEN_W-250, SCREEN_H-102, SCREEN_W-250+35, SCREEN_H-102+35, makecol(0,0,0));
    masked_blit((BITMAP*)editor.mapData[TILES1+editor.mouse_tileset].dat, bmp, stat_x, stat_y, SCREEN_W - 248, SCREEN_H - 100 ,TILESIZE,TILESIZE);

    /*
        textprintf_ex(bmp, font, SCREEN_W-210, SCREEN_H-102+5, makecol(0,0,0),-1, "Current tile: %d",editor.current_tile);
        textprintf_ex(bmp, font, SCREEN_W-210, SCREEN_H-102+20, makecol(0,0,0),-1, "Current tileset: %d",editor.mouse_tileset);

        stat_x = 8 + text_length(font, "Canvas. Stats: ");
        stat_y = 24;

        if (mouse_frame == TSET_FRAME) {
            textprintf_ex(bmp, font, stat_x, stat_y, makecol(255,255,255), -1, "Tileset frame: X %d | Y %d", gui_x, gui_y);
        } else if (mouse_frame == MINI_FRAME) {
            textprintf_ex(bmp, font, stat_x, stat_y, makecol(255,255,255), -1, "Minimap frame: X %d | Y %d", gui_x, gui_y);
        } else if (mouse_frame == MAIN_FRAME) {
            textprintf_ex(bmp, font, stat_x, stat_y, makecol(255,255,255), -1, "Canvas frame: Tile X %d | Tile Y %d", gui_x/32+editor.viewport.scroll_x, gui_y/32+editor.viewport.scroll_y);
        } else textprintf_ex(bmp, font, stat_x, stat_y, makecol(255,255,255), -1, "No frame");
    */
    minimap.drawMiniMap(bmp);

    button.drawButtons(bmp);
    label.drawLabels(bmp);
    field.drawFields(bmp);
    checkbox.drawCheckboxes(bmp);
}
Beispiel #19
0
	void tilemap::draw(const iq::uint i, const iq::BITMAP_ptr scrbuf, const iq::entity_ptr player) const
	{
		int map_x, map_y;
		iq::BITMAP_ptr bitmap;

		if(i >= this->layers.size())
		{
			throw std::runtime_error(
				"Invalid tilemap layer index '"
				+ boost::lexical_cast<std::string>(i)
				+ "'. Valid indexes are 0-"
				+ boost::lexical_cast<std::string>(this->layers.size()-1)
				+ ".");
		}

		map_y = iq::tilemap::screen_y(scrbuf, player);

		for(int y=0, ylen=this->layers[i].size(); y<ylen; y++)
		{
			map_x = iq::tilemap::screen_x(scrbuf, player);

			for(int x=0, xlen=this->layers[i][y].size(); x<xlen; x++)
			{
				bitmap = this->layers[i][y][x]->bitmap;
				masked_blit(bitmap.get(), scrbuf.get(), 0, 0, map_x + (x*this->tilesize), map_y + (y*this->tilesize), bitmap->w, bitmap->h);
			}
		}
	}
Beispiel #20
0
//DESENHA TUDO NO BUFFER
void desenhar_jogo(){
	int largura, altura, ax = 0, ay = 0;
	int bx = 0;
	int by = 0;
	
	switch(lugar){
		case 1:
			bx = 160;
			by = 160;
			largura = 480;
			altura = 325;
			break;
		case 2: //BOSQUE
			ax = desloca_mapa_x;
			ay = desloca_mapa_y;
			largura = 800;
			altura = 600;
			break;
		case 3: //BOSQUE2
			ax = desloca_mapa_x;
			ay = desloca_mapa_y;
			largura = 800;
			altura = 600;
			break;
		default:
			break;
	}
	
	blit(fundo, buffer, ax, ay, bx, by, 800, 600);
	jogadorr.desenha();
	masked_blit(alto, buffer, ax, ay, bx, by, 800, 600);
}
void drawEnemy(Enemy *enemy, BITMAP *buffer, BITMAP *auxiliar, unsigned int tick)
{
    if(enemy != NULL)
    {
        if(enemy->hp > 0)
        {
            masked_blit(enemy->sheet, buffer, ((int)(enemy->speed * tick)/(10) % 2) * TILE_SIZE, (enemy->orientation * TILE_SIZE),
                        (enemy->centre->x - TILE_SIZE/2), (enemy->centre->y - TILE_SIZE/1.5),
                        TILE_SIZE, TILE_SIZE);
        }

        else
        {
            set_trans_blender(255, 255, 255, enemy->blenderTax);
            blit(enemy->sheet, auxiliar, ((int)(enemy->speed * tick)/(10) % 2) * TILE_SIZE, (4 * TILE_SIZE),
                 0, 0, TILE_SIZE, TILE_SIZE);
            draw_trans_sprite(buffer, auxiliar, (enemy->centre->x - TILE_SIZE/2), (enemy->centre->y - TILE_SIZE/1.5));

            if(enemy->blenderTax > 0)
            {
                enemy->blenderTax--;
            }

        }
    }
}
Beispiel #22
0
void initialize_oneplayer_screen()
{
   clear(screen_buffer);
   clear(screen);
   for (int i=0;i< NR_OF_LAYERS;i++)
       playfield->draw(screen_buffer,i);
   if (screen_buffer->w == SCREEN_W)
   {
      blit(screen_buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H- 96);
   }
   else
   {
      stretch_blit(screen_buffer,screen,0,0, screen_buffer->w, screen_buffer->h,0,0,SCREEN_W,SCREEN_H- 96);
   }

   BITMAP *frame;
   for (int i=0; i<SCREEN_W;i+=640)
   {
      blit(board, screen, 0, 0 ,i , SCREEN_H - 96, 640, 96);
   }

   draw_rle_sprite(screen, (RLE_SPRITE *)(objects[GFXDATA_OBJECTS_GOUD].dat), 10, SCREEN_H - 86);
   draw_rle_sprite(screen, (RLE_SPRITE *)(objects[GFXDATA_OBJECTS_ENERG].dat),10, SCREEN_H - 44);
   draw_rle_sprite(screen, (RLE_SPRITE *)(objects[GFXDATA_OBJECTS_STER].dat),200, SCREEN_H - 86);
   draw_rle_sprite(screen, (RLE_SPRITE *)(objects[GFXDATA_OBJECTS_STUT].dat),200, SCREEN_H - 44);
   frame = create_sub_bitmap((BITMAP *)(anims[GFXDATA_ANIMS_MANS].dat), 0,0,32,32);
   masked_blit(frame,screen,0,0,400,SCREEN_H - 86,32,32);
   destroy_bitmap(frame);
   draw_rle_sprite(screen, (RLE_SPRITE *)(objects[GFXDATA_OBJECTS_HOUWEEL].dat),400, SCREEN_H - 44);
   
}
void renderDMXArrow(int player, int column, int color, int judgement, int x, int y)
{
	if ( (judgement >= MARVELLOUS && judgement <= GREAT) || judgement == IGNORED )
	{
		return; // these arrows disappear once they reach the top or are hit
	}
	if ( judgement == GOOD && (gs.player[player].danceManiaxMode || gs.player[player].drummaniaMode) )
	{
		return; // in these modes, goods also count as hit
	}

	// calculate the length of a quarter beat, then set frame to a number 0-7
	int frame = getValueFromRange(0, 7, (gs.player[player].stepZoneBeatTimer*100 / gs.player[player].stepZoneTimePerBeat));
	if ( gs.player[player].stepZoneBlinkTimer > 0 )
	{
		frame += 8;
	}
	int colColor = getColorOfColumn(column);
	if ( color == 2 )
	{
		colColor = 2; // make it gold, otherwise ignore this parameter
	}

	masked_blit(m_notesDMX[colColor], rm.m_backbuf, 0, frame*40, x, y, 40, 40);
	set_alpha_blender(); // the game assumes the graphics are left in this mode
}
Beispiel #24
0
/*
===========================================================================
DIN_Animate

Main routine for dev intro. loops through frames at a speed regulated by 
global ticker, for a predetermined time. 
==========================================================================
*/
void DIN_Animate( float xFactor , float yFactor  )
{
	int i=0;

	clear_to_color( pageOne , G_COLOR_WHITE );
	
	for( int cycleCount = 0;cycleCount < DEV_INTRO_LENGHT;cycleCount++ )
	{
		for( int frame = 0;frame < DEV_INTRO_FRAMES;frame++ )
		{			
			
			DIN_DrawBumpedFrame( frame , 0 , 0 );
			blit( devLightMap , pageOne , 0 , 0 , 0 , 0 , currentGame.gfxConfig.xDimen , currentGame.gfxConfig.yDimen );
			
			blit( devIntroFrames[ DEV_INTRO_BACKGROUND ] , pageOne ,  0 , 0 , 0 , 0 , currentGame.gfxConfig.xDimen , currentGame.gfxConfig.yDimen );
			
			masked_blit( devIntroFrames[ frame ] , pageOne ,  0 , 0 , 0 , 0 , currentGame.gfxConfig.xDimen , currentGame.gfxConfig.yDimen );
			blit( pageOne , screen , 0 , 0 , 0 , 0 , currentGame.gfxConfig.xDimen , currentGame.gfxConfig.yDimen );				 
			
			globalTickCount = 0;
			
			while( globalTickCount < DEV_INTRO_DELAY )
			{
				// wait for a bit.
			}

			clear_to_color( pageOne , G_COLOR_WHITE );
		}
	}
}
void renderNameLetter(char letter, int x, int y, int color)
{
	int row = 5, col = 10, pos = 65; // default to a space
	static char puncs[40] = "[]()<>0123456789+-*/=@:;`',.?!\"#%&^_ |~";

	if ( letter >= 'A' && letter <= 'Z' )
	{
		pos = letter - 'A';
	}
	else if ( letter >= 'a' && letter <= 'z' )
	{
		pos = letter - 'a';
	}
	else
	{
		for ( int i = 0; i < 39; i++ )
		{
			if ( letter == puncs[i] )
			{
				pos = i + 26;
				break;
			}
		}
	}
	col = pos/6;
	row = pos%6;

	masked_blit(rm.m_nameFont[color], rm.m_backbuf, 32*col, 32*row, x, y, 32, 32);
}
Beispiel #26
0
void Explosion::Draw()
{
  BITMAP *bm = sprite[frame_counter];
  masked_blit(bm,ScreenBuffer,0,0,x - bm->w / 2,y - bm->h / 2,bm->w,bm->h);
  frame_counter++;
  if(frame_counter > 7)
    done = true;
}
Beispiel #27
0
static inline void
masked_non_stretched_blit (BITMAP *s, BITMAP *d, int sx, int sy, int w, int h,
int dx, int dy, int _, int __)
{
	(void) _;
	(void) __;
	masked_blit (s, d, sx, sy, dx, dy, w, h);
}
/*
 * call-seq:
 *   masked_blit(source, dest, source_x, source_y, dest_x, dest_y, width, height) -> nil
 *
 * Like blit, but skips transparent pixels, which are marked by a zero in
 * 256-color modes or bright pink for truecolor data (maximum red and blue, zero
 * green), and requires the source and destination bitmaps to be of the same
 * color depth. The source and destination regions must not overlap. Example:
 *   # Paint hud overlay on the screen.
 *   masked_blit(hud_overlay, screen, 0, 0, 0, 0, hud_overlay.w, hud_overlay.h)
 *
 * If the GFX_HW_VRAM_BLIT_MASKED bit in the gfx_capabilities flag is set, the
 * current driver supports hardware accelerated masked blits from one part of
 * the screen onto another. This is extremely fast, so when this flag is set it
 * may be worth storing some of your more frequently used sprites in an
 * offscreen portion of the video memory.
 *
 * Warning: if the hardware acceleration flag is not set, masked_blit will not
 * work correctly when used with a source image in system or video memory so the
 * latter must be a memory bitmap.
 */
VALUE a4r_API_masked_blit(VALUE self, VALUE source, VALUE dest, VALUE source_x, VALUE source_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height)
{
  BITMAP *bmp_source, *bmp_dest;
  Data_Get_Struct(source, BITMAP, bmp_source);
  Data_Get_Struct(dest, BITMAP, bmp_dest);
  masked_blit(bmp_source, bmp_dest, FIX2INT(source_x), FIX2INT(source_y), FIX2INT(dest_x), FIX2INT(dest_y), FIX2INT(width), FIX2INT(height));
  return Qnil;
}
void Put_image(unsigned short a, short x, short y)
{
	#ifdef DEBUG_CRAZY
		fprintf(stderr, "Put image %d on screen and update its position\n X: %d \n Y: %d\n", a, x ,y);
	#endif

	masked_blit(sprites_img[a], screen, 0, 0, x, y, sprites_img[a]->w, sprites_img[a]->h);
}
void Put_sprite(unsigned short a, short x, short y, unsigned short w, unsigned short h, unsigned char f)
{
	#ifdef DEBUG_CRAZY
		fprintf(stderr, "Put sprite %d on screen and update its position\n X: %d \n Y: %d\n Frame: %d\n", a, x ,y, f);
	#endif

	masked_blit(sprites_img[a], screen, f*w, 0, x, y, w, h);
}