Skip to content

Commit

Permalink
. 修正bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya committed Jul 14, 2015
1 parent 35b9e34 commit c2296f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 10 additions & 6 deletions stage2/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,16 @@ static int read_image_bmp(int type)
for(x=0;x<bmih.biWidth;++x)
{
grub_read((unsigned long long)(unsigned int)(char*)&bftmp,bfbit, GRUB_READ);
bmp = (unsigned char *)SPLASH_IMAGE+x*current_bytes_per_pixel+y*current_bytes_per_scanline;
if(current_bits_per_pixel == 24 || current_bits_per_pixel == 32)
// bmp[x] = bftmp;
*(unsigned long *)bmp = bftmp;
else
*(unsigned short *)bmp = (unsigned short)pixel_shift(bftmp);
if(y < SPLASH_H && x < SPLASH_W)
if(y < current_y_resolution && x < current_x_resolution)
{
bmp = (unsigned char *)SPLASH_IMAGE+x*current_bytes_per_pixel+y*current_bytes_per_scanline;
if(current_bits_per_pixel == 24 || current_bits_per_pixel == 32)
// bmp[x] = bftmp; //
*(unsigned long *)bmp = bftmp;
else
*(unsigned short *)bmp = (unsigned short)pixel_shift(bftmp);
}
}
}
return 2;
Expand Down
6 changes: 5 additions & 1 deletion stage2/stage2.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,14 @@ print_entry (int y, int highlight,int entryno, char *config_entries)
}
else
{
if((splashimage_loaded & 0xf)!=2 || graphics_mode < 0xff)
unsigned long long clo = current_color_64bit;
if(splashimage_loaded & 2)
current_color_64bit = 0;
else
if (current_term->setcolorstate)
current_term->setcolorstate (COLOR_STATE_NORMAL);
ret = grub_putchar (' ', ret);
current_color_64bit = clo;
if ((long)ret < 0)
break;
//grub_putchar (' ', ret);
Expand Down

0 comments on commit c2296f3

Please sign in to comment.