[layers] Picture effects now work

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1043 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-09-26 18:01:25 +00:00
parent b18266e017
commit b534cfd7d4
2 changed files with 41 additions and 15 deletions

View File

@ -598,10 +598,6 @@ void Resize_image(word chosen_width,word chosen_height)
Main_image_is_modified=1;
// On copie donc maintenant la partie C dans la nouvelle image.
//Copy_part_of_image_to_another(
// Screen_backup,0,0,Min(old_width,Main_image_width),
// Min(old_height,Main_image_height),old_width,
// Main_screen,0,0,Main_image_width);
for (i=0; i<NB_LAYERS; i++)
{
Copy_part_of_image_to_another(

View File

@ -377,28 +377,58 @@ void Button_Transform_menu(void)
// Process the transformation:
switch(clicked_button)
{
int i;
case 2 : // Flip X
memcpy(Main_screen,Screen_backup,Main_image_width*Main_image_height);
Flip_X_lowlevel(Main_screen, Main_image_width, Main_image_height);
for (i=0; i<NB_LAYERS; i++)
{
memcpy(Main_backups->Pages->Image[i],Main_backups->Pages->Next->Image[i],Main_image_width*Main_image_height);
Flip_X_lowlevel(Main_backups->Pages->Image[i], Main_image_width, Main_image_height);
}
break;
case 3 : // Flip Y
memcpy(Main_screen,Screen_backup,Main_image_width*Main_image_height);
Flip_Y_lowlevel(Main_screen, Main_image_width, Main_image_height);
for (i=0; i<NB_LAYERS; i++)
{
memcpy(Main_backups->Pages->Image[i],Main_backups->Pages->Next->Image[i],Main_image_width*Main_image_height);
Flip_Y_lowlevel(Main_backups->Pages->Image[i], Main_image_width, Main_image_height);
}
break;
case 4 : // -90° Rotation
Rotate_270_deg_lowlevel(Screen_backup, Main_screen, old_width, old_height);
for (i=0; i<NB_LAYERS; i++)
{
Rotate_270_deg_lowlevel(Main_backups->Pages->Next->Image[i], Main_backups->Pages->Image[i], old_width, old_height);
}
break;
case 5 : // +90° Rotation
Rotate_90_deg_lowlevel(Screen_backup, Main_screen, old_width, old_height);
for (i=0; i<NB_LAYERS; i++)
{
Rotate_90_deg_lowlevel(Main_backups->Pages->Next->Image[i], Main_backups->Pages->Image[i], old_width, old_height);
}
break;
case 6 : // 180° Rotation
memcpy(Main_screen,Screen_backup,Main_image_width*Main_image_height);
Rotate_180_deg_lowlevel(Main_screen, Main_image_width, Main_image_height);
for (i=0; i<NB_LAYERS; i++)
{
memcpy(Main_backups->Pages->Image[i],Main_backups->Pages->Next->Image[i],Main_image_width*Main_image_height);
Rotate_180_deg_lowlevel(Main_backups->Pages->Image[i], Main_image_width, Main_image_height);
}
break;
case 7 : // Resize
Rescale(Screen_backup, old_width, old_height, Main_screen, Main_image_width, Main_image_height, 0, 0);
for (i=0; i<NB_LAYERS; i++)
{
Rescale(Main_backups->Pages->Next->Image[i], old_width, old_height, Main_backups->Pages->Image[i], Main_image_width, Main_image_height, 0, 0);
}
break;
}
/*
for (i=0; i<NB_LAYERS; i++)
{
Copy_part_of_image_to_another(
Main_backups->Pages->Next->Image[i],0,0,Min(old_width,Main_image_width),
Min(old_height,Main_image_height),old_width,
Main_backups->Pages->Image[i],0,0,Main_image_width);
}
*/
Redraw_layered_image();
Display_all_screen();
}
else