Moved skin preview to the Gfx struct so it is not overwritten if you cancel skin loading.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1115 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
a2fd796e59
commit
2b02ff505f
10
buttons.c
10
buttons.c
@ -1111,7 +1111,7 @@ void Button_Skins(void)
|
||||
|
||||
for (y = 14, offs_y = 0; offs_y < 16; offs_y++, y++)
|
||||
for (x = 6, x_pos = 0; x_pos<173; x_pos++, x++)
|
||||
Pixel_in_window(x, y, skin_logo[offs_y][x_pos]);
|
||||
Pixel_in_window(x, y, Gfx->preview[offs_y][x_pos]);
|
||||
|
||||
Update_window_area(0, 0, Window_width, Window_height);
|
||||
|
||||
@ -1153,13 +1153,13 @@ void Button_Skins(void)
|
||||
for (y = 14, offs_y = 0; offs_y < 16; offs_y++, y++)
|
||||
for (x = 6, x_pos = 0; x_pos<173; x_pos++, x++)
|
||||
{
|
||||
if (skin_logo[offs_y][x_pos] == MC_Black)
|
||||
if (gfx->preview[offs_y][x_pos] == MC_Black)
|
||||
Pixel_in_window(x, y, Old_black);
|
||||
else if (skin_logo[offs_y][x_pos] == MC_Dark)
|
||||
else if (gfx->preview[offs_y][x_pos] == MC_Dark)
|
||||
Pixel_in_window(x, y, Old_dark);
|
||||
else if (skin_logo[offs_y][x_pos] == MC_Light)
|
||||
else if (gfx->preview[offs_y][x_pos] == MC_Light)
|
||||
Pixel_in_window(x, y, Old_light);
|
||||
else if (skin_logo[offs_y][x_pos] == MC_White)
|
||||
else if (gfx->preview[offs_y][x_pos] == MC_White)
|
||||
Pixel_in_window(x, y, Old_white);
|
||||
}
|
||||
Update_window_area(4, 14, 174, 16);
|
||||
|
||||
3
global.h
3
global.h
@ -805,9 +805,6 @@ GFX2_GLOBAL byte * Menu_font;
|
||||
/// Pointer to the current active skin.
|
||||
GFX2_GLOBAL T_Gui_skin * Gfx;
|
||||
|
||||
/// Logo of skin
|
||||
byte skin_logo[16][173];
|
||||
|
||||
// -- Help data
|
||||
|
||||
/// Index of the ::Help_section shown by the Help screen.
|
||||
|
||||
2
init.c
2
init.c
@ -350,7 +350,7 @@ byte Parse_skin(SDL_Surface * gui, T_Gui_skin *gfx)
|
||||
cursor_x += MENU_WIDTH;
|
||||
if (GUI_seek_right(gui, &cursor_x, cursor_y, neutral_color, "logo"))
|
||||
return 1;
|
||||
if (Read_GUI_block(gui, cursor_x, cursor_y, skin_logo, 173, 16, "logo", 0))
|
||||
if (Read_GUI_block(gui, cursor_x, cursor_y, gfx->preview, 173, 16, "logo", 0))
|
||||
return 1;
|
||||
cursor_y+=MENU_HEIGHT;
|
||||
|
||||
|
||||
2
op_c.c
2
op_c.c
@ -1206,7 +1206,7 @@ void Convert_24b_bitmap_to_256_Floyd_Steinberg(T_Bitmap256 dest,T_Bitmap24B sour
|
||||
}
|
||||
|
||||
void Convert_24b_bitmap_to_256_nearest_neighbor(T_Bitmap256 dest,
|
||||
T_Bitmap24B source, int width, int height, T_Components * palette,
|
||||
T_Bitmap24B source, int width, int height, __attribute__((unused)) T_Components * palette,
|
||||
T_Conversion_table * tc)
|
||||
{
|
||||
T_Bitmap24B current;
|
||||
|
||||
4
struct.h
4
struct.h
@ -426,6 +426,10 @@ typedef struct
|
||||
/// A default 256-color palette.
|
||||
T_Palette Default_palette;
|
||||
|
||||
/// Preview for displaying in the skin dialog
|
||||
byte preview[16][173];
|
||||
|
||||
|
||||
|
||||
} T_Gui_skin;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user