CPC Mode 5 fixes :
* Be case unsensitive when looking for the GFX-file, * When an underlay is hidden, do not use it and replace it with color 0, 1, 2 or 3. Allows to see pixel data alone or disable rasters on one color, as it's possible to get confused quite easily. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1964 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
ba46f1fd21
commit
b437d458d4
@ -3143,7 +3143,8 @@ void Pixel_in_screen_overlay(word x,word y,byte color)
|
||||
// Paste in depth buffer
|
||||
*(Main_visible_image_depth_buffer.Image+x+y*Main_image_width)=color;
|
||||
// Fetch pixel color from the target raster layer
|
||||
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||
if (Main_layers_visible & (1 << color))
|
||||
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||
// Draw that color on the visible image buffer
|
||||
*(x+y*Main_image_width+Main_screen)=color;
|
||||
}
|
||||
@ -3159,7 +3160,8 @@ void Pixel_in_screen_overlay_with_preview(word x,word y,byte color)
|
||||
// Paste in depth buffer
|
||||
*(Main_visible_image_depth_buffer.Image+x+y*Main_image_width)=color;
|
||||
// Fetch pixel color from the target raster layer
|
||||
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||
if (Main_layers_visible & (1 << color))
|
||||
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||
// Draw that color on the visible image buffer
|
||||
*(x+y*Main_image_width+Main_screen)=color;
|
||||
|
||||
|
||||
@ -3101,14 +3101,25 @@ void Load_CM5(T_IO_Context* context)
|
||||
fclose(file);
|
||||
|
||||
// Load the pixeldata to the 5th layer
|
||||
filename[strlen(filename) - 3] = 0;
|
||||
strcat(filename,"gfx");
|
||||
if (!(file = fopen(filename, "rb")))
|
||||
{
|
||||
File_error = 1;
|
||||
return;
|
||||
}
|
||||
char* ext = filename + strlen(filename) - 3;
|
||||
int idx = 8;
|
||||
do {
|
||||
if (-- idx < 0)
|
||||
{
|
||||
File_error = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
ext[0] = (idx & 1) ? 'g':'G';
|
||||
ext[1] = (idx & 2) ? 'f':'F';
|
||||
ext[2] = (idx & 4) ? 'x':'X';
|
||||
|
||||
printf("trying to load %s...\n", filename);
|
||||
|
||||
file = fopen(filename, "rb");
|
||||
} while(file == NULL);
|
||||
}
|
||||
Set_loading_layer(context, 4);
|
||||
|
||||
for (ty = 0; ty < 256; ty++)
|
||||
|
||||
@ -212,7 +212,10 @@ void Redraw_layered_image(void)
|
||||
for (i=0; i< Main_image_width*Main_image_height; i++)
|
||||
{
|
||||
layer = *(Main_backups->Pages->Image[4].Pixels+i);
|
||||
Main_visible_image.Image[i]=*(Main_backups->Pages->Image[layer].Pixels+i);
|
||||
if (Main_layers_visible & (1 << layer))
|
||||
Main_visible_image.Image[i]=*(Main_backups->Pages->Image[layer].Pixels+i);
|
||||
else
|
||||
Main_visible_image.Image[i] = layer;
|
||||
}
|
||||
|
||||
// Copy it to the depth buffer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user