X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmsdos.c;h=c6c51db6b65912ce03a3aba80d29a877ea9bd4b7;hb=8932f698c0831ab0e4ae2e03d64a48be1aeee82a;hp=cf49ec32a9d57017b92d0e4f4eeea50fa482c237;hpb=5693fe58c10d1472842ebe3fa45fbc9cf3aef5e4;p=rocksndiamonds.git diff --git a/src/libgame/msdos.c b/src/libgame/msdos.c index cf49ec32..c6c51db6 100644 --- a/src/libgame/msdos.c +++ b/src/libgame/msdos.c @@ -1,7 +1,7 @@ /*********************************************************** * Artsoft Retro-Game Library * *----------------------------------------------------------* -* (c) 1994-2000 Artsoft Entertainment * +* (c) 1994-2001 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -311,13 +311,8 @@ Display *XOpenDisplay(char *display_name) screen[0].cmap = 0; screen[0].root = 0; -#if 0 - screen[0].white_pixel = 0xFF; - screen[0].black_pixel = 0x00; -#else screen[0].white_pixel = AllegroAllocColorCell(0xFFFF, 0xFFFF, 0xFFFF); screen[0].black_pixel = AllegroAllocColorCell(0x0000, 0x0000, 0x0000); -#endif screen[0].video_bitmap = NULL; display->default_screen = 0; @@ -510,12 +505,10 @@ static BITMAP *Image_to_AllegroBitmap(Image *image) byte *src_ptr = image->data; byte pixel_mapping[MAX_COLORS]; unsigned int depth = 8; - -#if 0 - int i, j, x, y; -#else int i, x, y; -#endif + + if (image->type == IMAGETYPE_TRUECOLOR && depth == 8) + Error(ERR_EXIT, "cannot handle true-color images on 8-bit display"); /* allocate new allegro bitmap structure */ if ((bitmap = create_bitmap_ex(depth, image->width, image->height)) == NULL) @@ -529,48 +522,12 @@ static BITMAP *Image_to_AllegroBitmap(Image *image) /* try to use existing colors from the global colormap */ for (i=0; irgb.color_used[i]) continue; - -#if 0 - r = image->rgb.red[i] >> 10; - g = image->rgb.green[i] >> 10; - b = image->rgb.blue[i] >> 10; - - for (j=0; jrgb.red[i], image->rgb.green[i], image->rgb.blue[i]); -#endif - } /* copy bitmap data */ @@ -608,17 +565,10 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename, return errno_pcx; *pixmap = (Pixmap)bitmap; -#if 0 - *pixmap_mask = (Pixmap)bitmap; - /* !!! two pointers on same bitmap => second free() fails !!! */ -#else + /* pixmap_mask will never be used in Allegro (which uses masked_blit()), so use non-NULL dummy pointer to empty Pixmap */ - /* - *pixmap_mask = (Pixmap)checked_calloc(sizeof(Pixmap)); - */ *pixmap_mask = (Pixmap)DUMMY_MASK; -#endif return PCX_Success; }