diff --git a/src/buttons.c b/src/buttons.c index daa8252c..49d51c04 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -3129,8 +3129,8 @@ void Load_picture(byte image) else { strcpy(filename, Brush_filename); - strcpy(directory, Main_current_directory); - Init_context_brush(&context, Brush_filename, Main_current_directory); + strcpy(directory, Brush_file_directory); + Init_context_brush(&context, filename, directory); } confirm=Button_Load_or_Save(1, &context); @@ -3162,13 +3162,8 @@ void Load_picture(byte image) if (!image) { - if (File_error==3) // Memory allocation error when loading brush - { - // Nothing to do here. - // Previous versions of Grafx2 would have damaged the Brush, - // and need reset it here, but now the loading is done in separate - // memory buffers. - } + strcpy(Brush_filename, context.File_name); + strcpy(Brush_file_directory, context.File_directory); Tiling_offset_X=0; Tiling_offset_Y=0; @@ -3469,7 +3464,11 @@ void Save_picture(byte image) strcpy(Main_backups->Pages->Filename, save_context.File_name); strcpy(Main_backups->Pages->File_directory, save_context.File_directory); } - + if (!image) + { + strcpy(Brush_filename, save_context.File_name); + strcpy(Brush_file_directory, save_context.File_directory); + } Hide_cursor(); Cursor_shape=old_cursor_shape; Display_cursor(); diff --git a/src/filesel.c b/src/filesel.c index a7fc59d8..1d0559b0 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -1400,36 +1400,21 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) Window_display_icon_sprite(bookmark_dropdown[temp]->Pos_X+3,bookmark_dropdown[temp]->Pos_Y+2,ICON_STAR); Display_bookmark(bookmark_dropdown[temp],temp); } - // On prend bien soin de passer dans le répertoire courant (le bon qui faut! Oui madame!) - if (load) - { - #if defined(__MINT__) - static char path[1024]={0}; - chdir(Main_current_directory); - Dgetpath(path,0); - strcat(path,PATH_SEPARATOR); - strcpy(Main_current_directory,path); - #else - chdir(Main_current_directory); - getcwd(Main_current_directory,256); - #endif - } - else + #if defined(__MINT__) { - #if defined(__MINT__) static char path[1024]={0}; chdir(context->File_directory); Dgetpath(path,0); strcat(path,PATH_SEPARATOR); strcpy(Main_current_directory,path); - #else + } + #else + { chdir(context->File_directory); getcwd(Main_current_directory,256); - #endif - - } + #endif // Affichage des premiers fichiers visibles: Reload_list_of_files(Main_format,file_scroller);