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);
323 static struct IconFileInfo icon_pic =
330 screen_width = XDisplayWidth(display, screen);
331 screen_height = XDisplayHeight(display, screen);
336 win_xpos = (screen_width - width) / 2;
337 win_ypos = (screen_height - height) / 2;
339 window = XCreateSimpleWindow(display, RootWindow(display, screen),
340 win_xpos, win_ypos, width, height, border_width,
344 proto_atom = XInternAtom(display, "WM_PROTOCOLS", FALSE);
345 delete_atom = XInternAtom(display, "WM_DELETE_WINDOW", FALSE);
346 if ((proto_atom != None) && (delete_atom != None))
347 XChangeProperty(display, window, proto_atom, XA_ATOM, 32,
348 PropModePrepend, (unsigned char *) &delete_atom, 1);
350 sprintf(icon_filename, "%s/%s/%s",
351 options.base_directory, GRAPHICS_DIRECTORY,
352 icon_pic.picture_filename);
353 XReadBitmapFile(display,window,icon_filename,
354 &icon_width,&icon_height,
355 &icon_pixmap,&icon_hot_x,&icon_hot_y);
357 Error(ERR_EXIT, "cannot read icon bitmap file '%s'", icon_filename);
359 sprintf(icon_filename, "%s/%s/%s",
360 options.base_directory, GRAPHICS_DIRECTORY,
361 icon_pic.picturemask_filename);
362 XReadBitmapFile(display,window,icon_filename,
363 &icon_width,&icon_height,
364 &iconmask_pixmap,&icon_hot_x,&icon_hot_y);
365 if (!iconmask_pixmap)
366 Error(ERR_EXIT, "cannot read icon bitmap file '%s'", icon_filename);
368 size_hints.width = size_hints.min_width = size_hints.max_width = width;
369 size_hints.height = size_hints.min_height = size_hints.max_height = height;
370 size_hints.flags = PSize | PMinSize | PMaxSize;
372 if (win_xpos || win_ypos)
374 size_hints.x = win_xpos;
375 size_hints.y = win_ypos;
376 size_hints.flags |= PPosition;
379 if (!XStringListToTextProperty(&window_name, 1, &windowName))
380 Error(ERR_EXIT, "structure allocation for windowName failed");
382 if (!XStringListToTextProperty(&icon_name, 1, &iconName))
383 Error(ERR_EXIT, "structure allocation for iconName failed");
385 wm_hints.initial_state = NormalState;
386 wm_hints.input = True;
387 wm_hints.icon_pixmap = icon_pixmap;
388 wm_hints.icon_mask = iconmask_pixmap;
389 wm_hints.flags = StateHint | IconPixmapHint | IconMaskHint | InputHint;
391 class_hints.res_name = program_name;
392 class_hints.res_class = "Rocks'n'Diamonds";
394 XSetWMProperties(display, window, &windowName, &iconName,
395 argv, argc, &size_hints, &wm_hints,
398 XFree(windowName.value);
399 XFree(iconName.value);
401 /* Select event types wanted */
402 window_event_mask = ExposureMask | StructureNotifyMask | FocusChangeMask |
403 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
404 KeyPressMask | KeyReleaseMask;
405 XSelectInput(display, window, window_event_mask);
408 /* create GC for drawing with window depth */
409 gc_values.graphics_exposures = False;
410 gc_values.foreground = pen_bg;
411 gc_values.background = pen_bg;
412 gc_valuemask = GCGraphicsExposures | GCForeground | GCBackground;
413 gc = XCreateGC(display, window, gc_valuemask, &gc_values);
416 void DrawInitText(char *text, int ypos, int color)
418 if (display && window && pix[PIX_SMALLFONT])
420 XFillRectangle(display,window,gc,0,ypos, WIN_XSIZE,FONT2_YSIZE);
421 DrawTextExt(window,gc,(WIN_XSIZE-strlen(text)*FONT2_XSIZE)/2,
422 ypos,text,FS_SMALL,color);
431 XGCValues clip_gc_values;
432 unsigned long clip_gc_valuemask;
435 static struct PictureFileInfo pic[NUM_PICTURES] =
445 static struct PictureFileInfo pic[NUM_PICTURES] =
447 { "RocksScreen", TRUE },
448 { "RocksDoor", TRUE },
449 { "RocksHeroes", TRUE },
450 { "RocksToons", TRUE },
451 { "RocksFont", FALSE },
452 { "RocksFont2", FALSE }
461 tile_needs_clipping[] =
463 { GFX_SPIELER1_UP, 4 },
464 { GFX_SPIELER1_DOWN, 4 },
465 { GFX_SPIELER1_LEFT, 4 },
466 { GFX_SPIELER1_RIGHT, 4 },
467 { GFX_SPIELER1_PUSH_LEFT, 4 },
468 { GFX_SPIELER1_PUSH_RIGHT, 4 },
469 { GFX_SPIELER2_UP, 4 },
470 { GFX_SPIELER2_DOWN, 4 },
471 { GFX_SPIELER2_LEFT, 4 },
472 { GFX_SPIELER2_RIGHT, 4 },
473 { GFX_SPIELER2_PUSH_LEFT, 4 },
474 { GFX_SPIELER2_PUSH_RIGHT, 4 },
475 { GFX_SPIELER3_UP, 4 },
476 { GFX_SPIELER3_DOWN, 4 },
477 { GFX_SPIELER3_LEFT, 4 },
478 { GFX_SPIELER3_RIGHT, 4 },
479 { GFX_SPIELER3_PUSH_LEFT, 4 },
480 { GFX_SPIELER3_PUSH_RIGHT, 4 },
481 { GFX_SPIELER4_UP, 4 },
482 { GFX_SPIELER4_DOWN, 4 },
483 { GFX_SPIELER4_LEFT, 4 },
484 { GFX_SPIELER4_RIGHT, 4 },
485 { GFX_SPIELER4_PUSH_LEFT, 4 },
486 { GFX_SPIELER4_PUSH_RIGHT, 4 },
487 { GFX_GEBLUBBER, 4 },
490 { GFX_EXPLOSION, 8 },
491 { GFX_SOKOBAN_OBJEKT, 1 },
492 { GFX_FUNKELN_BLAU, 3 },
493 { GFX_FUNKELN_WEISS, 3 },
498 debug_print_timestamp(0, NULL); /* initialize timestamp function */
501 LoadGfx(PIX_SMALLFONT,&pic[PIX_SMALLFONT]);
502 DrawInitText(WINDOWTITLE_STRING,20,FC_YELLOW);
503 DrawInitText(COPYRIGHT_STRING,50,FC_RED);
505 DrawInitText("MSDOS version done by Guido Schulz",210,FC_BLUE);
508 DrawInitText("Loading graphics:",120,FC_GREEN);
510 for(i=0; i<NUM_PICTURES; i++)
511 if (i != PIX_SMALLFONT)
515 debug_print_timestamp(0, "SUMMARY LOADING ALL GRAPHICS:");
518 pix[PIX_DB_BACK] = XCreatePixmap(display, window,
520 XDefaultDepth(display,screen));
521 pix[PIX_DB_DOOR] = XCreatePixmap(display, window,
522 3*DXSIZE,DYSIZE+VYSIZE,
523 XDefaultDepth(display,screen));
524 pix[PIX_DB_FIELD] = XCreatePixmap(display, window,
526 XDefaultDepth(display,screen));
528 clip_gc_values.graphics_exposures = False;
529 clip_gc_valuemask = GCGraphicsExposures;
531 XCreateGC(display,clipmask[PIX_BACK],clip_gc_valuemask,&clip_gc_values);
533 clip_gc_values.graphics_exposures = False;
534 clip_gc_valuemask = GCGraphicsExposures;
536 XCreateGC(display,window,clip_gc_valuemask,&clip_gc_values);
538 /* initialize pixmap array to Pixmap 'None' */
539 for(i=0; i<NUM_TILES; i++)
540 tile_clipmask[i] = None;
542 /* create only those clipping Pixmaps we really need */
543 for(i=0; tile_needs_clipping[i].start>=0; i++)
545 for(j=0; j<tile_needs_clipping[i].count; j++)
547 int tile = tile_needs_clipping[i].start + j;
552 if (graphic >= GFX_START_ROCKSSCREEN &&
553 graphic <= GFX_END_ROCKSSCREEN)
555 src_pixmap = clipmask[PIX_BACK];
556 graphic -= GFX_START_ROCKSSCREEN;
557 src_x = SX + (graphic % GFX_PER_LINE) * TILEX;
558 src_y = SY + (graphic / GFX_PER_LINE) * TILEY;
560 else if (graphic >= GFX_START_ROCKSHEROES &&
561 graphic <= GFX_END_ROCKSHEROES)
563 src_pixmap = clipmask[PIX_HEROES];
564 graphic -= GFX_START_ROCKSHEROES;
565 src_x = (graphic % HEROES_PER_LINE) * TILEX;
566 src_y = (graphic / HEROES_PER_LINE) * TILEY;
568 else if (graphic >= GFX_START_ROCKSFONT &&
569 graphic <= GFX_END_ROCKSFONT)
571 src_pixmap = clipmask[PIX_BIGFONT];
572 graphic -= GFX_START_ROCKSFONT;
573 src_x = (graphic % FONT_CHARS_PER_LINE) * TILEX;
574 src_y = (graphic / FONT_CHARS_PER_LINE) * TILEY +
575 FC_SPECIAL1 * FONT_LINES_PER_FONT * TILEY;
580 tile_clipmask[tile] = XCreatePixmap(display, window, TILEX,TILEY, 1);
582 XCopyArea(display,src_pixmap,tile_clipmask[tile],copy_clipmask_gc,
583 src_x,src_y, TILEX,TILEY, 0,0);
587 if (!pix[PIX_DB_BACK] || !pix[PIX_DB_DOOR])
588 Error(ERR_EXIT, "cannot create additional pixmaps");
590 for(i=0; i<NUM_PIXMAPS; i++)
594 clip_gc_values.graphics_exposures = False;
595 clip_gc_values.clip_mask = clipmask[i];
596 clip_gc_valuemask = GCGraphicsExposures | GCClipMask;
597 clip_gc[i] = XCreateGC(display,window,clip_gc_valuemask,&clip_gc_values);
601 drawto = backbuffer = pix[PIX_DB_BACK];
602 fieldbuffer = pix[PIX_DB_FIELD];
603 SetDrawtoField(DRAW_BACKBUFFER);
605 XCopyArea(display,pix[PIX_BACK],backbuffer,gc,
606 0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
607 XFillRectangle(display,pix[PIX_DB_BACK],gc,
608 REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
609 XFillRectangle(display,pix[PIX_DB_DOOR],gc,
610 0,0, 3*DXSIZE,DYSIZE+VYSIZE);
612 for(i=0; i<MAX_BUF_XSIZE; i++)
613 for(j=0; j<MAX_BUF_YSIZE; j++)
616 redraw_mask = REDRAW_ALL;
619 void LoadGfx(int pos, struct PictureFileInfo *pic)
621 char basefilename[256];
624 #ifdef USE_XPM_LIBRARY
625 int xpm_err, xbm_err;
626 unsigned int width,height;
629 char *picture_ext = ".xpm";
630 char *picturemask_ext = "Mask.xbm";
633 char *picture_ext = ".pcx";
637 if (pic->picture_filename)
639 sprintf(basefilename, "%s%s", pic->picture_filename, picture_ext);
640 DrawInitText(basefilename, 150, FC_YELLOW);
641 sprintf(filename, "%s/%s/%s",
642 options.base_directory, GRAPHICS_DIRECTORY, basefilename);
649 debug_print_timestamp(1, NULL); /* initialize timestamp function */
652 #ifdef USE_XPM_LIBRARY
654 xpm_att[pos].valuemask = XpmCloseness;
655 xpm_att[pos].closeness = 20000;
656 xpm_err = XpmReadFileToPixmap(display,window,filename,
657 &pix[pos],&shapemask,&xpm_att[pos]);
661 Error(ERR_EXIT, "cannot open XPM file '%s'", filename);
663 Error(ERR_EXIT, "invalid XPM file '%s'", filename);
665 Error(ERR_EXIT, "not enough memory for XPM file '%s'", filename);
667 Error(ERR_EXIT, "cannot get colors for XPM file '%s'", filename);
673 printf("LOADING XPM FILE %s:", filename);
674 debug_print_timestamp(1, "");
677 #else /* !USE_XPM_LIBRARY */
679 pcx_err = Read_PCX_to_Pixmaps(display, window, gc, filename,
680 &pix[pos], &clipmask[pos]);
686 Error(ERR_EXIT, "cannot open PCX file '%s'", filename);
688 Error(ERR_EXIT, "cannot read PCX file '%s'", filename);
689 case PCX_FileInvalid:
690 Error(ERR_EXIT, "invalid PCX file '%s'", filename);
692 Error(ERR_EXIT, "not enough memory for PCX file '%s'", filename);
693 case PCX_ColorFailed:
694 Error(ERR_EXIT, "cannot get colors for PCX file '%s'", filename);
700 printf("SUMMARY LOADING PCX FILE %s:", filename);
701 debug_print_timestamp(1, "");
704 #endif /* !USE_XPM_LIBRARY */
707 Error(ERR_EXIT, "cannot get graphics for '%s'", pic->picture_filename);
710 /* zugehörige Maske laden (wenn vorhanden) */
711 if (pic->picture_with_mask)
713 #ifdef USE_XPM_LIBRARY
715 sprintf(basefilename, "%s%s", pic->picture_filename, picturemask_ext);
716 DrawInitText(basefilename, 150, FC_YELLOW);
717 sprintf(filename, "%s/%s/%s",
718 options.base_directory, GRAPHICS_DIRECTORY, basefilename);
721 debug_print_timestamp(1, NULL); /* initialize timestamp function */
724 xbm_err = XReadBitmapFile(display,window,filename,
725 &width,&height,&clipmask[pos],&hot_x,&hot_y);
730 case BitmapOpenFailed:
731 Error(ERR_EXIT, "cannot open XBM file '%s'", filename);
732 case BitmapFileInvalid:
733 Error(ERR_EXIT, "invalid XBM file '%s'", filename);
735 Error(ERR_EXIT, "not enough memory for XBM file '%s'", filename);
742 printf("LOADING XBM FILE %s:", filename);
743 debug_print_timestamp(1, "");
746 #endif /* USE_XPM_LIBRARY */
749 Error(ERR_EXIT, "cannot get clipmask for '%s'", pic->picture_filename);
753 void InitElementProperties()
757 static int ep_amoebalive[] =
764 static int ep_amoebalive_num = sizeof(ep_amoebalive)/sizeof(int);
766 static int ep_amoeboid[] =
774 static int ep_amoeboid_num = sizeof(ep_amoeboid)/sizeof(int);
776 static int ep_schluessel[] =
783 static int ep_schluessel_num = sizeof(ep_schluessel)/sizeof(int);
785 static int ep_pforte[] =
796 static int ep_pforte_num = sizeof(ep_pforte)/sizeof(int);
798 static int ep_solid[] =
831 static int ep_solid_num = sizeof(ep_solid)/sizeof(int);
833 static int ep_massiv[] =
851 static int ep_massiv_num = sizeof(ep_massiv)/sizeof(int);
853 static int ep_slippery[] =
875 static int ep_slippery_num = sizeof(ep_slippery)/sizeof(int);
877 static int ep_enemy[] =
888 static int ep_enemy_num = sizeof(ep_enemy)/sizeof(int);
890 static int ep_mauer[] =
912 static int ep_mauer_num = sizeof(ep_mauer)/sizeof(int);
914 static int ep_can_fall[] =
932 static int ep_can_fall_num = sizeof(ep_can_fall)/sizeof(int);
934 static int ep_can_smash[] =
953 static int ep_can_smash_num = sizeof(ep_can_smash)/sizeof(int);
955 static int ep_can_change[] =
965 static int ep_can_change_num = sizeof(ep_can_change)/sizeof(int);
967 static int ep_can_move[] =
983 static int ep_can_move_num = sizeof(ep_can_move)/sizeof(int);
985 static int ep_could_move[] =
1008 static int ep_could_move_num = sizeof(ep_could_move)/sizeof(int);
1010 static int ep_dont_touch[] =
1017 static int ep_dont_touch_num = sizeof(ep_dont_touch)/sizeof(int);
1019 static int ep_dont_go_to[] =
1032 static int ep_dont_go_to_num = sizeof(ep_dont_go_to)/sizeof(int);
1034 static int ep_mampf2[] =
1057 static int ep_mampf2_num = sizeof(ep_mampf2)/sizeof(int);
1059 static int ep_bd_element[] =
1084 static int ep_bd_element_num = sizeof(ep_bd_element)/sizeof(int);
1086 static int ep_sb_element[] =
1091 EL_SOKOBAN_FELD_LEER,
1092 EL_SOKOBAN_FELD_VOLL,
1095 static int ep_sb_element_num = sizeof(ep_sb_element)/sizeof(int);
1097 static int ep_gem[] =
1106 static int ep_gem_num = sizeof(ep_gem)/sizeof(int);
1108 static int ep_inactive[] =
1144 EL_SOKOBAN_FELD_LEER,
1145 EL_SOKOBAN_FELD_VOLL,
1158 static int ep_inactive_num = sizeof(ep_inactive)/sizeof(int);
1160 static int ep_explosive[] =
1176 static int ep_explosive_num = sizeof(ep_explosive)/sizeof(int);
1178 static int ep_mampf3[] =
1187 static int ep_mampf3_num = sizeof(ep_mampf3)/sizeof(int);
1189 static int ep_pushable[] =
1195 EL_SOKOBAN_FELD_VOLL,
1199 static int ep_pushable_num = sizeof(ep_pushable)/sizeof(int);
1201 static int ep_player[] =
1209 static int ep_player_num = sizeof(ep_player)/sizeof(int);
1211 static long ep_bit[] =
1239 static int *ep_array[] =
1267 static int *ep_num[] =
1295 static int num_properties = sizeof(ep_num)/sizeof(int *);
1297 for(i=0; i<MAX_ELEMENTS; i++)
1298 Elementeigenschaften[i] = 0;
1300 for(i=0; i<num_properties; i++)
1301 for(j=0; j<*(ep_num[i]); j++)
1302 Elementeigenschaften[(ep_array[i])[j]] |= ep_bit[i];
1303 for(i=EL_CHAR_START; i<EL_CHAR_END; i++)
1304 Elementeigenschaften[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
1307 void CloseAllAndExit(int exit_value)
1311 if (sound_process_id)
1314 kill(sound_process_id, SIGTERM);
1315 FreeSounds(NUM_SOUNDS);
1318 for(i=0; i<NUM_PIXMAPS; i++)
1322 #ifdef USE_XPM_LIBRARY
1323 if (i < NUM_PICTURES) /* XPM pictures */
1325 XFreeColors(display,DefaultColormap(display,screen),
1326 xpm_att[i].pixels,xpm_att[i].npixels,0);
1327 XpmFreeAttributes(&xpm_att[i]);
1330 XFreePixmap(display,pix[i]);
1333 XFreePixmap(display,clipmask[i]);
1335 XFreeGC(display, clip_gc[i]);
1339 XFreeGC(display, gc);
1343 XAutoRepeatOn(display);
1344 XCloseDisplay(display);