diff --git a/share/grafx2/gfx2def.ini b/share/grafx2/gfx2def.ini index 0af0e498..75063708 100644 --- a/share/grafx2/gfx2def.ini +++ b/share/grafx2/gfx2def.ini @@ -412,4 +412,9 @@ ; 0=Auto (guess), 1=ON, 2=OFF Use_virtual_keyboard = 0; (Default 0) + ; Indicates if new images should by default use layers. The alternative + ; is animation frames. + ; + Default_mode_layers = no; (Default no) + ; end of configuration diff --git a/src/Makefile.dep b/src/Makefile.dep index f4b95883..ad077b37 100644 --- a/src/Makefile.dep +++ b/src/Makefile.dep @@ -1,112 +1,119 @@ +$(OBJDIR)/SFont.o: SFont.c SFont.h $(OBJDIR)/brush.o: brush.c global.h struct.h const.h graph.h misc.h errors.h \ - windows.h sdlscreen.h brush.h tiles.h + windows.h sdlscreen.h brush.h tiles.h $(OBJDIR)/brush_ops.o: brush_ops.c brush.h struct.h const.h buttons.h engine.h \ - global.h graph.h misc.h operatio.h pages.h sdlscreen.h windows.h + global.h graph.h misc.h operatio.h pages.h sdlscreen.h windows.h $(OBJDIR)/buttons.o: buttons.c const.h struct.h global.h misc.h graph.h engine.h \ - readline.h filesel.h loadsave.h init.h buttons.h operatio.h pages.h \ - palette.h errors.h readini.h saveini.h shade.h io.h help.h text.h \ - sdlscreen.h windows.h brush.h input.h special.h tiles.h setup.h + readline.h filesel.h loadsave.h init.h buttons.h operatio.h pages.h \ + palette.h errors.h readini.h saveini.h shade.h io.h help.h text.h \ + sdlscreen.h windows.h brush.h input.h special.h tiles.h setup.h $(OBJDIR)/buttons_effects.o: buttons_effects.c brush.h struct.h const.h buttons.h \ - engine.h global.h graph.h help.h input.h misc.h pages.h readline.h \ - sdlscreen.h windows.h tiles.h + engine.h global.h graph.h help.h input.h misc.h pages.h readline.h \ + sdlscreen.h windows.h tiles.h $(OBJDIR)/colorred.o: colorred.c colorred.h struct.h const.h $(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h \ - buttons.h operatio.h shade.h errors.h sdlscreen.h windows.h brush.h \ - input.h engine.h pages.h layers.h factory.h loadsave.h io.h pxsimple.h \ - oldies.h + buttons.h operatio.h shade.h errors.h sdlscreen.h windows.h brush.h \ + input.h engine.h pages.h layers.h factory.h loadsave.h io.h pxsimple.h \ + oldies.h $(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.h \ - filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \ - sdlscreen.h windows.h palette.h input.h help.h realpath.h setup.h \ - tiles.h + filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \ + sdlscreen.h windows.h palette.h input.h help.h realpath.h setup.h \ + tiles.h +$(OBJDIR)/factory_gui.o: factory_gui.c brush.h struct.h const.h buttons.h engine.h \ + errors.h filesel.h loadsave.h global.h graph.h io.h misc.h pages.h \ + readline.h sdlscreen.h windows.h palette.h input.h help.h realpath.h \ + setup.h tiles.h $(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \ - loadsave.h misc.h io.h pages.h windows.h + loadsave.h misc.h io.h pages.h windows.h $(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \ - windows.h sdlscreen.h loadsave.h mountlist.h engine.h readline.h \ - input.h help.h filesel.h + windows.h sdlscreen.h loadsave.h mountlist.h engine.h readline.h input.h \ + help.h filesel.h $(OBJDIR)/graph.o: graph.c global.h struct.h const.h engine.h buttons.h pages.h \ - errors.h sdlscreen.h graph.h misc.h pxsimple.h pxtall.h pxwide.h \ - pxdouble.h pxtriple.h pxwide2.h pxtall2.h pxquad.h windows.h input.h \ - brush.h tiles.h + errors.h sdlscreen.h graph.h misc.h pxsimple.h pxtall.h pxwide.h \ + pxdouble.h pxtriple.h pxwide2.h pxtall2.h pxquad.h windows.h input.h \ + brush.h tiles.h $(OBJDIR)/help.o: help.c const.h struct.h global.h misc.h engine.h helpfile.h \ - help.h sdlscreen.h text.h keyboard.h windows.h input.h hotkeys.h \ - errors.h pages.h + help.h sdlscreen.h text.h keyboard.h windows.h input.h hotkeys.h \ + errors.h pages.h factory.h $(OBJDIR)/hotkeys.o: hotkeys.c struct.h const.h global.h hotkeys.h $(OBJDIR)/init.o: init.c buttons.h struct.h const.h errors.h global.h graph.h \ - init.h io.h factory.h help.h hotkeys.h keyboard.h loadsave.h misc.h \ - mountlist.h operatio.h palette.h sdlscreen.h setup.h transform.h \ - windows.h layers.h special.h + init.h io.h factory.h help.h hotkeys.h keyboard.h loadsave.h misc.h \ + mountlist.h operatio.h palette.h sdlscreen.h setup.h transform.h \ + windows.h layers.h special.h $(OBJDIR)/input.o: input.c global.h struct.h const.h keyboard.h sdlscreen.h \ - windows.h errors.h misc.h buttons.h input.h loadsave.h + windows.h errors.h misc.h buttons.h input.h loadsave.h $(OBJDIR)/io.o: io.c struct.h const.h io.h realpath.h $(OBJDIR)/keyboard.o: keyboard.c global.h struct.h const.h keyboard.h $(OBJDIR)/layers.o: layers.c const.h struct.h global.h windows.h engine.h pages.h \ - sdlscreen.h input.h help.h misc.h readline.h graph.h + sdlscreen.h input.h help.h misc.h readline.h graph.h $(OBJDIR)/libraw2crtc.o: libraw2crtc.c const.h global.h struct.h loadsave.h $(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h errors.h global.h io.h \ - loadsave.h misc.h graph.h op_c.h colorred.h pages.h palette.h \ - sdlscreen.h windows.h engine.h brush.h setup.h + loadsave.h misc.h graph.h op_c.h colorred.h pages.h palette.h \ + sdlscreen.h windows.h engine.h brush.h setup.h filesel.h $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \ - engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \ - io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \ - help.h + engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \ + io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \ + help.h filesel.h $(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.h \ - engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h + engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h $(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \ - global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h \ - oldies.h -$(OBJDIR)/mountlist.o: mountlist.c mountlist.h + global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h \ + oldies.h +$(OBJDIR)/mountlist.o: mountlist.c $(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h misc.h palette.h \ - pages.h windows.h layers.h + pages.h windows.h layers.h $(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h colorred.h errors.h global.h \ - engine.h windows.h + engine.h windows.h $(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h misc.h engine.h graph.h \ - operatio.h buttons.h pages.h errors.h sdlscreen.h brush.h windows.h \ - input.h special.h tiles.h + operatio.h buttons.h pages.h errors.h sdlscreen.h brush.h windows.h \ + input.h special.h tiles.h $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h loadsave.h \ - misc.h windows.h tiles.h graph.h + misc.h windows.h tiles.h graph.h $(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \ - buttons.h pages.h help.h sdlscreen.h errors.h op_c.h colorred.h \ - windows.h input.h palette.h shade.h + buttons.h pages.h help.h sdlscreen.h errors.h op_c.h colorred.h \ + windows.h input.h palette.h shade.h +$(OBJDIR)/palette_test.o: palette_test.c const.h struct.h global.h misc.h engine.h \ + readline.h buttons.h pages.h help.h sdlscreen.h errors.h op_c.h \ + colorred.h windows.h input.h palette.h shade.h $(OBJDIR)/pversion.o: pversion.c $(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \ - graph.h pxdouble.h pxwide.h + graph.h pxdouble.h pxwide.h $(OBJDIR)/pxquad.o: pxquad.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ - pxquad.h + pxquad.h $(OBJDIR)/pxsimple.o: pxsimple.c global.h struct.h const.h sdlscreen.h misc.h \ - graph.h pxsimple.h -$(OBJDIR)/pxtall2.o: pxtall2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ - pxtall2.h + graph.h pxsimple.h $(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ - pxtall.h pxsimple.h + pxtall.h pxsimple.h +$(OBJDIR)/pxtall2.o: pxtall2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ + pxtall2.h $(OBJDIR)/pxtriple.o: pxtriple.c global.h struct.h const.h sdlscreen.h misc.h \ - graph.h pxtriple.h -$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ - pxwide2.h + graph.h pxtriple.h $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ - pxwide.h + pxwide.h +$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ + pxwide2.h $(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \ - setup.h realpath.h io.h windows.h + setup.h realpath.h io.h windows.h $(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \ - sdlscreen.h readline.h windows.h input.h engine.h + sdlscreen.h readline.h windows.h input.h engine.h $(OBJDIR)/realpath.o: realpath.c $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \ - misc.h saveini.h setup.h windows.h + misc.h saveini.h setup.h windows.h $(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h sdlscreen.h errors.h \ - misc.h + misc.h $(OBJDIR)/setup.o: setup.c struct.h const.h io.h setup.h -$(OBJDIR)/SFont.o: SFont.c SFont.h $(OBJDIR)/shade.o: shade.c global.h struct.h const.h graph.h engine.h errors.h \ - misc.h readline.h help.h sdlscreen.h windows.h input.h shade.h + misc.h readline.h help.h sdlscreen.h windows.h input.h shade.h $(OBJDIR)/special.o: special.c const.h struct.h global.h graph.h engine.h windows.h \ - special.h pages.h misc.h buttons.h + special.h pages.h misc.h buttons.h $(OBJDIR)/text.o: text.c SFont.h struct.h const.h global.h sdlscreen.h io.h \ - errors.h windows.h misc.h setup.h + errors.h windows.h misc.h setup.h $(OBJDIR)/tiles.o: tiles.c struct.h const.h global.h graph.h sdlscreen.h engine.h \ - windows.h input.h misc.h tiles.h + windows.h input.h misc.h tiles.h $(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.h \ - sdlscreen.h windows.h input.h help.h misc.h readline.h buttons.h \ - pages.h tiles.h + sdlscreen.h windows.h input.h help.h misc.h readline.h buttons.h pages.h \ + tiles.h $(OBJDIR)/version.o: version.c $(OBJDIR)/windows.o: windows.c windows.h struct.h const.h engine.h errors.h \ - global.h graph.h input.h misc.h op_c.h colorred.h readline.h \ - sdlscreen.h palette.h + global.h graph.h input.h misc.h op_c.h colorred.h readline.h sdlscreen.h \ + palette.h diff --git a/src/buttons.c b/src/buttons.c index c78fe04b..ebd5cffe 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -76,7 +76,6 @@ #include "special.h" #include "tiles.h" #include "setup.h" -#include "layers.h" #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #include @@ -188,28 +187,27 @@ void Button_Message_initial(void) } Close_window(); - if (clicked_button == 1) + if (clicked_button > 0) { if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED) { - // Set to anim mode - if (Menu_bars[MENUBAR_LAYERS].Visible && !Menu_bars[MENUBAR_ANIMATION].Visible) - Set_bar_visibility(MENUBAR_LAYERS, 0, 0); - Set_bar_visibility(MENUBAR_ANIMATION, !Menu_bars[MENUBAR_ANIMATION].Visible, 0); - Switch_layer_mode(IMAGE_MODE_ANIMATION); + Config.Default_mode_layers = 0; } else { - // Set to layer mode - if (Menu_bars[MENUBAR_ANIMATION].Visible && !Menu_bars[MENUBAR_LAYERS].Visible) - Set_bar_visibility(MENUBAR_ANIMATION, 0, 0); - Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible, 0); - Switch_layer_mode(IMAGE_MODE_LAYERED); + Config.Default_mode_layers = 1; } - Display_menu(); - Display_all_screen(); + if (Check_menu_mode()) + { + Display_menu(); + Display_all_screen(); + } + // Modify the mode for the spare too + Spare_backups->Pages->Image_mode = Main_backups->Pages->Image_mode; + Update_spare_buffers(Spare_image_width,Spare_image_height); + Redraw_spare_image(); } Display_cursor(); } @@ -524,8 +522,11 @@ void Button_Toggle_toolbar(void) Set_bar_visibility(MENUBAR_TOOLS, !Menu_bars[MENUBAR_TOOLS].Visible, 0); break; case 1: // layers - if (Menu_bars[MENUBAR_ANIMATION].Visible && !Menu_bars[MENUBAR_LAYERS].Visible) + if (Menu_bars[MENUBAR_ANIMATION].Visible) + { Set_bar_visibility(MENUBAR_ANIMATION, 0, 0); + Config.Default_mode_layers=1; + } Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible, 0); if (Main_backups->Pages->Image_mode == IMAGE_MODE_ANIMATION) @@ -533,8 +534,11 @@ void Button_Toggle_toolbar(void) break; case 2: // anim - if (Menu_bars[MENUBAR_LAYERS].Visible && !Menu_bars[MENUBAR_ANIMATION].Visible) + if (Menu_bars[MENUBAR_LAYERS].Visible) + { Set_bar_visibility(MENUBAR_LAYERS, 0, 0); + Config.Default_mode_layers=0; + } Set_bar_visibility(MENUBAR_ANIMATION, !Menu_bars[MENUBAR_ANIMATION].Visible, 0); if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED) @@ -4820,10 +4824,10 @@ void Button_Effects(void) Display_effect_state(177+23,24, "8 bit" ,Main_backups->Pages->Image_mode > IMAGE_MODE_ANIMATION); Display_cursor(); } else { - Close_window(); - Display_cursor(); + //Close_window(); + //Display_cursor(); // Contraint checker/enforcer menu - clicked_button = 11; + //clicked_button = 11; } break; case 15: // Tilemap diff --git a/src/buttons_effects.c b/src/buttons_effects.c index 17948bb8..4a727920 100644 --- a/src/buttons_effects.c +++ b/src/buttons_effects.c @@ -167,22 +167,31 @@ void Menu_tag_colors(char * window_title, byte * table, byte * mode, byte can_ca // Constaint enforcer/checker ------------------------------------------------ void Button_Constraint_mode(void) { - if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED) - { - if (Main_backups->Pages->Nb_layers!=5 || (Main_image_width%48)) - { - Verbose_message("Error!", "This emulation of Amstrad CPC's Mode5 can only be used on a 5-layer image whose width is a multiple of 48."); - return; - } - // TODO backup - Main_backups->Pages->Image_mode = IMAGE_MODE_MODE5; - // TODO set the palette to a CPC one ? - } - else if (Main_backups->Pages->Image_mode == IMAGE_MODE_MODE5) + int pixel; + + if (Main_backups->Pages->Image_mode == IMAGE_MODE_MODE5) { // Disable - Main_backups->Pages->Image_mode = IMAGE_MODE_LAYERED; + Switch_layer_mode(IMAGE_MODE_LAYERED); + return; } + if (Main_backups->Pages->Image_mode != IMAGE_MODE_LAYERED || + Main_backups->Pages->Nb_layers!=5 || (Main_image_width%48)) + { + Verbose_message("Error!", "This emulation of Amstrad CPC's Mode5 can only be used on a 5-layer image whose width is a multiple of 48."); + return; + } + for (pixel=0; pixel < Main_image_width*Main_image_height; pixel++) + { + if (Main_backups->Pages->Image[4].Pixels[pixel]>3) + { + Verbose_message("Error!", "This emulation of Amstrad CPC's Mode5 needs all pixels of layer 5 to use colors 0-3."); + return; + } + } + // TODO backup + Switch_layer_mode(IMAGE_MODE_MODE5); + // TODO set the palette to a CPC one ? } diff --git a/src/layers.c b/src/layers.c index 7ea4bcc0..09ea4288 100644 --- a/src/layers.c +++ b/src/layers.c @@ -671,29 +671,3 @@ void Button_Anim_continuous_prev(void) Unselect_button(BUTTON_ANIM_PREV_FRAME); Display_cursor(); } - -void Switch_layer_mode(enum IMAGE_MODES new_mode) -{ - if (new_mode == Main_backups->Pages->Image_mode) - return; - - switch (new_mode) - { - case IMAGE_MODE_LAYERED: - Update_buffers(Main_image_width, Main_image_height); - // Refresh the buffer, special shortcut because only one layer exists. - memset(Main_visible_image_depth_buffer.Image, 0, Main_image_width*Main_image_height); - memcpy(Main_visible_image.Image, - Main_backups->Pages->Image[0].Pixels, - Main_image_width*Main_image_height); - break; - case IMAGE_MODE_ANIMATION: - // nothing to do - break; - case IMAGE_MODE_MODE5: - break; - } - - Main_backups->Pages->Image_mode = new_mode; - Update_pixel_renderer(); -} diff --git a/src/layers.h b/src/layers.h index 6e8e5f3f..c9439912 100644 --- a/src/layers.h +++ b/src/layers.h @@ -41,5 +41,3 @@ void Button_Anim_continuous_prev(void); void Button_Anim_continuous_next(void); short Layer_under_mouse(void); - -void Switch_layer_mode(enum IMAGE_MODES new_mode); diff --git a/src/main.c b/src/main.c index 26c24689..84fa65c4 100644 --- a/src/main.c +++ b/src/main.c @@ -425,6 +425,7 @@ int Init_program(int argc,char * argv[]) { int temp; int starting_videomode; + enum IMAGE_MODES starting_image_mode; static char program_directory[MAX_PATH_CHARACTERS]; T_Gui_skin *gfx; int file_in_command_line; @@ -748,10 +749,14 @@ int Init_program(int argc,char * argv[]) Spare_image_width=Screen_width/Pixel_width; Spare_image_height=Screen_height/Pixel_height; + starting_image_mode = Config.Default_mode_layers ? + IMAGE_MODE_LAYERED : IMAGE_MODE_ANIMATION; // Allocation de mémoire pour les différents écrans virtuels (et brosse) - if (Init_all_backup_lists(Screen_width,Screen_height)==0) + if (Init_all_backup_lists(starting_image_mode , Screen_width, Screen_height)==0) Error(ERROR_MEMORY); - + // Update toolbars' visibility, now that the current image has a mode + Check_menu_mode(); + // Nettoyage de l'écran virtuel (les autres recevront celui-ci par copie) memset(Main_screen,0,Main_image_width*Main_image_height); @@ -779,7 +784,7 @@ int Init_program(int argc,char * argv[]) Draw_menu_button(BUTTON_PAL_LEFT,BUTTON_RELEASED); Draw_menu_button(BUTTON_PAL_RIGHT,BUTTON_RELEASED); - // On affiche le curseur pour débutter correctement l'état du programme: + // On affiche le curseur pour débuter correctement l'état du programme: Display_cursor(); Spare_image_is_modified=0; diff --git a/src/pages.c b/src/pages.c index c250e702..8e40ffaa 100644 --- a/src/pages.c +++ b/src/pages.c @@ -768,7 +768,7 @@ int Update_spare_buffers(int width, int height) /// GESTION DES BACKUPS /// -int Init_all_backup_lists(int width,int height) +int Init_all_backup_lists(enum IMAGE_MODES image_mode, int width, int height) { // width et height correspondent à la dimension des images de départ. int i; @@ -800,9 +800,11 @@ int Init_all_backup_lists(int width,int height) Main_visible_image.Image = NULL; Main_visible_image_backup.Image = NULL; Main_visible_image_depth_buffer.Image = NULL; + Main_backups->Pages->Image_mode = image_mode; Spare_visible_image.Width = 0; Spare_visible_image.Height = 0; Spare_visible_image.Image = NULL; + Spare_backups->Pages->Image_mode = image_mode; if (!Update_buffers(width, height)) return 0; @@ -810,11 +812,15 @@ int Init_all_backup_lists(int width,int height) return 0; // For speed, instead of Redraw_layered_image() we'll directly set the buffers. - memset(Main_visible_image.Image, 0, width*height); - memset(Main_visible_image_backup.Image, 0, width*height); - memset(Main_visible_image_depth_buffer.Image, 0, width*height); - memset(Spare_visible_image.Image, 0, width*height); - + if (Main_visible_image.Image != NULL) + { + memset(Main_visible_image.Image, 0, width*height); + memset(Main_visible_image_backup.Image, 0, width*height); + memset(Main_visible_image_depth_buffer.Image, 0, width*height); + } + if (Spare_visible_image.Image != NULL) + memset(Spare_visible_image.Image, 0, width*height); + Download_infos_page_main(Main_backups->Pages); Update_FX_feedback(Config.FX_Feedback); @@ -1489,3 +1495,25 @@ byte Merge_layer() } return Delete_layer(Main_backups,Main_current_layer); } + +void Switch_layer_mode(enum IMAGE_MODES new_mode) +{ + if (new_mode == Main_backups->Pages->Image_mode) + return; + + Main_backups->Pages->Image_mode = new_mode; + + switch (new_mode) + { + case IMAGE_MODE_MODE5: + case IMAGE_MODE_LAYERED: + Update_buffers(Main_image_width, Main_image_height); + Redraw_layered_image(); + break; + case IMAGE_MODE_ANIMATION: + // nothing to do. + // Eventually, we may clear the buffers to save a bit of memory... + break; + } + Update_pixel_renderer(); +} diff --git a/src/pages.h b/src/pages.h index 684f970b..f01ea54a 100644 --- a/src/pages.h +++ b/src/pages.h @@ -91,7 +91,7 @@ void Free_page_of_a_list(T_List_of_pages * list); /// BACKUP HIGH-LEVEL FUNCTIONS /// -int Init_all_backup_lists(int width,int height); +int Init_all_backup_lists(enum IMAGE_MODES image_mode,int width,int height); void Set_number_of_backups(int nb_backups); int Backup_new_image(int layers,int width,int height); int Backup_with_new_dimensions(int width,int height); @@ -127,6 +127,8 @@ void Redraw_spare_image(void); /// Main_current_layer void Update_FX_feedback(byte with_feedback); +void Switch_layer_mode(enum IMAGE_MODES new_mode); + /// /// STATISTICS /// diff --git a/src/readini.c b/src/readini.c index ba41f4bc..347ff791 100644 --- a/src/readini.c +++ b/src/readini.c @@ -987,6 +987,13 @@ int Load_INI(T_Config * conf) conf->Use_virtual_keyboard=values[0]; } + conf->Default_mode_layers=0; + // Optional, remembers if the user last chose layers or anim (>=2.4) + if (!Load_INI_get_values (file,buffer,"Default_mode_layers",1,values)) + { + conf->Default_mode_layers=(values[0]!=0); + } + // Insert new values here fclose(file); diff --git a/src/saveini.c b/src/saveini.c index 0e250a91..fcd00a7c 100644 --- a/src/saveini.c +++ b/src/saveini.c @@ -721,7 +721,10 @@ int Save_INI(T_Config * conf) if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Use_virtual_keyboard",1,values,0))) goto Erreur_Retour; - + values[0]=conf->Default_mode_layers; + if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Default_mode_layers",1,values,1))) + goto Erreur_Retour; + // Insert new values here Save_INI_flush(old_file,new_file,buffer); diff --git a/src/struct.h b/src/struct.h index 138f5466..0bd4cb57 100644 --- a/src/struct.h +++ b/src/struct.h @@ -374,7 +374,7 @@ typedef struct byte Tilemap_allow_flipped_y; ///< Boolean, true if the Tilemap tool should detect y-flipped tiles. byte Tilemap_show_count; ///< Boolean, true if the Tilemap tool should display tile count after analysis. byte Use_virtual_keyboard; ///< 0: Auto, 1: On, 2: Off - + byte Default_mode_layers; ///< Indicates if default new image has layers (alternative is animation) } T_Config;