1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * ©1995 Artsoft Development *
6 * 33659 Bielefeld-Senne *
7 * Telefon: (0521) 493245 *
8 * eMail: aeglos@valinor.owl.de *
9 * aeglos@uni-paderborn.de *
10 * q99492@pbhrzx.uni-paderborn.de *
11 *----------------------------------------------------------*
13 ***********************************************************/
28 GC gc, clip_gc[NUM_PIXMAPS];
29 Pixmap pix[NUM_PIXMAPS];
30 Pixmap clipmask[NUM_PIXMAPS];
33 Pixmap test_pix[NUM_PICTURES];
34 Pixmap test_clipmask[NUM_PICTURES];
35 int test_picture_count = 0;
38 #ifdef XPM_INCLUDE_FILE
39 XpmAttributes xpm_att[NUM_PICTURES];
42 Drawable drawto, drawto_field, backbuffer, fieldbuffer;
47 char *sound_device_name = SOUND_DEVICE;
48 int joystick_device = 0;
49 char *joystick_device_name[2] = { DEV_JOYSTICK_0, DEV_JOYSTICK_1 };
50 char *level_directory = LEVEL_PATH;
52 unsigned long pen_fg, pen_bg;
54 int game_status = MAINMENU;
55 int game_emulation = EMU_NONE;
56 int button_status = MB_NOT_PRESSED, motion_status = FALSE;
57 int key_joystick_mapping = 0;
58 int global_joystick_status = JOYSTICK_STATUS;
59 int joystick_status = JOYSTICK_STATUS;
60 int sound_status = SOUND_STATUS, sound_on = TRUE;
61 int sound_loops_allowed = FALSE, sound_loops_on = FALSE;
62 int sound_music_on = FALSE;
63 int sound_simple_on = FALSE;
65 int direct_draw_on = FALSE;
66 int scroll_delay_on = FALSE;
67 int soft_scrolling_on = TRUE;
68 int fading_on = FALSE;
69 int autorecord_on = FALSE;
71 int quick_doors = FALSE;
73 BOOL redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
74 int redraw_x1 = 0, redraw_y1 = 0;
78 int Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
79 int Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
80 int MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
81 int MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
82 int MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
83 int Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
84 int Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
85 int Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
86 int Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
87 int JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
88 int AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
89 int AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
90 long Elementeigenschaften[MAX_ELEMENTS];
92 int level_nr, leveldir_nr, num_leveldirs;
93 int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
95 int FX = SX, FY = SY, ScreenMovPos = 0, ScrollStepSize = TILEX/8;
96 int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
97 int JX,JY, lastJX,lastJY, ZX,ZY, ExitX,ExitY;
98 int PlayerMovDir, PlayerMovPos, PlayerPushing;
99 int PlayerFrame, PlayerGfxPos;
100 int PlayerGone, LevelSolved, GameOver;
101 int FrameCounter, TimeFrames, TimeLeft, Score;
102 int Gems, SokobanFields, Lights, Friends;
103 int Dynamite, Key[4], MampferNr;
104 int DynaBombCount, DynaBombSize, DynaBombsLeft, DynaBombXL;
107 struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES];
108 struct LevelInfo level;
109 struct PlayerInfo player;
110 struct HiScore highscore[MAX_SCORE_ENTRIES];
111 struct SoundInfo Sound[NUM_SOUNDS];
112 struct RecordingInfo tape;
114 struct JoystickInfo joystick[2] =
116 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
117 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE },
118 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
119 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE }
122 /* data needed for playing sounds */
123 char *sound_name[NUM_SOUNDS] =
179 /* background music */
180 int background_loop[] =
190 int num_bg_loops = sizeof(background_loop)/sizeof(int);
194 int main(int argc, char *argv[])
199 level_directory = argv[1];