[layers] Added functions to add and delete layers (Keyboard shortcuts alt-ins and alt-del) Now defaults back to 1 layer per image on startup.

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1073 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-10-13 01:03:32 +00:00
parent 64f1449a3b
commit 7690cd9e50
7 changed files with 155 additions and 109 deletions

View File

@@ -36,6 +36,7 @@
#include "brush.h"
#include "input.h"
#include "engine.h"
#include "pages.h"
// we need this as global
@@ -1032,6 +1033,30 @@ void Main_handler(void)
Layer_activate((key_index-SPECIAL_LAYER1_TOGGLE)/2, RIGHT_SIDE);
action++;
break;
case SPECIAL_LAYER_ADD:
// Backup with unchanged layers
Backup_layers(0);
if (!Add_layer(Main_backups,Main_current_layer+1))
{
Update_depth_buffer();
Hide_cursor();
Display_all_screen();
Display_cursor();
}
action++;
break;
case SPECIAL_LAYER_DELETE:
// Backup with unchanged layers
Backup_layers(0);
if (!Delete_layer(Main_backups,Main_current_layer))
{
Redraw_layered_image();
Hide_cursor();
Display_all_screen();
Display_cursor();
}
action++;
break;
}
}
} // End of special keys