[layers] Sped up the scrolling/adjusting of single layers. Speed is no longer relative to the number of visible layers. Pulkomandy, your idea of depth buffer was genius.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1047 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
473679ce29
commit
61f0a4ec71
@ -3975,7 +3975,8 @@ void Scroll_12_5(void)
|
|||||||
{
|
{
|
||||||
// One layer at once
|
// One layer at once
|
||||||
Scroll_picture(Main_backups->Pages->Next->Image[Main_current_layer], Main_backups->Pages->Image[Main_current_layer], x_offset, y_offset);
|
Scroll_picture(Main_backups->Pages->Next->Image[Main_current_layer], Main_backups->Pages->Image[Main_current_layer], x_offset, y_offset);
|
||||||
Redraw_layered_image();
|
//Redraw_layered_image();
|
||||||
|
Redraw_current_layer();
|
||||||
}
|
}
|
||||||
|
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
|
|||||||
21
pages.c
21
pages.c
@ -191,6 +191,27 @@ void Redraw_layered_image(void)
|
|||||||
Download_infos_backup(Main_backups);
|
Download_infos_backup(Main_backups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Redraw_current_layer(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0; i<Main_image_width*Main_image_height; i++)
|
||||||
|
{
|
||||||
|
byte depth = *(Visible_image_depth_buffer.Image+i);
|
||||||
|
if (depth<=Main_current_layer)
|
||||||
|
{
|
||||||
|
byte color = *(Main_backups->Pages->Image[Main_current_layer]+i);
|
||||||
|
if (color != 0) /* transp color */
|
||||||
|
{
|
||||||
|
*(Visible_image[0].Image+i) = color;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*(Visible_image[0].Image+i) = *(Main_backups->Pages->Image[depth]+i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Upload_infos_page_main(T_Page * page)
|
void Upload_infos_page_main(T_Page * page)
|
||||||
// Sauve l'écran courant dans la page
|
// Sauve l'écran courant dans la page
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user