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 ***********************************************************/
30 GC gc, clip_gc[NUM_PIXMAPS];
31 Pixmap pix[NUM_PIXMAPS];
32 Pixmap clipmask[NUM_PIXMAPS];
34 #ifdef XPM_INCLUDE_FILE
35 XpmAttributes xpm_att[NUM_PICTURES];
38 Drawable drawto, drawto_field, backbuffer, fieldbuffer;
43 char *sound_device_name = SOUND_DEVICE;
44 int joystick_device = 0;
45 char *joystick_device_name[2] = { DEV_JOYSTICK_0, DEV_JOYSTICK_1 };
46 char *level_directory = LEVEL_PATH;
48 unsigned long pen_fg, pen_bg;
50 int game_status = MAINMENU;
51 int game_emulation = EMU_NONE;
52 int button_status = MB_NOT_PRESSED, motion_status = FALSE;
53 int key_joystick_mapping = 0;
54 int global_joystick_status = JOYSTICK_STATUS;
55 int joystick_status = JOYSTICK_STATUS;
56 int sound_status = SOUND_STATUS, sound_on = TRUE;
57 int sound_loops_allowed = FALSE, sound_loops_on = FALSE;
58 int sound_music_on = FALSE;
59 int sound_simple_on = FALSE;
61 int direct_draw_on = FALSE;
62 int scroll_delay_on = FALSE;
63 int soft_scrolling_on = TRUE;
64 int fading_on = FALSE;
65 int autorecord_on = FALSE;
67 int quick_doors = FALSE;
69 BOOL redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
70 int redraw_x1 = 0, redraw_y1 = 0;
74 int Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
75 int Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
76 int MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
77 int MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
78 int MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
79 int Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
80 int Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
81 int Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
82 int Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
83 int JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
84 int AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
85 int AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
86 long Elementeigenschaften[MAX_ELEMENTS];
88 int level_nr, leveldir_nr, num_leveldirs;
89 int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
91 int FX = SX, FY = SY, ScreenMovPos = 0, ScrollStepSize = TILEX/8;
92 int GameSpeed = GAME_FRAME_DELAY, MoveSpeed = 8;
93 int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
94 int JX,JY, lastJX,lastJY, ZX,ZY, ExitX,ExitY;
95 int PlayerMovDir, PlayerMovPos, PlayerPushing;
96 int PlayerFrame, PlayerGfxPos;
97 int PlayerGone, LevelSolved, GameOver;
98 int FrameCounter, TimeFrames, TimeLeft, Score;
99 int Gems, SokobanFields, Lights, Friends;
100 int Dynamite, Key[4], MampferNr;
101 int DynaBombCount, DynaBombSize, DynaBombsLeft, DynaBombXL;
104 struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES];
105 struct LevelInfo level;
106 struct PlayerInfo player;
107 struct HiScore highscore[MAX_SCORE_ENTRIES];
108 struct SoundInfo Sound[NUM_SOUNDS];
109 struct RecordingInfo tape;
111 struct JoystickInfo joystick[2] =
113 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
114 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE },
115 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
116 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE }
119 /* data needed for playing sounds */
120 char *sound_name[NUM_SOUNDS] =
176 /* background music */
177 int background_loop[] =
187 int num_bg_loops = sizeof(background_loop)/sizeof(int);
191 int main(int argc, char *argv[])
196 level_directory = argv[1];