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 ***********************************************************/
30 GC gc, clip_gc[NUM_PIXMAPS], tile_clip_gc;
31 Pixmap pix[NUM_PIXMAPS];
32 Pixmap clipmask[NUM_PIXMAPS], tile_clipmask[NUM_TILES];
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;
49 char *program_name = NULL;
51 int game_status = MAINMENU;
52 int game_emulation = EMU_NONE;
53 boolean network_playing = FALSE;
54 int button_status = MB_NOT_PRESSED;
55 boolean motion_status = FALSE;
56 int key_joystick_mapping = 0;
57 int global_joystick_status = JOYSTICK_STATUS;
58 int joystick_status = JOYSTICK_STATUS;
59 int sound_status = SOUND_STATUS;
60 boolean sound_loops_allowed = FALSE;
62 boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
63 int redraw_x1 = 0, redraw_y1 = 0;
67 short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
68 short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
69 short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
70 short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
71 short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
72 short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
73 short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
74 short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
75 short Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
76 boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
77 short JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
78 short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
79 short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
80 unsigned long Elementeigenschaften[MAX_ELEMENTS];
82 int level_nr, leveldir_nr, num_leveldirs;
83 int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
85 int FX = SX, FY = SY, ScrollStepSize = TILEX/8;
86 int ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
88 int GameFrameDelay = GAME_FRAME_DELAY;
89 int FfwdFrameDelay = FFWD_FRAME_DELAY;
91 int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
92 int ZX,ZY, ExitX,ExitY;
94 int FrameCounter, TimeFrames, TimeLeft;
95 int MampferNr, SiebAktiv;
97 boolean network_player_action_received = FALSE;
100 struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES];
101 struct LevelInfo level;
102 struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
103 struct HiScore highscore[MAX_SCORE_ENTRIES];
104 struct SoundInfo Sound[NUM_SOUNDS];
105 struct RecordingInfo tape;
106 struct OptionInfo options;
107 struct SetupInfo setup;
108 struct SetupFileList *setup_list = NULL;
109 struct SetupFileList *level_setup_list = NULL;
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);
189 int main(int argc, char *argv[])
191 program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]);
201 exit(0); /* to keep compilers happy */