Renamed apply_gui_scale() to ji_apply_guiscale().

This commit is contained in:
David Capello 2010-03-08 22:58:10 -02:00
parent 6e97287339
commit 5af4ed0d55
4 changed files with 23 additions and 21 deletions

View File

@ -171,6 +171,25 @@ int ji_color_background()
return ji_current_theme->color_background();
}
BITMAP* ji_apply_guiscale(BITMAP* original)
{
int scale = jguiscale();
if (scale > 1) {
BITMAP* scaled = create_bitmap_ex(bitmap_color_depth(original),
original->w*scale,
original->h*scale);
for (int y=0; y<scaled->h; ++y)
for (int x=0; x<scaled->w; ++x)
putpixel(scaled, x, y, getpixel(original, x/scale, y/scale));
destroy_bitmap(original);
return scaled;
}
else
return original;
}
void _ji_theme_draw_sprite_color(BITMAP *bmp, BITMAP *sprite,
int x, int y, int color)
{

View File

@ -106,6 +106,8 @@ int ji_color_hotface();
int ji_color_selected();
int ji_color_background();
BITMAP* ji_apply_guiscale(BITMAP* original);
// This value is a factor to multiply every screen size/coordinate.
// Every icon/graphics/font should be scaled to this factor.
inline int jguiscale()

View File

@ -388,7 +388,7 @@ void SkinneableTheme::regen()
draw_trans_sprite(m_part[c], m_sheet_bmp, -sheet_info[c].x, -sheet_info[c].y);
set_trans_blender(0, 0, 0, 0);
m_part[c] = apply_gui_scale(m_part[c]);
m_part[c] = ji_apply_guiscale(m_part[c]);
}
// Load tool icons
@ -425,7 +425,7 @@ void SkinneableTheme::regen()
// Add the tool-icon in the map
if (m_toolicon[tool_id]) destroy_bitmap(m_toolicon[tool_id]);
m_toolicon[tool_id] = apply_gui_scale(toolicon);
m_toolicon[tool_id] = ji_apply_guiscale(toolicon);
xmlIcon = xmlIcon->NextSiblingElement();
}
@ -1692,24 +1692,6 @@ void SkinneableTheme::less_bevel(int *bevel)
if (bevel[3] > 0) --bevel[3];
}
BITMAP* SkinneableTheme::apply_gui_scale(BITMAP* original)
{
int scale = jguiscale();
if (scale > 1) {
BITMAP* scaled = create_bitmap(original->w*scale,
original->h*scale);
for (int y=0; y<scaled->h; ++y)
for (int x=0; x<scaled->w; ++x)
putpixel(scaled, x, y, getpixel(original, x/scale, y/scale));
destroy_bitmap(original);
return scaled;
}
else
return original;
}
/* controls the "X" button in a window to close it */
bool SkinneableTheme::theme_frame_button_msg_proc(JWidget widget, JMessage msg)
{

View File

@ -396,7 +396,6 @@ private:
void draw_entry_cursor(JWidget widget, int x, int y);
void draw_bevel_box(int x1, int y1, int x2, int y2, int c1, int c2, int *bevel);
void less_bevel(int *bevel);
BITMAP* apply_gui_scale(BITMAP* original);
static bool theme_frame_button_msg_proc(JWidget widget, JMessage msg);
static bool theme_combobox_button_msg_proc(JWidget widget, JMessage msg);