diff --git a/buttons.c b/buttons.c index 5af0a375..2e1aefc7 100644 --- a/buttons.c +++ b/buttons.c @@ -1220,10 +1220,11 @@ void Button_Page(void) SWAP_WORDS (Main_fileselector_position,Spare_fileselector_position) SWAP_WORDS (Main_fileselector_offset,Spare_fileselector_offset) - SWAP_SHORTS(Main_current_layer,Spare_current_layer) - SWAP_DWORDS (Main_layers_visible,Spare_layers_visible) + SWAP_BYTES (Main_current_layer,Spare_current_layer) + SWAP_DWORDS(Main_layers_visible,Spare_layers_visible) Update_screen_targets(); + Redraw_layered_image(); // A la fin, on affiche l'écran for (factor_index=0; ZOOM_FACTOR[factor_index]!=Main_magnifier_factor; factor_index++); diff --git a/global.h b/global.h index 9a9cd970..85872e14 100644 --- a/global.h +++ b/global.h @@ -338,7 +338,7 @@ GFX2_GLOBAL short Main_magnifier_offset_X; /// Y position (in image space) of the pixel to display in the top left corner of the magnified view. GFX2_GLOBAL short Main_magnifier_offset_Y; /// Index of layer currently being edited -GFX2_GLOBAL int Main_current_layer; +GFX2_GLOBAL byte Main_current_layer; /// Bitfield that records which layers are visible. 2^0 for 0, 2^1 for 1, 2^2 for 2, etc. GFX2_GLOBAL dword Main_layers_visible; @@ -402,7 +402,7 @@ GFX2_GLOBAL short Spare_magnifier_offset_X; /// Y position (in image space) of the pixel to display in the top left corner of the magnified view. GFX2_GLOBAL short Spare_magnifier_offset_Y; /// Index of layer currently being edited -GFX2_GLOBAL short Spare_current_layer; +GFX2_GLOBAL byte Spare_current_layer; /// Bitfield that records which layers are visible. 2^0 for 0, 2^1 for 1, 2^2 for 2, etc. GFX2_GLOBAL dword Spare_layers_visible; // -- Image backups diff --git a/layers.c b/layers.c index 45776c5f..daf5984c 100644 --- a/layers.c +++ b/layers.c @@ -26,7 +26,7 @@ #include "engine.h" #include "pages.h" -void Layer_activate(short layer, short side) +void Layer_activate(byte layer, short side) { word old_layers; diff --git a/layers.h b/layers.h index d814496d..9bf83f49 100644 --- a/layers.h +++ b/layers.h @@ -30,6 +30,6 @@ void Button_Layer_up(void); void Button_Layer_down(void); void Button_Layer_select(void); void Button_Layer_toggle(void); -void Layer_activate(short layer, short side); +void Layer_activate(byte layer, short side); diff --git a/pages.c b/pages.c index 1d5e78fe..0734b101 100644 --- a/pages.c +++ b/pages.c @@ -176,7 +176,7 @@ void Redraw_layered_image(void) { #ifndef NOLAYERS // Re-construct the image with the visible layers - int layer; + byte layer; // First layer for (layer=0; layerPages->Nb_layers; layer++) { @@ -950,7 +950,6 @@ void Exchange_main_and_spare(void) Download_infos_page_main(Main_backups->Pages); Download_infos_backup(Main_backups); Download_infos_page_spare(Spare_backups->Pages); - Redraw_layered_image(); } void End_of_modification(void) diff --git a/special.h b/special.h index d28fa68d..38c1fd45 100644 --- a/special.h +++ b/special.h @@ -56,9 +56,3 @@ byte Restore_brush(int index); */ void Transparency_set(byte amount); -void Layer_activate(short layer, short side); - -void Special_add_layer(void); - -void Special_delete_layer(void); -