1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-98 Artsoft Entertainment *
8 * phone: ++49 +521 290471 *
9 * email: aeglos@valinor.owl.de *
10 *----------------------------------------------------------*
12 ***********************************************************/
27 struct PictureFileInfo
29 char *picture_filename;
30 boolean picture_with_mask;
35 char *picture_filename;
36 char *picturemask_filename;
39 static int sound_process_id = 0;
41 static void InitLevelAndPlayerInfo(void);
42 static void InitNetworkServer(void);
43 static void InitDisplay(void);
44 static void InitSound(void);
45 static void InitSoundServer(void);
46 static void InitWindow(int, char **);
47 static void InitGfx(void);
48 static void LoadGfx(int, struct PictureFileInfo *);
49 static void InitElementProperties(void);
51 void OpenAll(int argc, char *argv[])
53 if (options.serveronly)
55 NetworkServer(options.server_port, options.serveronly);
61 InitLevelAndPlayerInfo();
67 InitRND(NEW_RANDOMIZE);
69 signal(SIGINT, CloseAllAndExit);
70 signal(SIGTERM, CloseAllAndExit);
73 InitWindow(argc, argv);
75 XMapWindow(display, window);
79 InitElementProperties();
86 void InitLevelAndPlayerInfo()
90 /* choose default local player */
91 local_player = &stored_player[0];
93 for (i=0; i<MAX_PLAYERS; i++)
95 stored_player[i].joystick_fd = -1; /* joystick device closed */
96 stored_player[i].connected = FALSE;
99 local_player->connected = TRUE;
101 LoadLevelInfo(); /* global level info */
102 LoadSetup(); /* global setup info */
103 LoadLevelSetup(); /* info about last played level */
106 void InitNetworkServer()
110 if (!options.network)
113 nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED);
115 if (!ConnectToServer(options.server_host, options.server_port))
116 Error(ERR_EXIT, "cannot connect to multiplayer server");
118 SendToServer_Nickname(setup.player_name);
119 SendToServer_ProtocolVersion();
122 SendToServer_NrWanted(nr_wanted);
129 if (sound_status == SOUND_OFF)
133 if (access(sound_device_name, W_OK) != 0)
135 Error(ERR_WARN, "cannot access sound device - no sounds");
136 sound_status = SOUND_OFF;
140 if ((sound_device = open(sound_device_name,O_WRONLY))<0)
142 Error(ERR_WARN, "cannot open sound device - no sounds");
143 sound_status = SOUND_OFF;
148 sound_status = SOUND_AVAILABLE;
151 sound_loops_allowed = TRUE;
154 setup.sound_loops_on = TRUE;
159 sound_loops_allowed = TRUE;
162 setup.sound_loops_on = TRUE;
167 for(i=0; i<NUM_SOUNDS; i++)
170 sprintf(sound_name[i], "%d", i+1);
172 Sound[i].name = sound_name[i];
173 if (!LoadSound(&Sound[i]))
175 sound_status = SOUND_OFF;
181 void InitSoundServer()
183 if (sound_status == SOUND_OFF)
187 if (pipe(sound_pipe)<0)
189 Error(ERR_WARN, "cannot create pipe - no sounds");
190 sound_status = SOUND_OFF;
194 if ((sound_process_id = fork()) < 0)
196 Error(ERR_WARN, "cannot create sound server process - no sounds");
197 sound_status = SOUND_OFF;
201 if (!sound_process_id) /* we are child */
208 else /* we are parent */
209 close(sound_pipe[0]); /* no reading from pipe needed */
219 if (global_joystick_status == JOYSTICK_OFF)
222 joystick_status = JOYSTICK_OFF;
225 for (i=0; i<MAX_PLAYERS; i++)
227 char *device_name = setup.input[i].joy.device_name;
229 /* this allows subsequent calls to 'InitJoysticks' for re-initialization */
230 if (stored_player[i].joystick_fd != -1)
232 close(stored_player[i].joystick_fd);
233 stored_player[i].joystick_fd = -1;
236 if (!setup.input[i].use_joystick)
239 if (access(device_name, R_OK) != 0)
241 Error(ERR_WARN, "cannot access joystick device '%s'", device_name);
245 if ((stored_player[i].joystick_fd = open(device_name, O_RDONLY)) < 0)
247 Error(ERR_WARN, "cannot open joystick device '%s'", device_name);
251 joystick_status = JOYSTICK_AVAILABLE;
254 joystick_status = JOYSTICK_AVAILABLE;
260 XVisualInfo vinfo_template, *vinfo;
264 /* connect to X server */
265 if (!(display = XOpenDisplay(options.display_name)))
266 Error(ERR_EXIT, "cannot connect to X server %s",
267 XDisplayName(options.display_name));
269 screen = DefaultScreen(display);
270 visual = DefaultVisual(display, screen);
271 depth = DefaultDepth(display, screen);
272 cmap = DefaultColormap(display, screen);
274 /* look for good enough visual */
275 vinfo_template.screen = screen;
276 vinfo_template.class = (depth == 8 ? PseudoColor : TrueColor);
277 vinfo_template.depth = depth;
278 if ((vinfo = XGetVisualInfo(display, VisualScreenMask | VisualClassMask |
279 VisualDepthMask, &vinfo_template, &num_visuals)))
281 visual = vinfo->visual;
282 XFree((void *)vinfo);
285 /* got appropriate visual? */
288 printf("Sorry, displays with less than 8 bits per pixel not supported.\n");
291 else if ((depth ==8 && visual->class != PseudoColor) ||
292 (depth > 8 && visual->class != TrueColor &&
293 visual->class != DirectColor))
295 printf("Sorry, cannot get appropriate visual.\n");
300 void InitWindow(int argc, char *argv[])
302 unsigned int border_width = 4;
303 Pixmap icon_pixmap, iconmask_pixmap;
304 unsigned int icon_width,icon_height;
305 int icon_hot_x,icon_hot_y;
306 char icon_filename[256];
307 XSizeHints size_hints;
309 XClassHint class_hints;
310 XTextProperty windowName, iconName;
312 unsigned long gc_valuemask;
313 char *window_name = WINDOWTITLE_STRING;
314 char *icon_name = WINDOWTITLE_STRING;
315 long window_event_mask;
316 Atom proto_atom = None, delete_atom = None;
317 int screen_width, screen_height;
318 int win_xpos = WIN_XPOS, win_ypos = WIN_YPOS;
319 unsigned long pen_fg = WhitePixel(display,screen);
320 unsigned long pen_bg = BlackPixel(display,screen);
321 const int width = WIN_XSIZE, height = WIN_YSIZE;
324 static struct IconFileInfo icon_pic =
331 screen_width = XDisplayWidth(display, screen);
332 screen_height = XDisplayHeight(display, screen);
334 win_xpos = (screen_width - width) / 2;
335 win_ypos = (screen_height - height) / 2;
337 window = XCreateSimpleWindow(display, RootWindow(display, screen),
338 win_xpos, win_ypos, width, height, border_width,
342 proto_atom = XInternAtom(display, "WM_PROTOCOLS", FALSE);
343 delete_atom = XInternAtom(display, "WM_DELETE_WINDOW", FALSE);
344 if ((proto_atom != None) && (delete_atom != None))
345 XChangeProperty(display, window, proto_atom, XA_ATOM, 32,
346 PropModePrepend, (unsigned char *) &delete_atom, 1);
348 sprintf(icon_filename, "%s/%s/%s",
349 options.base_directory, GRAPHICS_DIRECTORY,
350 icon_pic.picture_filename);
351 XReadBitmapFile(display,window,icon_filename,
352 &icon_width,&icon_height,
353 &icon_pixmap,&icon_hot_x,&icon_hot_y);
355 Error(ERR_EXIT, "cannot read icon bitmap file '%s'", icon_filename);
357 sprintf(icon_filename, "%s/%s/%s",
358 options.base_directory, GRAPHICS_DIRECTORY,
359 icon_pic.picturemask_filename);
360 XReadBitmapFile(display,window,icon_filename,
361 &icon_width,&icon_height,
362 &iconmask_pixmap,&icon_hot_x,&icon_hot_y);
363 if (!iconmask_pixmap)
364 Error(ERR_EXIT, "cannot read icon bitmap file '%s'", icon_filename);
366 size_hints.width = size_hints.min_width = size_hints.max_width = width;
367 size_hints.height = size_hints.min_height = size_hints.max_height = height;
368 size_hints.flags = PSize | PMinSize | PMaxSize;
370 if (win_xpos || win_ypos)
372 size_hints.x = win_xpos;
373 size_hints.y = win_ypos;
374 size_hints.flags |= PPosition;
377 if (!XStringListToTextProperty(&window_name, 1, &windowName))
378 Error(ERR_EXIT, "structure allocation for windowName failed");
380 if (!XStringListToTextProperty(&icon_name, 1, &iconName))
381 Error(ERR_EXIT, "structure allocation for iconName failed");
383 wm_hints.initial_state = NormalState;
384 wm_hints.input = True;
385 wm_hints.icon_pixmap = icon_pixmap;
386 wm_hints.icon_mask = iconmask_pixmap;
387 wm_hints.flags = StateHint | IconPixmapHint | IconMaskHint | InputHint;
389 class_hints.res_name = program_name;
390 class_hints.res_class = "Rocks'n'Diamonds";
392 XSetWMProperties(display, window, &windowName, &iconName,
393 argv, argc, &size_hints, &wm_hints,
396 XFree(windowName.value);
397 XFree(iconName.value);
399 /* Select event types wanted */
400 window_event_mask = ExposureMask | StructureNotifyMask | FocusChangeMask |
401 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
402 KeyPressMask | KeyReleaseMask;
403 XSelectInput(display, window, window_event_mask);
406 /* create GC for drawing with window depth */
407 gc_values.graphics_exposures = False;
408 gc_values.foreground = pen_bg;
409 gc_values.background = pen_bg;
410 gc_valuemask = GCGraphicsExposures | GCForeground | GCBackground;
411 gc = XCreateGC(display, window, gc_valuemask, &gc_values);
414 void DrawInitText(char *text, int ypos, int color)
416 if (display && window && pix[PIX_SMALLFONT])
418 XFillRectangle(display,window,gc,0,ypos, WIN_XSIZE,FONT2_YSIZE);
419 DrawTextExt(window,gc,(WIN_XSIZE-strlen(text)*FONT2_XSIZE)/2,
420 ypos,text,FS_SMALL,color);
429 XGCValues clip_gc_values;
430 unsigned long clip_gc_valuemask;
433 static struct PictureFileInfo pic[NUM_PICTURES] =
443 static struct PictureFileInfo pic[NUM_PICTURES] =
445 { "RocksScreen", TRUE },
446 { "RocksDoor", TRUE },
447 { "RocksHeroes", TRUE },
448 { "RocksToons", TRUE },
449 { "RocksFont", FALSE },
450 { "RocksFont2", FALSE }
459 tile_needs_clipping[] =
461 { GFX_SPIELER1_UP, 4 },
462 { GFX_SPIELER1_DOWN, 4 },
463 { GFX_SPIELER1_LEFT, 4 },
464 { GFX_SPIELER1_RIGHT, 4 },
465 { GFX_SPIELER1_PUSH_LEFT, 4 },
466 { GFX_SPIELER1_PUSH_RIGHT, 4 },
467 { GFX_SPIELER2_UP, 4 },
468 { GFX_SPIELER2_DOWN, 4 },
469 { GFX_SPIELER2_LEFT, 4 },
470 { GFX_SPIELER2_RIGHT, 4 },
471 { GFX_SPIELER2_PUSH_LEFT, 4 },
472 { GFX_SPIELER2_PUSH_RIGHT, 4 },
473 { GFX_SPIELER3_UP, 4 },
474 { GFX_SPIELER3_DOWN, 4 },
475 { GFX_SPIELER3_LEFT, 4 },
476 { GFX_SPIELER3_RIGHT, 4 },
477 { GFX_SPIELER3_PUSH_LEFT, 4 },
478 { GFX_SPIELER3_PUSH_RIGHT, 4 },
479 { GFX_SPIELER4_UP, 4 },
480 { GFX_SPIELER4_DOWN, 4 },
481 { GFX_SPIELER4_LEFT, 4 },
482 { GFX_SPIELER4_RIGHT, 4 },
483 { GFX_SPIELER4_PUSH_LEFT, 4 },
484 { GFX_SPIELER4_PUSH_RIGHT, 4 },
485 { GFX_GEBLUBBER, 4 },
488 { GFX_EXPLOSION, 8 },
489 { GFX_SOKOBAN_OBJEKT, 1 },
490 { GFX_FUNKELN_BLAU, 3 },
491 { GFX_FUNKELN_WEISS, 3 },
496 debug_print_timestamp(0, NULL); /* initialize timestamp function */
499 LoadGfx(PIX_SMALLFONT,&pic[PIX_SMALLFONT]);
500 DrawInitText(WINDOWTITLE_STRING,20,FC_YELLOW);
501 DrawInitText(COPYRIGHT_STRING,50,FC_RED);
503 DrawInitText("MSDOS version done by Guido Schulz",210,FC_BLUE);
506 DrawInitText("Loading graphics:",120,FC_GREEN);
508 for(i=0; i<NUM_PICTURES; i++)
509 if (i != PIX_SMALLFONT)
513 debug_print_timestamp(0, "SUMMARY LOADING ALL GRAPHICS:");
516 pix[PIX_DB_BACK] = XCreatePixmap(display, window,
518 XDefaultDepth(display,screen));
519 pix[PIX_DB_DOOR] = XCreatePixmap(display, window,
520 3*DXSIZE,DYSIZE+VYSIZE,
521 XDefaultDepth(display,screen));
522 pix[PIX_DB_FIELD] = XCreatePixmap(display, window,
524 XDefaultDepth(display,screen));
526 clip_gc_values.graphics_exposures = False;
527 clip_gc_valuemask = GCGraphicsExposures;
529 XCreateGC(display,clipmask[PIX_BACK],clip_gc_valuemask,&clip_gc_values);
531 clip_gc_values.graphics_exposures = False;
532 clip_gc_valuemask = GCGraphicsExposures;
534 XCreateGC(display,window,clip_gc_valuemask,&clip_gc_values);
536 /* initialize pixmap array to Pixmap 'None' */
537 for(i=0; i<NUM_TILES; i++)
538 tile_clipmask[i] = None;
540 /* create only those clipping Pixmaps we really need */
541 for(i=0; tile_needs_clipping[i].start>=0; i++)
543 for(j=0; j<tile_needs_clipping[i].count; j++)
545 int tile = tile_needs_clipping[i].start + j;
550 if (graphic >= GFX_START_ROCKSSCREEN &&
551 graphic <= GFX_END_ROCKSSCREEN)
553 src_pixmap = clipmask[PIX_BACK];
554 graphic -= GFX_START_ROCKSSCREEN;
555 src_x = SX + (graphic % GFX_PER_LINE) * TILEX;
556 src_y = SY + (graphic / GFX_PER_LINE) * TILEY;
558 else if (graphic >= GFX_START_ROCKSHEROES &&
559 graphic <= GFX_END_ROCKSHEROES)
561 src_pixmap = clipmask[PIX_HEROES];
562 graphic -= GFX_START_ROCKSHEROES;
563 src_x = (graphic % HEROES_PER_LINE) * TILEX;
564 src_y = (graphic / HEROES_PER_LINE) * TILEY;
566 else if (graphic >= GFX_START_ROCKSFONT &&
567 graphic <= GFX_END_ROCKSFONT)
569 src_pixmap = clipmask[PIX_BIGFONT];
570 graphic -= GFX_START_ROCKSFONT;
571 src_x = (graphic % FONT_CHARS_PER_LINE) * TILEX;
572 src_y = (graphic / FONT_CHARS_PER_LINE) * TILEY +
573 FC_SPECIAL1 * FONT_LINES_PER_FONT * TILEY;
578 tile_clipmask[tile] = XCreatePixmap(display, window, TILEX,TILEY, 1);
580 XCopyArea(display,src_pixmap,tile_clipmask[tile],copy_clipmask_gc,
581 src_x,src_y, TILEX,TILEY, 0,0);
585 if (!pix[PIX_DB_BACK] || !pix[PIX_DB_DOOR])
586 Error(ERR_EXIT, "cannot create additional pixmaps");
588 for(i=0; i<NUM_PIXMAPS; i++)
592 clip_gc_values.graphics_exposures = False;
593 clip_gc_values.clip_mask = clipmask[i];
594 clip_gc_valuemask = GCGraphicsExposures | GCClipMask;
595 clip_gc[i] = XCreateGC(display,window,clip_gc_valuemask,&clip_gc_values);
599 drawto = backbuffer = pix[PIX_DB_BACK];
600 fieldbuffer = pix[PIX_DB_FIELD];
601 SetDrawtoField(DRAW_BACKBUFFER);
603 XCopyArea(display,pix[PIX_BACK],backbuffer,gc,
604 0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
605 XFillRectangle(display,pix[PIX_DB_BACK],gc,
606 REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
607 XFillRectangle(display,pix[PIX_DB_DOOR],gc,
608 0,0, 3*DXSIZE,DYSIZE+VYSIZE);
610 for(i=0; i<MAX_BUF_XSIZE; i++)
611 for(j=0; j<MAX_BUF_YSIZE; j++)
614 redraw_mask = REDRAW_ALL;
617 void LoadGfx(int pos, struct PictureFileInfo *pic)
619 char basefilename[256];
622 #ifdef USE_XPM_LIBRARY
623 int xpm_err, xbm_err;
624 unsigned int width,height;
627 char *picture_ext = ".xpm";
628 char *picturemask_ext = "Mask.xbm";
631 char *picture_ext = ".pcx";
635 if (pic->picture_filename)
637 sprintf(basefilename, "%s%s", pic->picture_filename, picture_ext);
638 DrawInitText(basefilename, 150, FC_YELLOW);
639 sprintf(filename, "%s/%s/%s",
640 options.base_directory, GRAPHICS_DIRECTORY, basefilename);
647 debug_print_timestamp(1, NULL); /* initialize timestamp function */
650 #ifdef USE_XPM_LIBRARY
652 xpm_att[pos].valuemask = XpmCloseness;
653 xpm_att[pos].closeness = 20000;
654 xpm_err = XpmReadFileToPixmap(display,window,filename,
655 &pix[pos],&shapemask,&xpm_att[pos]);
659 Error(ERR_EXIT, "cannot open XPM file '%s'", filename);
661 Error(ERR_EXIT, "invalid XPM file '%s'", filename);
663 Error(ERR_EXIT, "not enough memory for XPM file '%s'", filename);
665 Error(ERR_EXIT, "cannot get colors for XPM file '%s'", filename);
671 printf("LOADING XPM FILE %s:", filename);
672 debug_print_timestamp(1, "");
675 #else /* !USE_XPM_LIBRARY */
677 pcx_err = Read_PCX_to_Pixmaps(display, window, gc, filename,
678 &pix[pos], &clipmask[pos]);
684 Error(ERR_EXIT, "cannot open PCX file '%s'", filename);
686 Error(ERR_EXIT, "cannot read PCX file '%s'", filename);
687 case PCX_FileInvalid:
688 Error(ERR_EXIT, "invalid PCX file '%s'", filename);
690 Error(ERR_EXIT, "not enough memory for PCX file '%s'", filename);
691 case PCX_ColorFailed:
692 Error(ERR_EXIT, "cannot get colors for PCX file '%s'", filename);
698 printf("SUMMARY LOADING PCX FILE %s:", filename);
699 debug_print_timestamp(1, "");
702 #endif /* !USE_XPM_LIBRARY */
705 Error(ERR_EXIT, "cannot get graphics for '%s'", pic->picture_filename);
708 /* zugehörige Maske laden (wenn vorhanden) */
709 if (pic->picture_with_mask)
711 #ifdef USE_XPM_LIBRARY
713 sprintf(basefilename, "%s%s", pic->picture_filename, picturemask_ext);
714 DrawInitText(basefilename, 150, FC_YELLOW);
715 sprintf(filename, "%s/%s/%s",
716 options.base_directory, GRAPHICS_DIRECTORY, basefilename);
719 debug_print_timestamp(1, NULL); /* initialize timestamp function */
722 xbm_err = XReadBitmapFile(display,window,filename,
723 &width,&height,&clipmask[pos],&hot_x,&hot_y);
728 case BitmapOpenFailed:
729 Error(ERR_EXIT, "cannot open XBM file '%s'", filename);
730 case BitmapFileInvalid:
731 Error(ERR_EXIT, "invalid XBM file '%s'", filename);
733 Error(ERR_EXIT, "not enough memory for XBM file '%s'", filename);
740 printf("LOADING XBM FILE %s:", filename);
741 debug_print_timestamp(1, "");
744 #endif /* USE_XPM_LIBRARY */
747 Error(ERR_EXIT, "cannot get clipmask for '%s'", pic->picture_filename);
751 void InitElementProperties()
755 static int ep_amoebalive[] =
762 static int ep_amoebalive_num = sizeof(ep_amoebalive)/sizeof(int);
764 static int ep_amoeboid[] =
772 static int ep_amoeboid_num = sizeof(ep_amoeboid)/sizeof(int);
774 static int ep_schluessel[] =
781 static int ep_schluessel_num = sizeof(ep_schluessel)/sizeof(int);
783 static int ep_pforte[] =
794 static int ep_pforte_num = sizeof(ep_pforte)/sizeof(int);
796 static int ep_solid[] =
829 static int ep_solid_num = sizeof(ep_solid)/sizeof(int);
831 static int ep_massiv[] =
849 static int ep_massiv_num = sizeof(ep_massiv)/sizeof(int);
851 static int ep_slippery[] =
873 static int ep_slippery_num = sizeof(ep_slippery)/sizeof(int);
875 static int ep_enemy[] =
886 static int ep_enemy_num = sizeof(ep_enemy)/sizeof(int);
888 static int ep_mauer[] =
910 static int ep_mauer_num = sizeof(ep_mauer)/sizeof(int);
912 static int ep_can_fall[] =
930 static int ep_can_fall_num = sizeof(ep_can_fall)/sizeof(int);
932 static int ep_can_smash[] =
951 static int ep_can_smash_num = sizeof(ep_can_smash)/sizeof(int);
953 static int ep_can_change[] =
963 static int ep_can_change_num = sizeof(ep_can_change)/sizeof(int);
965 static int ep_can_move[] =
981 static int ep_can_move_num = sizeof(ep_can_move)/sizeof(int);
983 static int ep_could_move[] =
1006 static int ep_could_move_num = sizeof(ep_could_move)/sizeof(int);
1008 static int ep_dont_touch[] =
1015 static int ep_dont_touch_num = sizeof(ep_dont_touch)/sizeof(int);
1017 static int ep_dont_go_to[] =
1030 static int ep_dont_go_to_num = sizeof(ep_dont_go_to)/sizeof(int);
1032 static int ep_mampf2[] =
1055 static int ep_mampf2_num = sizeof(ep_mampf2)/sizeof(int);
1057 static int ep_bd_element[] =
1082 static int ep_bd_element_num = sizeof(ep_bd_element)/sizeof(int);
1084 static int ep_sb_element[] =
1089 EL_SOKOBAN_FELD_LEER,
1090 EL_SOKOBAN_FELD_VOLL,
1093 static int ep_sb_element_num = sizeof(ep_sb_element)/sizeof(int);
1095 static int ep_gem[] =
1104 static int ep_gem_num = sizeof(ep_gem)/sizeof(int);
1106 static int ep_inactive[] =
1142 EL_SOKOBAN_FELD_LEER,
1143 EL_SOKOBAN_FELD_VOLL,
1156 static int ep_inactive_num = sizeof(ep_inactive)/sizeof(int);
1158 static int ep_explosive[] =
1174 static int ep_explosive_num = sizeof(ep_explosive)/sizeof(int);
1176 static int ep_mampf3[] =
1185 static int ep_mampf3_num = sizeof(ep_mampf3)/sizeof(int);
1187 static int ep_pushable[] =
1193 EL_SOKOBAN_FELD_VOLL,
1197 static int ep_pushable_num = sizeof(ep_pushable)/sizeof(int);
1199 static int ep_player[] =
1207 static int ep_player_num = sizeof(ep_player)/sizeof(int);
1209 static long ep_bit[] =
1237 static int *ep_array[] =
1265 static int *ep_num[] =
1293 static int num_properties = sizeof(ep_num)/sizeof(int *);
1295 for(i=0; i<MAX_ELEMENTS; i++)
1296 Elementeigenschaften[i] = 0;
1298 for(i=0; i<num_properties; i++)
1299 for(j=0; j<*(ep_num[i]); j++)
1300 Elementeigenschaften[(ep_array[i])[j]] |= ep_bit[i];
1301 for(i=EL_CHAR_START; i<EL_CHAR_END; i++)
1302 Elementeigenschaften[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
1305 void CloseAllAndExit(int exit_value)
1309 if (sound_process_id)
1312 kill(sound_process_id, SIGTERM);
1313 FreeSounds(NUM_SOUNDS);
1316 for(i=0; i<NUM_PIXMAPS; i++)
1320 #ifdef USE_XPM_LIBRARY
1321 if (i < NUM_PICTURES) /* XPM pictures */
1323 XFreeColors(display,DefaultColormap(display,screen),
1324 xpm_att[i].pixels,xpm_att[i].npixels,0);
1325 XpmFreeAttributes(&xpm_att[i]);
1328 XFreePixmap(display,pix[i]);
1331 XFreePixmap(display,clipmask[i]);
1333 XFreeGC(display, clip_gc[i]);
1337 XFreeGC(display, gc);
1341 XAutoRepeatOn(display);
1342 XCloseDisplay(display);