/* allocate new allegro bitmap structure */
if ((bitmap = create_bitmap_ex(depth, image->width, image->height)) == NULL)
+ {
+ errno_pcx = PCX_NoMemory;
return NULL;
+ }
clear(bitmap);
/* read the graphic file in PCX format to internal image structure */
if ((image = Read_PCX_to_Image(filename)) == NULL)
- {
- Error(ERR_RETURN, "Read_PCX_to_Image failed");
return NULL;
- }
/* convert internal image structure to allegro bitmap structure */
if ((bitmap = Image_to_AllegroBitmap(image)) == NULL)
- {
- Error(ERR_RETURN, "Image_to_AllegroBitmap failed");
return NULL;
- }
set_palette(global_colormap);
BITMAP *bitmap;
if ((bitmap = Read_PCX_to_AllegroBitmap(filename)) == NULL)
- return PCX_FileInvalid;
+ return errno_pcx;
*pixmap = (Pixmap)bitmap;
*pixmap_mask = (Pixmap)bitmap;
return PCX_Success;
}
-int XpmReadFileToPixmap(Display *display, Drawable d, char *filename,
- Pixmap *pixmap_return, Pixmap *shapemask_return,
- XpmAttributes *attributes)
-{
- BITMAP *bitmap;
-
- if ((bitmap = Read_PCX_to_AllegroBitmap(filename)) == NULL)
- return XpmOpenFailed;
-
- *pixmap_return = (Pixmap)bitmap;
-
- return XpmSuccess;
-}
-
int XReadBitmapFile(Display *display, Drawable d, char *filename,
unsigned int *width_return, unsigned int *height_return,
Pixmap *bitmap_return,