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;
50 char *display_name = NULL;
51 char *server_host = NULL;
53 int standalone = TRUE;
56 int game_status = MAINMENU;
57 int game_emulation = EMU_NONE;
58 int button_status = MB_NOT_PRESSED, motion_status = FALSE;
59 int key_joystick_mapping = 0;
60 int global_joystick_status = JOYSTICK_STATUS;
61 int joystick_status = JOYSTICK_STATUS;
62 int sound_status = SOUND_STATUS, sound_on = TRUE;
63 int sound_loops_allowed = FALSE, sound_loops_on = FALSE;
64 int sound_music_on = FALSE;
65 int sound_simple_on = FALSE;
67 int direct_draw_on = FALSE;
68 int scroll_delay_on = FALSE;
69 int soft_scrolling_on = TRUE;
70 int fading_on = FALSE;
71 int autorecord_on = FALSE;
73 int quick_doors = FALSE;
75 BOOL redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
76 int redraw_x1 = 0, redraw_y1 = 0;
80 int Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
81 int Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
82 int MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
83 int MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
84 int MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
85 int Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
86 int Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
87 int StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
88 int Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
89 int Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
90 int JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
91 int AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
92 int AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
93 long Elementeigenschaften[MAX_ELEMENTS];
95 int level_nr, leveldir_nr, num_leveldirs;
96 int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
98 int FX = SX, FY = SY, ScrollStepSize = TILEX/8;
99 int ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
100 int ScreenGfxPos = 0;
101 int GameFrameDelay = GAME_FRAME_DELAY, MoveSpeed = 8;
102 int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
103 int ZX,ZY, ExitX,ExitY;
105 int FrameCounter, TimeFrames, TimeLeft;
106 int MampferNr, SiebAktiv;
108 byte network_player_action[MAX_PLAYERS];
109 BOOL network_player_action_stored = FALSE;
112 struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES];
113 struct LevelInfo level;
114 struct PlayerInfo stored_player[MAX_PLAYERS+1];
115 struct PlayerInfo *local_player;
116 struct HiScore highscore[MAX_SCORE_ENTRIES];
117 struct SoundInfo Sound[NUM_SOUNDS];
118 struct RecordingInfo tape;
120 struct JoystickInfo joystick[2] =
122 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
123 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE },
124 { JOYSTICK_XLEFT, JOYSTICK_XRIGHT, JOYSTICK_XMIDDLE,
125 JOYSTICK_YUPPER, JOYSTICK_YLOWER, JOYSTICK_YMIDDLE }
128 /* data needed for playing sounds */
129 char *sound_name[NUM_SOUNDS] =
185 /* background music */
186 int background_loop[] =
196 int num_bg_loops = sizeof(background_loop)/sizeof(int);
198 int main(int argc, char *argv[])
200 program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]);
210 exit(0); /* to keep compilers happy */