Fix weird mixing of layers from main and spare pages (Issue 259)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1232 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-12-01 23:05:22 +00:00
parent 247b228141
commit 7645d0844a
6 changed files with 8 additions and 14 deletions

View File

@ -1220,10 +1220,11 @@ void Button_Page(void)
SWAP_WORDS (Main_fileselector_position,Spare_fileselector_position) SWAP_WORDS (Main_fileselector_position,Spare_fileselector_position)
SWAP_WORDS (Main_fileselector_offset,Spare_fileselector_offset) SWAP_WORDS (Main_fileselector_offset,Spare_fileselector_offset)
SWAP_SHORTS(Main_current_layer,Spare_current_layer) SWAP_BYTES (Main_current_layer,Spare_current_layer)
SWAP_DWORDS(Main_layers_visible,Spare_layers_visible) SWAP_DWORDS(Main_layers_visible,Spare_layers_visible)
Update_screen_targets(); Update_screen_targets();
Redraw_layered_image();
// A la fin, on affiche l'écran // A la fin, on affiche l'écran
for (factor_index=0; ZOOM_FACTOR[factor_index]!=Main_magnifier_factor; factor_index++); for (factor_index=0; ZOOM_FACTOR[factor_index]!=Main_magnifier_factor; factor_index++);

View File

@ -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. /// 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; GFX2_GLOBAL short Main_magnifier_offset_Y;
/// Index of layer currently being edited /// 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. /// 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; 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. /// 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; GFX2_GLOBAL short Spare_magnifier_offset_Y;
/// Index of layer currently being edited /// 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. /// 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; GFX2_GLOBAL dword Spare_layers_visible;
// -- Image backups // -- Image backups

View File

@ -26,7 +26,7 @@
#include "engine.h" #include "engine.h"
#include "pages.h" #include "pages.h"
void Layer_activate(short layer, short side) void Layer_activate(byte layer, short side)
{ {
word old_layers; word old_layers;

View File

@ -30,6 +30,6 @@ void Button_Layer_up(void);
void Button_Layer_down(void); void Button_Layer_down(void);
void Button_Layer_select(void); void Button_Layer_select(void);
void Button_Layer_toggle(void); void Button_Layer_toggle(void);
void Layer_activate(short layer, short side); void Layer_activate(byte layer, short side);

View File

@ -176,7 +176,7 @@ void Redraw_layered_image(void)
{ {
#ifndef NOLAYERS #ifndef NOLAYERS
// Re-construct the image with the visible layers // Re-construct the image with the visible layers
int layer; byte layer;
// First layer // First layer
for (layer=0; layer<Main_backups->Pages->Nb_layers; layer++) for (layer=0; layer<Main_backups->Pages->Nb_layers; layer++)
{ {
@ -950,7 +950,6 @@ void Exchange_main_and_spare(void)
Download_infos_page_main(Main_backups->Pages); Download_infos_page_main(Main_backups->Pages);
Download_infos_backup(Main_backups); Download_infos_backup(Main_backups);
Download_infos_page_spare(Spare_backups->Pages); Download_infos_page_spare(Spare_backups->Pages);
Redraw_layered_image();
} }
void End_of_modification(void) void End_of_modification(void)

View File

@ -56,9 +56,3 @@ byte Restore_brush(int index);
*/ */
void Transparency_set(byte amount); void Transparency_set(byte amount);
void Layer_activate(short layer, short side);
void Special_add_layer(void);
void Special_delete_layer(void);