Program now remembers favorite mode layers/anim, based on last time you switched in splash screen or toolbar. Fixed graphic behavior when mode 5 is enabled/disabled, and added a safety (colors <4).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2014 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
5165312bff
commit
26613ec440
@ -412,4 +412,9 @@
|
|||||||
; 0=Auto (guess), 1=ON, 2=OFF
|
; 0=Auto (guess), 1=ON, 2=OFF
|
||||||
Use_virtual_keyboard = 0; (Default 0)
|
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
|
; end of configuration
|
||||||
|
|||||||
137
src/Makefile.dep
137
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 \
|
$(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 \
|
$(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 \
|
$(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 \
|
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 \
|
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
|
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 \
|
$(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 \
|
engine.h global.h graph.h help.h input.h misc.h pages.h readline.h \
|
||||||
sdlscreen.h windows.h tiles.h
|
sdlscreen.h windows.h tiles.h
|
||||||
$(OBJDIR)/colorred.o: colorred.c colorred.h struct.h const.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 \
|
$(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 \
|
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 \
|
input.h engine.h pages.h layers.h factory.h loadsave.h io.h pxsimple.h \
|
||||||
oldies.h
|
oldies.h
|
||||||
$(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.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 \
|
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 \
|
sdlscreen.h windows.h palette.h input.h help.h realpath.h setup.h \
|
||||||
tiles.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 \
|
$(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 \
|
$(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 \
|
windows.h sdlscreen.h loadsave.h mountlist.h engine.h readline.h input.h \
|
||||||
input.h help.h filesel.h
|
help.h filesel.h
|
||||||
$(OBJDIR)/graph.o: graph.c global.h struct.h const.h engine.h buttons.h pages.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 \
|
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 \
|
pxdouble.h pxtriple.h pxwide2.h pxtall2.h pxquad.h windows.h input.h \
|
||||||
brush.h tiles.h
|
brush.h tiles.h
|
||||||
$(OBJDIR)/help.o: help.c const.h struct.h global.h misc.h engine.h helpfile.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 \
|
help.h sdlscreen.h text.h keyboard.h windows.h input.h hotkeys.h \
|
||||||
errors.h pages.h
|
errors.h pages.h factory.h
|
||||||
$(OBJDIR)/hotkeys.o: hotkeys.c struct.h const.h global.h hotkeys.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 \
|
$(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 \
|
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 \
|
mountlist.h operatio.h palette.h sdlscreen.h setup.h transform.h \
|
||||||
windows.h layers.h special.h
|
windows.h layers.h special.h
|
||||||
$(OBJDIR)/input.o: input.c global.h struct.h const.h keyboard.h sdlscreen.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)/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)/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 \
|
$(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)/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 \
|
$(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 \
|
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
|
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 \
|
$(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 \
|
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 \
|
io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \
|
||||||
help.h
|
help.h filesel.h
|
||||||
$(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.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 \
|
$(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 \
|
global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h \
|
||||||
oldies.h
|
oldies.h
|
||||||
$(OBJDIR)/mountlist.o: mountlist.c mountlist.h
|
$(OBJDIR)/mountlist.o: mountlist.c
|
||||||
$(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h misc.h palette.h \
|
$(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 \
|
$(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 \
|
$(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 \
|
operatio.h buttons.h pages.h errors.h sdlscreen.h brush.h windows.h \
|
||||||
input.h special.h tiles.h
|
input.h special.h tiles.h
|
||||||
$(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h loadsave.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 \
|
$(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 \
|
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h colorred.h \
|
||||||
windows.h input.h palette.h shade.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)/pversion.o: pversion.c
|
||||||
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
|
$(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 \
|
$(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 \
|
$(OBJDIR)/pxsimple.o: pxsimple.c global.h struct.h const.h sdlscreen.h misc.h \
|
||||||
graph.h pxsimple.h
|
graph.h pxsimple.h
|
||||||
$(OBJDIR)/pxtall2.o: pxtall2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \
|
|
||||||
pxtall2.h
|
|
||||||
$(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h sdlscreen.h misc.h graph.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 \
|
$(OBJDIR)/pxtriple.o: pxtriple.c global.h struct.h const.h sdlscreen.h misc.h \
|
||||||
graph.h pxtriple.h
|
graph.h pxtriple.h
|
||||||
$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \
|
|
||||||
pxwide2.h
|
|
||||||
$(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h sdlscreen.h misc.h graph.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 \
|
$(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 \
|
$(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)/realpath.o: realpath.c
|
||||||
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \
|
$(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 \
|
$(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)/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 \
|
$(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 \
|
$(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 \
|
$(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 \
|
$(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 \
|
$(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 \
|
sdlscreen.h windows.h input.h help.h misc.h readline.h buttons.h pages.h \
|
||||||
pages.h tiles.h
|
tiles.h
|
||||||
$(OBJDIR)/version.o: version.c
|
$(OBJDIR)/version.o: version.c
|
||||||
$(OBJDIR)/windows.o: windows.c windows.h struct.h const.h engine.h errors.h \
|
$(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 \
|
global.h graph.h input.h misc.h op_c.h colorred.h readline.h sdlscreen.h \
|
||||||
sdlscreen.h palette.h
|
palette.h
|
||||||
|
|||||||
@ -76,7 +76,6 @@
|
|||||||
#include "special.h"
|
#include "special.h"
|
||||||
#include "tiles.h"
|
#include "tiles.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "layers.h"
|
|
||||||
|
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
@ -188,28 +187,27 @@ void Button_Message_initial(void)
|
|||||||
}
|
}
|
||||||
Close_window();
|
Close_window();
|
||||||
|
|
||||||
if (clicked_button == 1)
|
if (clicked_button > 0)
|
||||||
{
|
{
|
||||||
if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED)
|
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);
|
Switch_layer_mode(IMAGE_MODE_ANIMATION);
|
||||||
|
Config.Default_mode_layers = 0;
|
||||||
}
|
}
|
||||||
else
|
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);
|
Switch_layer_mode(IMAGE_MODE_LAYERED);
|
||||||
|
Config.Default_mode_layers = 1;
|
||||||
}
|
}
|
||||||
Display_menu();
|
if (Check_menu_mode())
|
||||||
Display_all_screen();
|
{
|
||||||
|
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();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -524,8 +522,11 @@ void Button_Toggle_toolbar(void)
|
|||||||
Set_bar_visibility(MENUBAR_TOOLS, !Menu_bars[MENUBAR_TOOLS].Visible, 0);
|
Set_bar_visibility(MENUBAR_TOOLS, !Menu_bars[MENUBAR_TOOLS].Visible, 0);
|
||||||
break;
|
break;
|
||||||
case 1: // layers
|
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);
|
Set_bar_visibility(MENUBAR_ANIMATION, 0, 0);
|
||||||
|
Config.Default_mode_layers=1;
|
||||||
|
}
|
||||||
Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible, 0);
|
Set_bar_visibility(MENUBAR_LAYERS, !Menu_bars[MENUBAR_LAYERS].Visible, 0);
|
||||||
|
|
||||||
if (Main_backups->Pages->Image_mode == IMAGE_MODE_ANIMATION)
|
if (Main_backups->Pages->Image_mode == IMAGE_MODE_ANIMATION)
|
||||||
@ -533,8 +534,11 @@ void Button_Toggle_toolbar(void)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 2: // anim
|
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);
|
Set_bar_visibility(MENUBAR_LAYERS, 0, 0);
|
||||||
|
Config.Default_mode_layers=0;
|
||||||
|
}
|
||||||
Set_bar_visibility(MENUBAR_ANIMATION, !Menu_bars[MENUBAR_ANIMATION].Visible, 0);
|
Set_bar_visibility(MENUBAR_ANIMATION, !Menu_bars[MENUBAR_ANIMATION].Visible, 0);
|
||||||
|
|
||||||
if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED)
|
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_effect_state(177+23,24, "8 bit" ,Main_backups->Pages->Image_mode > IMAGE_MODE_ANIMATION);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
} else {
|
} else {
|
||||||
Close_window();
|
//Close_window();
|
||||||
Display_cursor();
|
//Display_cursor();
|
||||||
// Contraint checker/enforcer menu
|
// Contraint checker/enforcer menu
|
||||||
clicked_button = 11;
|
//clicked_button = 11;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15: // Tilemap
|
case 15: // Tilemap
|
||||||
|
|||||||
@ -167,22 +167,31 @@ void Menu_tag_colors(char * window_title, byte * table, byte * mode, byte can_ca
|
|||||||
// Constaint enforcer/checker ------------------------------------------------
|
// Constaint enforcer/checker ------------------------------------------------
|
||||||
void Button_Constraint_mode(void)
|
void Button_Constraint_mode(void)
|
||||||
{
|
{
|
||||||
if (Main_backups->Pages->Image_mode == IMAGE_MODE_LAYERED)
|
int pixel;
|
||||||
{
|
|
||||||
if (Main_backups->Pages->Nb_layers!=5 || (Main_image_width%48))
|
if (Main_backups->Pages->Image_mode == IMAGE_MODE_MODE5)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
// Disable
|
// 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 ?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
26
src/layers.c
26
src/layers.c
@ -671,29 +671,3 @@ void Button_Anim_continuous_prev(void)
|
|||||||
Unselect_button(BUTTON_ANIM_PREV_FRAME);
|
Unselect_button(BUTTON_ANIM_PREV_FRAME);
|
||||||
Display_cursor();
|
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();
|
|
||||||
}
|
|
||||||
|
|||||||
@ -41,5 +41,3 @@ void Button_Anim_continuous_prev(void);
|
|||||||
void Button_Anim_continuous_next(void);
|
void Button_Anim_continuous_next(void);
|
||||||
|
|
||||||
short Layer_under_mouse(void);
|
short Layer_under_mouse(void);
|
||||||
|
|
||||||
void Switch_layer_mode(enum IMAGE_MODES new_mode);
|
|
||||||
|
|||||||
@ -425,6 +425,7 @@ int Init_program(int argc,char * argv[])
|
|||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
int starting_videomode;
|
int starting_videomode;
|
||||||
|
enum IMAGE_MODES starting_image_mode;
|
||||||
static char program_directory[MAX_PATH_CHARACTERS];
|
static char program_directory[MAX_PATH_CHARACTERS];
|
||||||
T_Gui_skin *gfx;
|
T_Gui_skin *gfx;
|
||||||
int file_in_command_line;
|
int file_in_command_line;
|
||||||
@ -748,9 +749,13 @@ int Init_program(int argc,char * argv[])
|
|||||||
Spare_image_width=Screen_width/Pixel_width;
|
Spare_image_width=Screen_width/Pixel_width;
|
||||||
Spare_image_height=Screen_height/Pixel_height;
|
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)
|
// 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);
|
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)
|
// Nettoyage de l'écran virtuel (les autres recevront celui-ci par copie)
|
||||||
memset(Main_screen,0,Main_image_width*Main_image_height);
|
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_LEFT,BUTTON_RELEASED);
|
||||||
Draw_menu_button(BUTTON_PAL_RIGHT,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();
|
Display_cursor();
|
||||||
|
|
||||||
Spare_image_is_modified=0;
|
Spare_image_is_modified=0;
|
||||||
|
|||||||
38
src/pages.c
38
src/pages.c
@ -768,7 +768,7 @@ int Update_spare_buffers(int width, int height)
|
|||||||
/// GESTION DES BACKUPS
|
/// 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.
|
// width et height correspondent à la dimension des images de départ.
|
||||||
int i;
|
int i;
|
||||||
@ -800,9 +800,11 @@ int Init_all_backup_lists(int width,int height)
|
|||||||
Main_visible_image.Image = NULL;
|
Main_visible_image.Image = NULL;
|
||||||
Main_visible_image_backup.Image = NULL;
|
Main_visible_image_backup.Image = NULL;
|
||||||
Main_visible_image_depth_buffer.Image = NULL;
|
Main_visible_image_depth_buffer.Image = NULL;
|
||||||
|
Main_backups->Pages->Image_mode = image_mode;
|
||||||
Spare_visible_image.Width = 0;
|
Spare_visible_image.Width = 0;
|
||||||
Spare_visible_image.Height = 0;
|
Spare_visible_image.Height = 0;
|
||||||
Spare_visible_image.Image = NULL;
|
Spare_visible_image.Image = NULL;
|
||||||
|
Spare_backups->Pages->Image_mode = image_mode;
|
||||||
|
|
||||||
if (!Update_buffers(width, height))
|
if (!Update_buffers(width, height))
|
||||||
return 0;
|
return 0;
|
||||||
@ -810,10 +812,14 @@ int Init_all_backup_lists(int width,int height)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// For speed, instead of Redraw_layered_image() we'll directly set the buffers.
|
// For speed, instead of Redraw_layered_image() we'll directly set the buffers.
|
||||||
memset(Main_visible_image.Image, 0, width*height);
|
if (Main_visible_image.Image != NULL)
|
||||||
memset(Main_visible_image_backup.Image, 0, width*height);
|
{
|
||||||
memset(Main_visible_image_depth_buffer.Image, 0, width*height);
|
memset(Main_visible_image.Image, 0, width*height);
|
||||||
memset(Spare_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);
|
Download_infos_page_main(Main_backups->Pages);
|
||||||
Update_FX_feedback(Config.FX_Feedback);
|
Update_FX_feedback(Config.FX_Feedback);
|
||||||
@ -1489,3 +1495,25 @@ byte Merge_layer()
|
|||||||
}
|
}
|
||||||
return Delete_layer(Main_backups,Main_current_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();
|
||||||
|
}
|
||||||
|
|||||||
@ -91,7 +91,7 @@ void Free_page_of_a_list(T_List_of_pages * list);
|
|||||||
/// BACKUP HIGH-LEVEL FUNCTIONS
|
/// 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);
|
void Set_number_of_backups(int nb_backups);
|
||||||
int Backup_new_image(int layers,int width,int height);
|
int Backup_new_image(int layers,int width,int height);
|
||||||
int Backup_with_new_dimensions(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
|
/// Main_current_layer
|
||||||
void Update_FX_feedback(byte with_feedback);
|
void Update_FX_feedback(byte with_feedback);
|
||||||
|
|
||||||
|
void Switch_layer_mode(enum IMAGE_MODES new_mode);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// STATISTICS
|
/// STATISTICS
|
||||||
///
|
///
|
||||||
|
|||||||
@ -987,6 +987,13 @@ int Load_INI(T_Config * conf)
|
|||||||
conf->Use_virtual_keyboard=values[0];
|
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
|
// Insert new values here
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|||||||
@ -721,6 +721,9 @@ int Save_INI(T_Config * conf)
|
|||||||
if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Use_virtual_keyboard",1,values,0)))
|
if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Use_virtual_keyboard",1,values,0)))
|
||||||
goto Erreur_Retour;
|
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
|
// Insert new values here
|
||||||
|
|
||||||
|
|||||||
@ -374,7 +374,7 @@ typedef struct
|
|||||||
byte Tilemap_allow_flipped_y; ///< Boolean, true if the Tilemap tool should detect y-flipped tiles.
|
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 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 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;
|
} T_Config;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user