| version 1.5 | | version 1.6 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_xutil_c = | | * static char *rcsid_xutil_c = |
| * "$Id: xutil.c,v 1.5 2002/03/26 08:15:57 mwedel Exp $"; | | * "$Id: xutil.c,v 1.6 2002/03/27 07:56:53 mwedel Exp $"; |
| */ | | */ |
| /* | | /* |
| Crossfire client, a client program for the crossfire program. | | Crossfire client, a client program for the crossfire program. |
| | |
| void init_cache_data() | | void init_cache_data() |
| { | | { |
| int i; | | int i; |
| | | Pixmap ptmp; |
| #include "pixmaps/question.111" | | #include "pixmaps/question.111" |
| | | |
| | | |
| /* Currently, we can cache in all face modes currently supported, | | /* Currently, we can cache in all face modes currently supported, |
| * so I removed the code that did checks on that. | | * so I removed the code that did checks on that. |
| */ | | */ |
| | | |
| pixmaps[0] = malloc(sizeof(struct PixmapInfo)); | | pixmaps[0] = malloc(sizeof(struct PixmapInfo)); |
| pixmaps[0]->mask=None; | | pixmaps[0]->mask=None; |
| pixmaps[0]->bitmap=XCreateBitmapFromData(display,DefaultRootWindow(display), | | ptmp=XCreateBitmapFromData(display,DefaultRootWindow(display), |
| question_bits,question_width,question_height); | | question_bits,question_width,question_height); |
| | | |
| /* In xpm mode, XCopyArea is used from this data, so we need to copy | | /* In xpm mode, XCopyArea is used from this data, so we need to copy |
| | |
| */ | | */ |
| pixmaps[0]->pixmap=XCreatePixmap(display, win_root, image_size, image_size, | | pixmaps[0]->pixmap=XCreatePixmap(display, win_root, image_size, image_size, |
| DefaultDepth(display,DefaultScreen(display))); | | DefaultDepth(display,DefaultScreen(display))); |
| XCopyPlane(display, pixmaps[0]->bitmap, pixmaps[0]->pixmap, gc_game, | | XCopyPlane(display, ptmp, pixmaps[0]->pixmap, gc_game, |
| 0,0,image_size,image_size,0,0,1); | | 0,0,image_size,image_size,0,0,1); |
| | | XFreePixmap(display, ptmp); |
| | | |
| pixmaps[0]->bg = 0; | | |
| pixmaps[0]->fg = 1; | | |
| facetoname[0]=NULL; | | facetoname[0]=NULL; |
| | | |
| /* Initialize all the images to be of the same value. */ | | /* Initialize all the images to be of the same value. */ |
| | |
| facetoname[i]=NULL; | | facetoname[i]=NULL; |
| } | | } |
| | | |
| sprintf(facecachedir,"%s/.crossfire/images", getenv("HOME")); | | init_common_cache_data(); |
| | | |
| if (make_path_to_dir(facecachedir)==-1) { | | |
| fprintf(stderr,"Could not create directory %s, exiting\n", facecachedir); | | |
| exit(1); | | |
| } | | |
| | | |
| } | | } |
| #endif | | #endif |
| | |
| } | | } |
| } | | } |
| } | | } |
| | | |
| | | void image_update_download_status(int start, int end, int total) |
| | | { |
| | | char buf[MAX_BUF]; |
| | | |
| | | sprintf(buf,"Downloaded %d of %d images", start, total); |
| | | |
| | | draw_info(buf,NDI_BLUE); |
| | | } |