Working layer bar. Champagne!

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1193 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-11-15 19:24:04 +00:00
parent 353f5dbbd2
commit 883653480b
10 changed files with 234 additions and 332 deletions

View File

@@ -469,65 +469,4 @@ void Transparency_set(byte amount)
Compute_colorize_table();
}
void Layer_activate(short layer, short side)
{
word old_layers;
if (layer >= Main_backups->Pages->Nb_layers)
return;
// Keep a copy of which layers were visible
old_layers = Main_layers_visible;
#ifndef NOLAYERS
if (side == RIGHT_SIDE)
{
// Right-click on current layer
if (Main_current_layer == layer)
{
if (Main_layers_visible == (dword)(1<<layer))
{
// Set all layers visible
Main_layers_visible = 0xFFFFFFFF;
}
else
{
// Set only this one visible
Main_layers_visible = 1<<layer;
}
}
else
{
// Right-click on an other layer : toggle its visibility
Main_layers_visible ^= 1<<layer;
}
}
else
{
// Left-click on any layer
Main_current_layer = layer;
Main_layers_visible |= 1<<layer;
}
#else
// Handler for limited layers support: only allow one visible at a time
if (side == LEFT_SIDE)
{
Main_current_layer = layer;
Main_layers_visible = 1<<layer;
Update_screen_targets();
}
#endif
Hide_cursor();
if (Main_layers_visible != old_layers)
Redraw_layered_image();
else
Update_depth_buffer(); // Only need the depth buffer
//Download_infos_page_main(Main_backups->Pages);
//Download_infos_backup(Main_backups);
Display_all_screen();
Display_cursor();
}