Fileselectors : handle palette and image formats separately
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2125 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
7f4fcde6d7
commit
2f3c55477e
@ -113,8 +113,9 @@
|
||||
/// List of file formats recognized by grafx2
|
||||
enum FILE_FORMATS
|
||||
{
|
||||
FORMAT_ALL_IMAGES=0, ///< This is not really a file format, it's reserverd for a compilation of all file extensions
|
||||
FORMAT_ALL_FILES=1, ///< This is not really a file format, it's reserverd for the "*.*" filter option.
|
||||
FORMAT_ALL_IMAGES=0, ///< This is not really a file format, it's reserverd for a compilation of all image file extensions
|
||||
FORMAT_ALL_PALETTES=1, ///< This is not really a file format, it's reserverd for a compilation of all palette file extensions
|
||||
FORMAT_ALL_FILES=2, ///< This is not really a file format, it's reserverd for the "*.*" filter option.
|
||||
FORMAT_PNG,
|
||||
FORMAT_GIF,
|
||||
FORMAT_BMP,
|
||||
|
||||
@ -1447,8 +1447,8 @@ byte Button_Load_or_Save(T_Selector_settings *settings, byte load, T_IO_Context
|
||||
|
||||
for (format=0; format < Nb_known_formats(); format++)
|
||||
{
|
||||
if ((load && (File_formats[format].Identifier <= FORMAT_ALL_FILES || File_formats[format].Load)) ||
|
||||
(!load && File_formats[format].Save))
|
||||
if (((context->Type == CONTEXT_PALETTE) == File_formats[format].Palette_only) &&
|
||||
((load && (File_formats[format].Load || File_formats[format].Identifier <= FORMAT_ALL_FILES)) || (!load && File_formats[format].Save)))
|
||||
Window_dropdown_add_item(formats_dropdown,File_formats[format].Identifier,File_formats[format].Label);
|
||||
}
|
||||
Print_in_window(70,18,"Format",MC_Dark,MC_Light);
|
||||
|
||||
@ -153,7 +153,8 @@ void Load_SDL_Image(T_IO_Context *);
|
||||
|
||||
// ENUM Name TestFunc LoadFunc SaveFunc PalOnly Comment Layers Ext Exts
|
||||
T_Format File_formats[] = {
|
||||
{FORMAT_ALL_IMAGES, "(all)", NULL, NULL, NULL, 0, 0, 0, "", "gif;png;bmp;pcx;pkm;iff;lbm;ilbm;img;sci;scq;scf;scn;sco;pi1;pc1;cel;neo;kcf;pal;gpl;c64;koa;koala;fli;bml;cdu;prg;tga;pnm;xpm;xcf;jpg;jpeg;tif;tiff;ico;cm5"},
|
||||
{FORMAT_ALL_IMAGES, "(all)", NULL, NULL, NULL, 0, 0, 0, "", "gif;png;bmp;pcx;pkm;iff;lbm;ilbm;img;sci;scq;scf;scn;sco;pi1;pc1;cel;neo;c64;koa;koala;fli;bml;cdu;prg;tga;pnm;xpm;xcf;jpg;jpeg;tif;tiff;ico;cm5"},
|
||||
{FORMAT_ALL_PALETTES, "(all)", NULL, NULL, NULL, 1, 0, 0, "", "kcf;pal;gpl"},
|
||||
{FORMAT_ALL_FILES, "(*.*)", NULL, NULL, NULL, 0, 0, 0, "", "*"},
|
||||
{FORMAT_GIF, " gif", Test_GIF, Load_GIF, Save_GIF, 0, 1, 1, "gif", "gif"},
|
||||
#ifndef __no_pnglib__
|
||||
@ -245,6 +246,8 @@ void Set_pixel(T_IO_Context *context, short x_pos, short y_pos, byte color)
|
||||
*(((byte *)(context->Surface->pixels)) + context->Surface->pitch * y_pos + x_pos) = color;
|
||||
break;
|
||||
|
||||
case CONTEXT_PALETTE:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@ -269,6 +272,8 @@ void Fill_canvas(T_IO_Context *context, byte color)
|
||||
break;
|
||||
case CONTEXT_SURFACE:
|
||||
break;
|
||||
case CONTEXT_PALETTE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -566,7 +571,7 @@ void Set_file_error(int value)
|
||||
void Load_image(T_IO_Context *context)
|
||||
{
|
||||
unsigned int index; // index de balayage des formats
|
||||
T_Format *format = &(File_formats[2]); // Format du fichier à charger
|
||||
T_Format *format = &(File_formats[FORMAT_ALL_FILES+1]); // Format du fichier à charger
|
||||
int i;
|
||||
byte old_cursor_shape;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user