Pre_load() sets context->Width & context->Height
This commit is contained in:
parent
266b092f63
commit
7f91480dbb
@ -1618,9 +1618,6 @@ void Load_PPH(T_IO_Context* context)
|
||||
|
||||
Pre_load(context, width, height, file_size, FORMAT_PPH, context->Ratio, 0);
|
||||
|
||||
context->Width = width;
|
||||
context->Height = height;
|
||||
|
||||
// First of all, detect the mode
|
||||
// 0, 1, 2 > Load as with SCR files?
|
||||
// R(3) > Load as single layer, square pixels, 16 colors
|
||||
|
||||
@ -128,9 +128,6 @@ void Load_IMG(T_IO_Context * context)
|
||||
{
|
||||
memcpy(context->Palette,IMG_header.Palette,sizeof(T_Palette));
|
||||
|
||||
context->Width=IMG_header.Width;
|
||||
context->Height=IMG_header.Height;
|
||||
|
||||
for (y_pos=0;(y_pos<context->Height) && (!File_error);y_pos++)
|
||||
{
|
||||
if (Read_bytes(file,buffer,context->Width))
|
||||
@ -3292,14 +3289,14 @@ void Load_PCX(T_IO_Context * context)
|
||||
Read_word_le(file,&(PCX_header.Screen_Y)) &&
|
||||
Read_bytes(file,&(PCX_header.Filler),54) )
|
||||
{
|
||||
|
||||
context->Width=PCX_header.X_max-PCX_header.X_min+1;
|
||||
context->Height=PCX_header.Y_max-PCX_header.Y_min+1;
|
||||
Pre_load(context,
|
||||
PCX_header.X_max - PCX_header.X_min + 1,
|
||||
PCX_header.Y_max - PCX_header.Y_min + 1,
|
||||
file_size, FORMAT_PCX, PIXEL_SIMPLE,
|
||||
PCX_header.Plane * PCX_header.Depth);
|
||||
|
||||
Original_screen_X=PCX_header.Screen_X;
|
||||
Original_screen_Y=PCX_header.Screen_Y;
|
||||
|
||||
Pre_load(context, context->Width, context->Height, file_size, FORMAT_PCX, PIXEL_SIMPLE, PCX_header.Plane * PCX_header.Depth);
|
||||
Original_screen_X = PCX_header.Screen_X;
|
||||
Original_screen_Y = PCX_header.Screen_Y;
|
||||
|
||||
if (!(PCX_header.Plane==3 && PCX_header.Depth==8))
|
||||
{
|
||||
|
||||
@ -574,8 +574,6 @@ void Load_PKM(T_IO_Context * context)
|
||||
if (File_error==0)
|
||||
{
|
||||
|
||||
context->Width=header.Width;
|
||||
context->Height=header.Height;
|
||||
image_size=(dword)(context->Width*context->Height);
|
||||
// Palette lue en 64
|
||||
memcpy(context->Palette,header.Palette,sizeof(T_Palette));
|
||||
@ -945,13 +943,12 @@ void Load_CEL(T_IO_Context * context)
|
||||
&& ( (((header1.Width+1)>>1)*header1.Height)==(file_size-header_size) ) )
|
||||
{
|
||||
// Chargement d'un fichier CEL sans signature (vieux fichiers)
|
||||
context->Width=header1.Width;
|
||||
context->Height=header1.Height;
|
||||
Original_screen_X=context->Width;
|
||||
Original_screen_Y=context->Height;
|
||||
Pre_load(context, context->Width,context->Height,file_size,FORMAT_CEL,PIXEL_SIMPLE,0);
|
||||
Pre_load(context, header1.Width, header1.Height,
|
||||
file_size, FORMAT_CEL, PIXEL_SIMPLE, 0);
|
||||
if (File_error==0)
|
||||
{
|
||||
Original_screen_X = context->Width;
|
||||
Original_screen_Y = context->Height;
|
||||
// Chargement de l'image
|
||||
/*Init_lecture();*/
|
||||
for (y_pos=0;((y_pos<context->Height) && (!File_error));y_pos++)
|
||||
@ -984,13 +981,14 @@ void Load_CEL(T_IO_Context * context)
|
||||
{
|
||||
// Chargement d'un fichier CEL avec signature (nouveaux fichiers)
|
||||
|
||||
context->Width=header2.Width+header2.X_offset;
|
||||
context->Height=header2.Height+header2.Y_offset;
|
||||
Original_screen_X=context->Width;
|
||||
Original_screen_Y=context->Height;
|
||||
Pre_load(context, context->Width,context->Height,file_size,FORMAT_CEL,PIXEL_SIMPLE,0);
|
||||
Pre_load(context,
|
||||
header2.Width + header2.X_offset,
|
||||
header2.Height + header2.Y_offset,
|
||||
file_size, FORMAT_CEL, PIXEL_SIMPLE, 0);
|
||||
if (File_error==0)
|
||||
{
|
||||
Original_screen_X = context->Width;
|
||||
Original_screen_Y = context->Height;
|
||||
// Chargement de l'image
|
||||
/*Init_lecture();*/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user