Also save visible layers for spare page
see http://pulkomandy.tk/projects/GrafX2/ticket/25#comment:3
This commit is contained in:
		
							parent
							
								
									8a67da69cc
								
							
						
					
					
						commit
						2928a16e41
					
				@ -1595,6 +1595,7 @@ void Button_Page(void)
 | 
			
		||||
 | 
			
		||||
  SWAP_BYTES (Main_current_layer,Spare_current_layer)
 | 
			
		||||
  SWAP_DWORDS(Main_layers_visible,Spare_layers_visible)
 | 
			
		||||
  SWAP_DWORDS(Main_layers_visible_backup,Spare_layers_visible_backup)
 | 
			
		||||
  
 | 
			
		||||
  SWAP_DWORDS(Main_safety_number,Spare_safety_number)
 | 
			
		||||
  SWAP_DWORDS(Main_edits_since_safety_backup,Spare_edits_since_safety_backup)
 | 
			
		||||
 | 
			
		||||
@ -327,6 +327,8 @@ GFX2_GLOBAL short Main_magnifier_offset_Y;
 | 
			
		||||
GFX2_GLOBAL int 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;
 | 
			
		||||
/// Backup for Main_layers_visible
 | 
			
		||||
GFX2_GLOBAL dword Main_layers_visible_backup;
 | 
			
		||||
/// Index to use next time, when creating incremental backups, to make unique filename.
 | 
			
		||||
GFX2_GLOBAL long Main_safety_number;
 | 
			
		||||
/// Number of edit actions since the last safety backup
 | 
			
		||||
@ -382,6 +384,8 @@ GFX2_GLOBAL short Spare_magnifier_offset_Y;
 | 
			
		||||
GFX2_GLOBAL int 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;
 | 
			
		||||
/// Backup for Spare_layers_visible
 | 
			
		||||
GFX2_GLOBAL dword Spare_layers_visible_backup;
 | 
			
		||||
/// Index to use next time, when creating incremental backups, to make unique filename.
 | 
			
		||||
GFX2_GLOBAL long Spare_safety_number;
 | 
			
		||||
/// Number of edit actions since the last safety backup
 | 
			
		||||
 | 
			
		||||
@ -35,7 +35,6 @@
 | 
			
		||||
void Layer_activate(int layer, short side)
 | 
			
		||||
{
 | 
			
		||||
  dword old_layers;
 | 
			
		||||
  static dword layers_backup_for_toggle = 0xFFFFFFFF;
 | 
			
		||||
 | 
			
		||||
  if (layer >= Main_backups->Pages->Nb_layers)
 | 
			
		||||
    return;
 | 
			
		||||
@ -54,12 +53,12 @@ void Layer_activate(int layer, short side)
 | 
			
		||||
        {
 | 
			
		||||
          // return to previous state (layers that were on before showing
 | 
			
		||||
          // only this one)
 | 
			
		||||
          Main_layers_visible = layers_backup_for_toggle;
 | 
			
		||||
          Main_layers_visible = Main_layers_visible_backup;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
          // Set only this one visible
 | 
			
		||||
          layers_backup_for_toggle = Main_layers_visible;
 | 
			
		||||
          Main_layers_visible_backup = Main_layers_visible;
 | 
			
		||||
          Main_layers_visible = 1<<layer;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -523,8 +523,10 @@ int Init_program(int argc,char * argv[])
 | 
			
		||||
  
 | 
			
		||||
  Main_current_layer=0;
 | 
			
		||||
  Main_layers_visible=0xFFFFFFFF;
 | 
			
		||||
  Main_layers_visible_backup=0xFFFFFFFF;
 | 
			
		||||
  Spare_current_layer=0;
 | 
			
		||||
  Spare_layers_visible=0xFFFFFFFF;
 | 
			
		||||
  Spare_layers_visible_backup=0xFFFFFFFF;
 | 
			
		||||
  
 | 
			
		||||
  Spare_selector.Position=0;
 | 
			
		||||
  Spare_selector.Offset=0;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user