WIP: "Load" button in Palette Dialog
see http://pulkomandy.tk/projects/GrafX2/ticket/24 still some issues : 1) UI color remapping 2) File type selector (need to add a Palette selector in addition to the Main and Brush selector)
This commit is contained in:
parent
ccf3e6a77f
commit
2d26bb8a1f
@ -1436,6 +1436,8 @@ byte Button_Load_or_Save(T_Selector_settings *settings, byte load, T_IO_Context
|
|||||||
{
|
{
|
||||||
if (context->Type == CONTEXT_MAIN_IMAGE)
|
if (context->Type == CONTEXT_MAIN_IMAGE)
|
||||||
Open_window(310,200,"Load picture");
|
Open_window(310,200,"Load picture");
|
||||||
|
else if (context->Type == CONTEXT_PALETTE)
|
||||||
|
Open_window(310,200,"Load palette");
|
||||||
else
|
else
|
||||||
Open_window(310,200,"Load brush");
|
Open_window(310,200,"Load brush");
|
||||||
Window_set_normal_button(198,180,51,14,"Load",0,1,SDLK_RETURN); // 1
|
Window_set_normal_button(198,180,51,14,"Load",0,1,SDLK_RETURN); // 1
|
||||||
|
|||||||
@ -855,6 +855,18 @@ void Load_image(T_IO_Context *context)
|
|||||||
Download_infos_page_main(Main.backups->Pages);
|
Download_infos_page_main(Main.backups->Pages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (context->Type == CONTEXT_PALETTE)
|
||||||
|
{
|
||||||
|
if ( File_error!=1)
|
||||||
|
{
|
||||||
|
Set_palette(context->Palette);
|
||||||
|
// Make a backup step
|
||||||
|
Backup_layers(LAYER_NONE);
|
||||||
|
// Copy the loaded palette
|
||||||
|
memcpy(Main_palette, context->Palette, sizeof(T_Palette));
|
||||||
|
//memcpy(Main_backups->Pages->Palette, context->Palette, sizeof(T_Palette));
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (context->Type == CONTEXT_BRUSH && File_error==0)
|
else if (context->Type == CONTEXT_BRUSH && File_error==0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -2612,7 +2612,13 @@ void Button_Palette(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 26: // Load palette (TODO)
|
case 26: // Load palette
|
||||||
|
memcpy(backup_palette, Main_palette, sizeof(T_Palette));
|
||||||
|
Load_picture(CONTEXT_PALETTE);
|
||||||
|
memcpy(working_palette, Main_palette, sizeof(T_Palette));
|
||||||
|
memcpy(temp_palette,working_palette,sizeof(T_Palette));
|
||||||
|
memcpy(Main_palette, backup_palette, sizeof(T_Palette));
|
||||||
|
need_to_remap=1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 27: // Save palette
|
case 27: // Save palette
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user