Import the WIP CPC-Mode5 code from the sourcearchive

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1718 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2011-02-13 21:20:45 +00:00
parent b42bd0afad
commit 4e60f5ad74
18 changed files with 1031 additions and 154 deletions

View File

@@ -178,25 +178,47 @@ void Redraw_layered_image(void)
{
#ifndef NOLAYERS
// Re-construct the image with the visible layers
byte layer;
byte layer=0;
// First layer
for (layer=0; layer<Main_backups->Pages->Nb_layers; layer++)
if (Main_layers_visible & (1<<4))
{
if ((1<<layer) & Main_layers_visible)
// The raster result layer is visible: start there
// Copy it in Main_visible_image
int i;
for (i=0; i< Main_image_width*Main_image_height; i++)
{
// Copy it in Main_visible_image
memcpy(Main_visible_image.Image,
Main_backups->Pages->Image[layer],
Main_image_width*Main_image_height);
// Initialize the depth buffer
memset(Main_visible_image_depth_buffer.Image,
layer,
Main_image_width*Main_image_height);
// skip all other layers
layer++;
break;
layer = *(Main_backups->Pages->Image[4]+i);
Main_visible_image.Image[i]=*(Main_backups->Pages->Image[layer]+i);
}
// Copy it to the depth buffer
memcpy(Main_visible_image_depth_buffer.Image,
Main_backups->Pages->Image[4],
Main_image_width*Main_image_height);
// Next
layer= (1<<4)+1;
}
else
{
for (layer=0; layer<Main_backups->Pages->Nb_layers; layer++)
{
if ((1<<layer) & Main_layers_visible)
{
// Copy it in Main_visible_image
memcpy(Main_visible_image.Image,
Main_backups->Pages->Image[layer],
Main_image_width*Main_image_height);
// Initialize the depth buffer
memset(Main_visible_image_depth_buffer.Image,
layer,
Main_image_width*Main_image_height);
// skip all other layers
layer++;
break;
}
}
}
// subsequent layer(s)