rename some variables

This commit is contained in:
idea4good
2019-09-06 16:18:04 +08:00
parent c0a85dcb83
commit 5b1bd4f387
3 changed files with 12 additions and 12 deletions

View File

@@ -17,9 +17,9 @@ void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *p
lower_fb = surface->m_frame_layers[z_order - 1].fb;
}
unsigned int mask_rgb_16 = GL_RGB_32_to_16(mask_rgb);
int xsize = pBitmap->XSize;
int ysize = pBitmap->YSize;
const unsigned short* pData = (const unsigned short*)pBitmap->pData;
int xsize = pBitmap->width;
int ysize = pBitmap->height;
const unsigned short* pData = (const unsigned short*)pBitmap->pixel_color_array;
for (int j = 0; j < ysize; j++)
{
for (int i = 0; i < xsize; i++)
@@ -42,7 +42,7 @@ void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *p
void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO* pBitmap, int x, int y, int src_x, int src_y, int width, int height, unsigned int mask_rgb)
{
if (0 == pBitmap || (src_x + width > pBitmap->XSize) || (src_y + height > pBitmap->YSize))
if (0 == pBitmap || (src_x + width > pBitmap->width) || (src_y + height > pBitmap->height))
{
return;
}
@@ -54,10 +54,10 @@ void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO* p
lower_fb = surface->m_frame_layers[z_order - 1].fb;
}
unsigned int mask_rgb_16 = GL_RGB_32_to_16(mask_rgb);
const unsigned short* pData = (const unsigned short*)pBitmap->pData;
const unsigned short* pData = (const unsigned short*)pBitmap->pixel_color_array;
for (int j = 0; j < height; j++)
{
const unsigned short* p = &pData[src_x + (src_y + j) * pBitmap->XSize];
const unsigned short* p = &pData[src_x + (src_y + j) * pBitmap->width];
for (int i = 0; i < width; i++)
{
unsigned int rgb = *p++;

View File

@@ -147,7 +147,7 @@ int c_word::draw_single_char(c_surface* surface, int z_order, unsigned int utf8_
const LATTICE* p_lattice = get_lattice(font, utf8_code);
if (p_lattice)
{
draw_lattice(surface, z_order, x, y, p_lattice->width, font->height, p_lattice->p_data, font_color, bg_color);
draw_lattice(surface, z_order, x, y, p_lattice->width, font->height, p_lattice->pixel_gray_array, font_color, bg_color);
return p_lattice->width;
}
}

View File

@@ -4,10 +4,10 @@
//BITMAP
typedef struct struct_bitmap_info
{
unsigned short XSize;
unsigned short YSize;
unsigned short BitsPerPixel;
const unsigned char* pData; /* Pointer to picture data (indices) */
unsigned short width;
unsigned short height;
unsigned short color_bits;//support 16 bits only
const unsigned short* pixel_color_array;
} BITMAP_INFO;
//FONT
@@ -15,7 +15,7 @@ typedef struct struct_lattice
{
unsigned int utf8_code;
unsigned char width;
const unsigned char* p_data;
const unsigned char* pixel_gray_array;
} LATTICE;
typedef struct struct_font_info